Skip to content

Instantly share code, notes, and snippets.

@maximilize
Created July 7, 2015 22:41
Show Gist options
  • Select an option

  • Save maximilize/a5882ca6e6f4a30221f9 to your computer and use it in GitHub Desktop.

Select an option

Save maximilize/a5882ca6e6f4a30221f9 to your computer and use it in GitHub Desktop.
function r(y){
return Math.round(Math.random()*(y||255));
}
a=document;
a.write('<body style="width:100%;height:100%" id="foo"></body>');
b=a.getElementById('foo');
function c(){
b.style.backgroundColor = 'rgb('+r()+','+r()+','+r()+')';
setTimeout(c,50);
};
c();
function d(){
for(i=0;i<10;i++)
a.write('<div style="height:'+r(30)+'px;width:'+r(30)+'px;background-color:rgb('+r()+','+r()+','+r()+');position:fixed;top:'+r(100)+'%;left:'+r(100)+'%;"></div>');
setTimeout(d,100);
}
d();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment