Skip to content

Instantly share code, notes, and snippets.

@gilmoreorless
Created September 28, 2011 06:15
Show Gist options
  • Save gilmoreorless/1247117 to your computer and use it in GitHub Desktop.
Save gilmoreorless/1247117 to your computer and use it in GitHub Desktop.
Brighten your day
var $all = jQuery('*'),
R = function (n) {
return ~~(Math.random() * n);
}
setInterval(function () {
$all.eq(R($all.length)).css('backgroundColor','rgb('+R(255)+','+R(255)+','+R(255)+')')
}, 10);
// Tweet-sized version (140 bytes)
A=$('*'),R=Math.random,M=-257;setInterval(function(){A.eq(R()*A.length).css('background','rgb('+~(R()*M)+','+~(R()*M)+','+~(R()*M)+')')},9)
var $all = jQuery('*'),
R = function (n) {
return ~~(Math.random() * n);
}
setInterval(function () {
$all.eq(R($all.length)).css('WebkitTransform','rotate('+R(360)+'deg)')
}, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment