Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkrupinski/easter.js
Easter eggs made easy
https://github.com/rkrupinski/easter.js
Last synced: about 1 month ago
JSON representation
Easter eggs made easy
- Host: GitHub
- URL: https://github.com/rkrupinski/easter.js
- Owner: rkrupinski
- Created: 2013-08-06T18:40:10.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-10T17:56:15.000Z (over 9 years ago)
- Last Synced: 2024-10-29T02:09:19.931Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 249 KB
- Stars: 27
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
easter.js
=========
Easter eggs made easy.[![Build Status](https://travis-ci.org/rkrupinski/easter.js.png?branch=master)](https://travis-ci.org/rkrupinski/easter.js)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)Ever wanted to make the KONAMI code work on your website?
```js
var konamiCode = 'up up down down left right left right b a';var deregister = easter().register(konamiCode, function() {
// do fancy stuff// deregister sequence
deregister();
});
```Installation
------------
`bower install easter.js`Docs
----
Supported sequence formats:
- `['a', 'b', 'c']` \*
- `[65, 66, 67]`
- `['a', 66, 'c']` \*
- `'a b c'` \*\* - When using strings, you're limited to:
- `a-z`
- `0-9`
- `left`, `right`, `up`, `down`, `shift`, `ctrl`, `alt`, `space`Sequence can be deregistered by calling function returned by `register()` call.
Default configuration can be altered as it is exposed via `easter.defaults`. Available configuration options are:
- `sequenceMax`: maximum length of registered sequence (default: `20`)
- `delay`: maximum delay between keystrokes in ms (default: `500`)Using standalone:
```js
easter().register(sequence, callback);
```Using with [RequireJS](http://requirejs.org/):
```js
require(['easter'], function (easter) {
easter().register(sequence, callback);
});
```Using with [browserify](http://browserify.org/):
```js
var easter = require('./easter.js');easter().register(sequence, callback);
```Browser support
---------------
IE9+