Apr 29, 2009

Fun with Java: Unicorn power!

Something amazing, even magical, happened to ESPN.com — unicorns. It seems that the code has been purged now from the site, but when you entered the infamous Konami cheat code (up, up, down, down, left, right, left, right, B, A, enter) on any ESPN.com page a plethora of sparkly unicorns and rainbows would appear.

Don’t’ believe me?

The more you pressed enter, the more unicorns would appear. It seems the source of the Java script came from cornify.com, which prides itself on being “the #1 unicorn and rainbow service worldwide, giving websites sparkle around the world.”

Missed the unicorns on ESPN? You can enter this code into your browser’s address bar and cornify any page:

Or, for more fun with Java, enter this code into your browser bar while on any image-heavy Web page:
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+ "px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+" px"}R++}setInterval('A()',5); void(0)

now watch the images dance around the screen.

Share and share alike
  • email
  • Google Reader
  • Reddit
  • Tumblr