nucliweb
2/26/2015 - 2:43 PM

Konami Code

Konami Code

var aKeys = [], konami = "38,38,40,40,37,39,37,39,66,65";

$(document).keydown(function(e) {

  aKeys.push( e.keyCode );

  if ( aKkeys.toString().indexOf( konami ) >= 0 ) {

    $(document).unbind('keydown',arguments.callee);
    
   // do something awesome
    $("body").addClass("konami");
  
  }

});