Sunday, March 11, 2007

Bookmarklet to animate the clouds on Twitter.com


Opera/FF:
javascript:(function(){_c=0;d_=document; d_.styleSheets[0].insertRule("div, h1{opacity:0.7}",2);d_.body.style.backgroundRepeat="repeat-x"; setInterval(function(){ d_.body.style.backgroundPosition=(_c++)+"px top"; },40);})()

IE:
javascript:(function(){_c=0; d_=document;d_.styleSheets[0].addRule("div","filter:alpha(opacity=70)}",2); d_.body.style.backgroundRepeat="repeat-x";setInterval(function(){ d_.body.style.backgroundPosition=(_c++)+"px top";},40);})()


Test it out on http://www.twitter.com

It makes the content partly transparent, and the clouds flow towards the right.

The reason that I made this useless bookmarklet is that I liked the clouds when they were positionary, but I wanted to see how they looked moving about.

The animation is quite CPU-intensive.. Not sure how to optimize this..

0 comments: