JavaScript Icon

fool.js: Punk your readers with CSS3 transforms

logged by @logbot 2011-04-01T15:01:00Z permalink #javascript

It’s either the funnest or most annoying day on the Interwebs, depending on your level of humor and caffeination. Tomás Senart, creator of Sight shared an easy way to punk your users on this special day with CSS3 Transformations:

//  Uncomment the next line if you want the prank to happen only when the url hashtag is #april
//  if (document.location.hash.indexOf('april') > -1) = = = = =
  'rotate(' + [45, 90, 135, 180, 225, 270, 315][Math.floor(Math.random() * 7)] + 'deg)';

If you view our site and add #april to the URL hash, you’ll get a special randomly rotated topsy-turvy edition of The Changelog. Refresh as hilarity ensues. Enjoy!

[Source on GitHub]

0:00 / 0:00