View Full Version : Konami Code Sites
Since Gruber posted a link to this site (http://konamicodesites.com/) yesterday, I've been trying to figure out how they do it.
I know nothing about JavaScript, which is what I'm thinking is the brains behind the operation. From what I gather, the JavaScript changes the display:none set on the hidden info and makes it show up. But I can't figure it out. Anyone care to help?
Use the code?
http://en.wikipedia.org/wiki/Konami_Code
No, I mean, if someone could help me figure out what JavaScript or whatever else is used so that when the code is entered, the site reacts.
Err, view the source code? It's all right there.
The JQuery site's JavaScript is pretty easy to read. It even has comments. In there I found:
// Hehe.
if ( window.addEventListener ) {
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
window.addEventListener("keydown", function(e){
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 )
window.location = "http://ejohn.org/apps/hero/";
}, true);
}
Thanks Brad. I was trying to read the source of the base site but it didn't have a 'konami' designation. Now that I know the main string, I can see how it works on other sites. Thanks.
zsummers
2009-05-09, 00:41
I like ponies...
My brother and I learnt this code playing Ikari Warriors. That game would have been impossible without it...
vBulletin® v3.6.4, Copyright ©2000-2024, Jelsoft Enterprises Ltd.