Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I also want to do one #9

Open
fEyebrow opened this issue Sep 14, 2017 · 2 comments
Open

I also want to do one #9

fEyebrow opened this issue Sep 14, 2017 · 2 comments
Labels

Comments

@fEyebrow
Copy link

How these effects are achieved

Just use js ?

@WeiChiaChang
Copy link
Owner

WeiChiaChang commented Sep 14, 2017

Hello @FourEyebrowXiake, thank you for your interest in easter-egg-collection. All of the easter eggs trigger by typing related keywords, and the GIF image will generate dynamically through new Image(). Just take Ghost this easter egg for example, and the following code is the keypoint :

var record = function(e) {
    if ( e.which === key[ck] ) {
      ck++;
    } else {
      ck = 0;
    }
    if ( ck >= max ) {
      ghost();
      ck = 0;
    }
  };

When the typing words by user match to the keyword (''ghost"), the ghost() function will be triggered.

Last but not least, you can even build your own library with vanilla JavaScript code in the same way. 😄

Btw, easter-eggs-mobile also a collection which includes lots of easter eggs but much more focus on mobile device.

@fEyebrow
Copy link
Author

Now know vanilla-js is javascript 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants