Skip to content

Instantly share code, notes, and snippets.

@bstory32
Created February 20, 2014 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bstory32/9119768 to your computer and use it in GitHub Desktop.
Save bstory32/9119768 to your computer and use it in GitHub Desktop.
javascript: keystroke
console.log('EASTER EGG');
var keys = [];
var thiz= this;
if (window.addEventListener) {
window.addEventListener("keydown", function(e){
keys.push( e.keyCode );
console.log(keys);
if(keys.toString().indexOf('72,65,82,76,69,77,83,72,65,75,69') >= 0){
console.log('HARLEM SHAKE');
keys = [];
} else if(keys.toString().indexOf('65,74,65,88') >= 0){
Loading.toggle();
keys = [];
} else if(keys.toString().indexOf('65,74,65,88') >= 0){
console.log('=====================================');
keys = [];
}
}, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment