Cheet.js: Easter eggs (Konami Code, etc.) for your site(namuol.github.io)
namuol.github.io
Cheet.js: Easter eggs (Konami Code, etc.) for your site
http://namuol.github.io/cheet.js/
10 comments
In use on his personal site: http://namuol.github.io/
Konami: up up down down left right left right b a
God-mode: i d d q d
google: g o o g l e
Konami: up up down down left right left right b a
God-mode: i d d q d
google: g o o g l e
I would've called it cheat.js but there was at least one other library out there with the name.
Also, it's a surprisingly-SFW Urban Dictionary term that I find amusing: http://www.urbandictionary.com/define.php?term=Cheet
Also, it's a surprisingly-SFW Urban Dictionary term that I find amusing: http://www.urbandictionary.com/define.php?term=Cheet
I like the concept of implementing the "waiting" function of responding to a cheat code as an asynchronous promise-style callback. I think this should be used more often in event-driven stuff, even when it's not explicitly "asynchronous" as much as it is a conditions-based response.
Nice! Another idea would be to use events in stead of keys in the sequence, something like:
"click:#elem1 click:#elem2 keyup:13"
That would enable you to make slightly more advanced easter eggs or "cheets"
"click:#elem1 click:#elem2 keyup:13"
That would enable you to make slightly more advanced easter eggs or "cheets"
I went ahead and made this[1]. The implementation is a little different from the way you do it, and it uses jQuery to create the events, but it supports sequences of click events using jQuery selectors like in my original comment, other events could be added without much effort.
The implementation is not at all as neat as the original, and i haven't done thorough testing, i just had an idea and tried it out.
[1] https://github.com/jonlt/cheet.js
The implementation is not at all as neat as the original, and i haven't done thorough testing, i just had an idea and tried it out.
[1] https://github.com/jonlt/cheet.js
Good idea; I'd incorporate your changes but I'm trying to keep it dependency-free, for now.
I could support '#id' without any dependencies pretty easily, though...
I could support '#id' without any dependencies pretty easily, though...
Makes me remember the good old raptorize plugin: http://zurb.com/playground/jquery-raptorize
Doesn't this defeat the purpose of an "easter egg"?
This looks really cool and sleek! I may just use this somewhere.
[deleted]
[1]: http://craig.is/killing/mice