Skip to content

Commit

Permalink
Got the error messages working.
Browse files Browse the repository at this point in the history
  • Loading branch information
d8uv authored and sbp committed Feb 23, 2010
1 parent d0c6ac5 commit e0cf155
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 0 additions & 1 deletion index.html
Expand Up @@ -7,7 +7,6 @@ <h1>Recalculating...</h1>
<div class="error"> <div class="error">
<h2>Error!</h2> <h2>Error!</h2>
<p></p> <p></p>
<p></p>
</div> </div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script> </script>
Expand Down
18 changes: 16 additions & 2 deletions script.js
@@ -1,13 +1,14 @@
"use strict"; "use strict";


$(document).ready(function () { $(document).ready(function () {
var max, out, hex; var max, out, hex, rand;
max = 10000; max = 10000;
out = []; out = [];
hex = '01234567890abcdef'; hex = '01234567890abcdef';
rand = Math.random;


function scrollHex() { function scrollHex() {
out.unshift(hex[Math.floor(Math.random() * hex.length)]); out.unshift(hex[Math.floor(rand() * hex.length)]);
if (out.length > max) { if (out.length > max) {
out.pop(); out.pop();
} }
Expand All @@ -25,4 +26,17 @@ $(document).ready(function () {
); );


$('.preamble').show().delay(5000).fadeOut(1500); $('.preamble').show().delay(5000).fadeOut(1500);

function showError() {
$('.error').css({
top: rand() * ($(window).height() - 100),
left: rand() * ($(window).width() - 438)
})
.fadeIn(250).delay(5000).fadeOut(250);

$('.error p').text(out.slice(0, 80).join(' '));
setTimeout(showError, rand() * 20000 + 5500);
}

setTimeout(showError, rand() * 20000 + 5500);
}); });
7 changes: 5 additions & 2 deletions style.css
Expand Up @@ -2,10 +2,13 @@ body {
background:#000; background:#000;
color:#0f0; color:#0f0;
font-family:'Consolas',monospace; font-family:'Consolas',monospace;
letter-spacing:-.25em;
overflow:hidden; overflow:hidden;
} }


p {
letter-spacing:-.25em;
}

body, p, h1, h2 { body, p, h1, h2 {
margin:0; margin:0;
} }
Expand All @@ -16,7 +19,6 @@ background:#020;
padding:2em; padding:2em;
opacity:0.9; opacity:0.9;
position:absolute; position:absolute;
letter-spacing:0;
display:none; display:none;
} }


Expand All @@ -29,4 +31,5 @@ width:40%;
.error { .error {
color:#f00; color:#f00;
padding:1em; padding:1em;
width:25em;
} }

0 comments on commit e0cf155

Please sign in to comment.