You like to amaze or annoy users of your website with funny easter eggs? Then this repository is what you need! It provides a lot of easter eggs and a simple API.
If you have more ideas, tell me!
Notice that it is still in development.
Click here to see a demo page.
The aim is to install it via npm with npm install eastereck --save-dev
and then just require or import it.
This is not supported yet, but it's coming soon.
var eastereck = require('eastereck');
An other way is to include it via script tag in HTML:
<script src="https://github.com/KevinHerklotz/eastereck/dist/eastereck.min.js"></script>
This adds the eastereck object to the global scope, so you can start an easter egg with eastereck.eastereggname.start()
.
And yes, everything (images, sounds, style, ...) is already included in this one JavaScript file.
// Example:
<button onclick="eastereck.unicorncursor.start()">change cursor</button>
// To start it
eastereck.functionname.start(duration, callback);
// To stop it
eastereck.functionname.stop();
The function start() accepts two parameters. Both are optional:
- duration - time in milliseconds before stop() function is triggered, default is 0 which means that stop() function is never triggered automatically
- callback - function that will be executed after the duration triggered the stop() function
// Example:
eastereck.upsidedown.start(2000, function() {
alert('That was just a joke.');
});
(alphabetical order)
Blurred screen like when you are drunken. Takes 5 seconds till it gets 100% blurred.
Does not work in IE (see caniuse.com).
If you use icon fonts on your website, they start to dance, rotate or jump.
Effected icons are elements that match the following selector: '.fa, .material-icons, .glyphicon, .icon, .octicon, .mega-octicon, .typcn'.
Alternating neon colors that will make your eyes bleed.
An embarrassing porn sound is played.
Website is moving around.
Cursor turns into unicorn.
Screen will rotate 180 degree and an upside down cursor is shown (can be overwritten by "unicorncursor"). Most funny on mobile devices, when the user tries to rotate the device to solve the problem.
Doesn't work if "shaking" is active.
You think you broke your screen glass! Even with the sound of breaking glass.
Screen will flicker like an old television.
Displays a very mean Captcha.
Scrolling up will scroll down the page and vice versa.
Unicorns appear all over the screen and a fancy unicorn song is played.