Facebook adds some Flare : Implement Konami Code in your site

The first thing that I do when I come online is to check my mails and then login to facebook and other Social Networking sites. Today was no different. As usual there were many updates and I was scrolling the page seeing the updates one by one. I came across one update which caught my attention. It was something about LensFlare in Facebook. I tried it out and found the result pretty cool. If you have an account in Facebook then you must definitely give it a try.

Steps to view Lens flare on Facebook

1. Login to facebook.com
2. Click once anywhere on your home page
3. Click the following sequence of characters using your keyboard
4. Up, Up, Down, Down, Left, Right, Left, Right, B, A, Enter Key
5. Click again on the page or try to scroll the page up or down

On completing the above steps successfully, this is what showed up on the screen

Konami Code

At first I thought it must be something on the lines of the javascript tricks that have been so popular in Orkut but then I soon realized that it cant be a Javascript trick as it didnt involve any code but just simple sequence of keys. It is nothing but Konami Code – a cheat code that originated on the original NES and has since made its way into many other games. More recently, some popular websites have been getting in on the action, with mischievous easter eggs from sites including Digg and Google Reader.

Those of you who have their sites can implement this code to jazz up their pages. It is totally useless feature which might distract the users from the actual content, but looks sort of nifty and is guaranteed to impress your friends. For at least ten seconds.

  1. <head>
  2. <script type=“text/javascript”>
  3. var $ = {
  4. enabled: false,
  5. tmp: Array(),
  6. _konamiCode: Array(65,66,39,37,39,37,40,40,38,38),
  7. init: function() {
  8. this.tmp = Array(65,66,39,37,39,37,40,40,38,38);
  9. },
  10. konamiCode: function(e) {
  11. if(!this.enabled) {
  12. var t = this.tmp.pop();
  13. if((e.keyCode-t) == 0) {
  14. if(this.tmp.length == 0) {
  15. this.enabled = true;
  16. }
  17. }
  18. else {
  19. this.init();
  20. }
  21. }
  22. else {
  23. this.action();
  24. }
  25. },
  26. // Change the action() function to whatever you want to
  27. action: function() {
  28. alert(“Konami Code Activated”);
  29. }
  30. }
  31. </script>
  32. </head>
  33. <body onload=“$.init()” onkeydown=“$.konamiCode(event)”>
  34. </body>

One Reply to “Facebook adds some Flare : Implement Konami Code in your site”

Leave a Reply

Your email address will not be published. Required fields are marked *