Created
February 14, 2013 16:38
-
-
Save rogeruiz/4954071 to your computer and use it in GitHub Desktop.
Harlem Shake Party Starter
https://dl.dropbox.com/u/2354186/randomColor/index.html
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>NEON COLORS</title> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; | |
} | |
#color { | |
display: block; | |
min-width: 100%; | |
min-height: 10000px; | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="color"></div> | |
<script> | |
var get_random_color = function() { | |
var color, letters, _r, _i; | |
letters = '0123456789ABCDEF'.split(''); | |
color = '#'; | |
_i = 0; | |
_r = 6; | |
for (_i; _i < _r; _i++ ) { | |
if (_i > 1){ | |
color += letters[Math.round(Math.random() * 15)]; | |
} else { | |
color += 'F'; | |
} | |
} | |
return color; | |
}; | |
window.setInterval(function(){ | |
document.getElementById('color').style.backgroundColor = get_random_color(); | |
}, 100); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment