Skip to content

Latest commit

 

History

History
54 lines (45 loc) · 1.49 KB

README.md

File metadata and controls

54 lines (45 loc) · 1.49 KB

EasterEgg

Latest release License

Jquery plugin to create easter eggs in your apps in a very simple way by Francisco Gonzalez

Observation

This allow to set a word to type that will trigger the custom function. For this to work you need to include the Jquery library

<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>

Authors

Francisco Gonzalez, Jorge Rodriguez

Usage

In your javascript, just add the lines:

    var easter = $(window).eastereggs();
    easter.addEgg('magicword', function(){
        // Do something
    });
    easter.init();

You can add as many as you want, using a string or a array of charcodes:

    var easter = $(window).eastereggs();
    easter.addEgg('magicword', function(){
        // Do something
    });
    easter.addEgg([68,69,77,79], function(){
        // Do something 2
    });
    easter.init();

By default we added the KONAMI (up, up, down, down, left, right, left, right, b, a, b, a) code and it's very easy to use:

    var easter = $(window).eastereggs();
    easter.setKonami(function(){
        // Do something
    });
    easter.init();

Copyright and license

Copyright (C) 2015 Francisco Gonzalez

Licensed under the MIT license.