top | item 3207031

Konami Code Sites

2 points| necenzurat | 14 years ago |konamicodesites.com | reply

2 comments

order
[+] TobbenTM|14 years ago|reply
That is awesome, could anyone explain how it is done? Could not find anything (I understood) in the source.
[+] TobbenTM|14 years ago|reply
Nevermind, found it:

  <script type="text/javascript">
 if ( window.addEventListener ) {  
   var state = 0, konami = [38,38,40,40,37,39,37,39,66,65];  
   window.addEventListener("keydown", function(e) {  
     if ( e.keyCode == konami[state] ) state++;  
     else state = 0;  
     if ( state == 10 )  
       window.location = "http://www.url.tld;
     }, true);  
 }  
 </script>