Skip to content

Instantly share code, notes, and snippets.

@EJTH
Last active March 21, 2018 19:25
Show Gist options
  • Save EJTH/9c64831167f55a04608b2a4c7911e8aa to your computer and use it in GitHub Desktop.
Save EJTH/9c64831167f55a04608b2a4c7911e8aa to your computer and use it in GitHub Desktop.
(function(){
var input = [];
var konami = JSON.stringify(["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "KeyB", "KeyA"]);
document.addEventListener('keydown', function(e){
input.push(e.code);
if(JSON.stringify(input.slice(-10)) == konami){
konamiSecret();
}
});
function konami(){
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment