Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Cheet.js: Easter eggs (Konami Code, etc.) for your site (namuol.github.io)
64 points by namuol on Nov 25, 2013 | hide | past | favorite | 13 comments


Looks nice, but not sure why I'd use this over the more general-purpose Mousetrap[1]?

[1]: http://craig.is/killing/mice


Welp. I wouldn't have made cheet.js if I knew about Mousetrap.

Oh well, it was just a fun one-night project anyway. :)


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


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


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"


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


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...


Makes me remember the good old raptorize plugin: http://zurb.com/playground/jquery-raptorize


Any hints on easter eggs on the site that you don't provide instructions for? I tried your name, the project name, etc.; disappointed there wasn't more to discover.


I figured people on HN weren't afraid to "View Source" ;)


Doesn't this defeat the purpose of an "easter egg"?


This looks really cool and sleek! I may just use this somewhere.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: