A quick and silly script for adding the Konami Code easter egg to your site. Compatible with gestures on smartphones and tablets as well.

Download View On GitHub

About This Project

Every site should have an implementation of the Konami Code. It makes things more fun! If you're unfamiliar with it, the Konami Code is a "cheat code" that appeared in many of Konami's video games going all the way back to 1986. It was typically entered on a Nintendo controller. Now it's often used on websites to show silly things to visitors when the code is "unlocked."

Konami-JS includes support for gestures on smartphones and tablets. Technically the code becomes "up, up, down, down, left, right, left, right, tap, tap, tap," on these devices but... that's close enough!

Support for touch gestures is automatically loaded when konami.load() is called.


You can install Konami-JS using Bower like so:

bower install konami-js

You can also download the files from GitHub and stick konami.js in your project.

Getting Started

The simplest version of a Konami-JS implementation looks like this:

var easter_egg = new Konami('http://your-special-easter-egg-website.com');

This will redirect the usegr to a specified website upon successfully completing the Konami Code.

You can also pass a function instead of a string:

var easter_egg = new Konami(function() { alert('Konami Code!')});

This will call the function when the code is successfully entered.

Coming Soon

As Seen On...