Last active
August 29, 2015 14:13
-
-
Save rlemon/608181d303a12a2fb114 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
"use strict"; | |
setTimeout(glitch, Math.random() * 3e5); | |
function col() { | |
return '#' + (Math.random() * 100).toString(16).slice(-3) | |
} | |
function glitch() { | |
var n = Math.floor(Math.random() * 4 + 4); | |
(function spazz() { | |
[].forEach.call(document.all, function(el) { | |
el.style.color = col(); | |
el.style.backgroundColor = col(); | |
}); | |
if (!--n) { | |
return finish(); | |
} | |
setTimeout(spazz, 3); | |
}()); | |
} | |
function finish() { | |
[].forEach.call(document.all, function(el) { | |
el.style.color = ''; | |
el.style.backgroundColor = ''; | |
}); | |
setTimeout(glitch, Math.random() * 6e5); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment