Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ddprrt/konamicode.js
Easter-egg your website with the konami-code
https://github.com/ddprrt/konamicode.js
Last synced: 5 days ago
JSON representation
Easter-egg your website with the konami-code
- Host: GitHub
- URL: https://github.com/ddprrt/konamicode.js
- Owner: ddprrt
- Created: 2012-06-05T11:23:58.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-10T12:44:55.000Z (almost 10 years ago)
- Last Synced: 2024-12-10T06:45:00.254Z (27 days ago)
- Language: JavaScript
- Size: 119 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](http://en.wikipedia.org/wiki/Konami_Code)
## Bower package
Install konamicode.js with [Bower](http://bower.io)
```
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:
```javascript
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:
```javascript
$('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.```javascript
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.