Skip to content

ddprrt/konamicode.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

konamicode.js

Easter-egg your website with the konami-code! Every developer loves to add some hidden, tiny bits and pieces into his website or web application once the project goes into its final and stressful phase.

Those easter-eggs can now be done with the hottest cheat-code ever: The Konami Code

Bower package

Install konamicode.js with Bower

bower install konamicode.js

The Konami Code

Press the following keys in order:

↑ ↑ ↓ ↓ ← → ← → B A

(in words. Up Up Down Down Left Right Left Right B A)

Usage

Very simple:

konamicode(document.body, function() {
	alert('Mega Man now has Metal Blade, even though he is not from Konami!')
});

If you use the jQuery extension, you can do it the jQuery way:

$('body').konamicode(function() {
	alert('Now Mega Man has also Bubble Lead. Thanks Konami!');
});

It is also possible to add more callback functions to one element. They are executed one after the other.

konamicode(document.body, function() {
	alert('Mega Man now has Metal Blade, even though he is not from Konami!');
});

konamicode(document.body, function() {
	alert('Mega Man got Atomic Fire');
});

Inclusion

Just download either konamicode.min.js oder konamicode.jquery.min.js. You don't need both, but you need the latter if you want to use it with jQuery.

If you don't want to use the minified version, include the js files from the src directory. You need both if you want to use it with jQuery.

About

Easter-egg your website with the konami-code

Resources

Stars

Watchers

Forks

Packages

No packages published