Paul Irish

Making the www great

Cornify Konami Easter Egg Plugin With jQuery

No doubt you’ve heard that Cornifying is the latest and greatest invention of the internet.

Now you can surreptitiously add it to your own sites, joining The Underground Cabal of Mirthful Protectors of the Corn:

1
2
3
4
5
6
7
8
9
10
11
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
  kkeys.push( e.keyCode );
  if ( kkeys.toString().indexOf( konami ) >= 0 ){
    $(document).unbind('keydown',arguments.callee);
    $.getScript('http://www.cornify.com/js/cornify.js',function(){
      cornify_add();
      $(document).keydown(cornify_add);
    });
  }
});

After a user hits the Konami code (up,up,down,down,left,right,left,right,b,a), every other keystroke will add happiness to the world.

You’ll find this website has already been enabled. Try it out. :)

Update 2009.04.27: It was discovered today ESPN.com was hiding some unicorns under its konami. (kotaku coverage) In fact it had been up there for weeks. :)

2010.05.29: BoingBoing will probably add it. And yeah this feature kinda triggered a meme. :p

2012.03.22: Gunnar Hoffman wrote a better implementation: http://paulirish.com/2009/cornify-easter-egg-with-jquery/#comment-68011

Comments