Skip to content

Commit

Permalink
Resize to fit content to screen. Hi-res skull now scales.
Browse files Browse the repository at this point in the history
  • Loading branch information
threedaymonk committed Feb 17, 2011
1 parent 7d2b98c commit edf95a7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
15 changes: 15 additions & 0 deletions public/main.js
Expand Up @@ -36,6 +36,7 @@ var UI = {

if (UI.entry.container.html() != html) {
UI.entry.container.html(html);
setTimeout(UI.shrinkToFit, 1);
}
},

Expand Down Expand Up @@ -66,6 +67,20 @@ var UI = {
});
},

shrinkToFit: function(){
var fontSize = parseInt($('html').css('font-size'), 10);
if (fontSize < 20) { return; }
var elem = $('#cc li:last-child');
var maxHeight = $('html').outerHeight();
var delta = maxHeight - (elem.offset().top + elem.outerHeight());
console.log(delta);
if (delta < 0) {
var a = (delta < -200) ? 10 : 1;
$('html').css('font-size', (fontSize - a) + 'px');
setTimeout(UI.shrinkToFit, 1);
}
},

start: function(){
UI.entry.loadTemplate();
UI.connectToSocket();
Expand Down
12 changes: 5 additions & 7 deletions public/screen.css
Expand Up @@ -3,7 +3,7 @@ html {
color: white;
height: 100%;
font-family: "Liberation Sans", "Nimbus Sans", "Helvetica", sans-serif;
font-size: 110px;
font-size: 140px;
overflow: hidden;
}
footer p {
Expand All @@ -26,15 +26,13 @@ li {
float: left;
border: 0.05em solid transparent;
}
.Failure {
background-color: #900;
}
.Success {
background-color: #070;
}
.Failure p::before {
content: url(skull.png);
padding-right: 0.15em;
.Failure {
background: #900 url(skull.png) no-repeat;
background-size: contain;
padding-left: 1.4em;
}
@-webkit-keyframes green-throb {
50% { background-color: #0d0; }
Expand Down
Binary file modified public/skull.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit edf95a7

Please sign in to comment.