An easter egg (in the programming area) is an unexpected or undocumented feature in a piece of computer software or on a DVD, included as a joke or a bonus. Everybody knows the easter eggs of Google, try writing 'Do a barrel roll', 'Zerg Rush' or 'Google in 1998' in Google and you will see them. A lot of software developers used to hide features in software that would only be revealed if you knew a convoluted sequence of key strokes. Gif maker movavi 1 0.
Go back to the old days and implement easter eggs in your apps, in this article you will learn how to add intentional easter eggs or cheats to your web application with Javascript.
A. Using egg.js
HTML Egg allows you to start either with a blank page, or with one of a good selection of pre-designed templates. Great personalization options, including header images, logo, background patterns and images, page width and other options are available. Save on our favorite brands by using our digital grocery coupons. Add coupons to your card and apply them to your in-store purchase or online order. Save on everything from food to fuel. We offer Egg, Bank, Deep Drop LINKABLE Sticks, Rock Cod, Rope Eggs, Cannon Balls, and many Specialty items in a wide variety of sizes. We supply our sinkers to you for less than 50% of the retail prices you have been paying for 10 to 60 lbs. We are now able to offer our sinkers in 5 Lb. Bags as well as our standard 10 Lb.
1. Download and install egg.js
And not, we are not talking about the framework to build better enterprise frameworks and apps. We are talking about egg.js, a very simple script written by Mike Flynn that will allow you to add easter eggs to your web apps, Electron applications or websites. It has no prerequisites and allows you to easily add web easter eggs by watching the user's key strokes. Capturegrid 4 14 – remote capture and advanced camera control.
To add egg.js in your project, you can download it using NPM:
Or with bower:
Or simply download the minified file from the official Github repository here. Then include egg.js with a script tag:
![Html egg 7 80 9 150 Html egg 7 80 9 150](https://upload.wikimedia.org/wikipedia/en/thumb/9/94/Microsoft_Excel.png/300px-Microsoft_Excel.png)
Finally the
Egg
function will be available in the window, this script weights only 1.53KB. Visit the repository of the library for more information.2. Usage of egg.js
Egg.js works in the following way, you need to instantiate a variable with a new class of Egg, then use the addCode method that expects the instructions (keystrokes that need to be pressed) that triggers the easter egg. You can also add a hook, as shown in the following snippet using
addHook
, that will run after any egg code is triggered. You could use it to fire a Google Analytics event or send out a tweet that someone finally found your easter egg. Hooks get access to the whole Egg.js object so you can pull information about the easter egg that fired via this.activeEgg
:If you don't need to know which easter was triggered, then you can simply add the instruction in the constructor as first parameter and as second parameter the callback. From the returned value of the constructor, execute the listen method:
Inside the callback, you can do something like show a Gif that no one expects to see etc. You can see a live example of the script in this website here. Besides you can even use this library to add so to speak 'cheats' for your application.
B. Using cheet.js
1. Download and install cheet.js
To add cheet.js in your project, you can download it using NPM:
![150 150](https://media.springernature.com/lw685/springer-static/image/art%3A10.1038%2Fs41598-017-12019-w/MediaObjects/41598_2017_12019_Fig1_HTML.jpg)
Or with bower:
Or simply download the minified file from the official Github repository here. Then include egg.js with a script tag:
Finally the
cheet
function will be available in the window, this script weights only 2.87KB. Visit the repository of the library for more information.Html Egg 7 80 9 15 Inch
2. Using cheet.js
Adding a cheat
Cheet allows you to add cheats easily with the cheet method, this map a sequence of keypresses to a callback. This can be called multiple times:
It can even use special characters:
Note that all the instructions are separated by a space instead of a comma (if your command expects the space key, then use the keyword
space
).Global cheat executed callback
Html Egg 7 80 9 154
You can set a global listener that is triggered when any of the cheats is executed:
Cheat that only fire once
You can disable a cheat once it's executed using the
cheet.disable
method that expects the same instruction as argument:With cheet.js you're able to use a lot of special keys, check the reference table here. e.g enable cheats once the special key F1 is pressed:
Have you ever played GTA San Andreas ? Then i'm sure that you will find an usage for those libraries.
Html Egg 7 80 9 159
Happy coding !