Permalink
Browse files

Got the error messages working.

  • Loading branch information...
1 parent d0c6ac5 commit e0cf1559fc54851c824178db2c1429acc6d10207 @d8uv d8uv committed with Feb 23, 2010
Showing with 21 additions and 5 deletions.
  1. +0 −1 index.html
  2. +16 −2 script.js
  3. +5 −2 style.css
View
@@ -7,7 +7,6 @@ <h1>Recalculating...</h1>
<div class="error">
<h2>Error!</h2>
<p></p>
- <p></p>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
View
@@ -1,13 +1,14 @@
"use strict";
$(document).ready(function () {
- var max, out, hex;
+ var max, out, hex, rand;
max = 10000;
out = [];
hex = '01234567890abcdef';
+ rand = Math.random;
function scrollHex() {
- out.unshift(hex[Math.floor(Math.random() * hex.length)]);
+ out.unshift(hex[Math.floor(rand() * hex.length)]);
if (out.length > max) {
out.pop();
}
@@ -25,4 +26,17 @@ $(document).ready(function () {
);
$('.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);
});
View
@@ -2,10 +2,13 @@ body {
background:#000;
color:#0f0;
font-family:'Consolas',monospace;
-letter-spacing:-.25em;
overflow:hidden;
}
+p {
+letter-spacing:-.25em;
+}
+
body, p, h1, h2 {
margin:0;
}
@@ -16,7 +19,6 @@ background:#020;
padding:2em;
opacity:0.9;
position:absolute;
-letter-spacing:0;
display:none;
}
@@ -29,4 +31,5 @@ width:40%;
.error {
color:#f00;
padding:1em;
+width:25em;
}

0 comments on commit e0cf155

Please sign in to comment.