Skip to content

Latest commit

 

History

History
83 lines (56 loc) · 3 KB

File metadata and controls

83 lines (56 loc) · 3 KB

konami-emoji-blast

Hooks up konami-code-js to trigger emoji-blast. 🎆

🤝 Code of Conduct: Kept 📝 License: MIT 📦 npm version 💪 TypeScript: Strict

⬆ ⬆ ⬇ ⬇ ⬅ ➡ ⬅ ➡ 🅱 🅰

What?

If a user types in the Konami Code on their keyboard or taps it on their mobile phone, emoji blasts will start firing on the page. Triggering the Konami Code again will stop the emoji blasts.

Check it out on Codecademy Docs!

Usage

Direct HTML Quick Start

Plop this 👇 at the end of your <body>:

<script async src="https://unpkg.com/konami-emoji-blast/dist/now.js"></script>

That ☝ loads konami-emoji-blast soon after your page loads to set up the Konami Code with no configuration.

👌.

You might want a little more fine-grained control over when the connection is created. To create a global initializeKonamiEmojiBlast function:

<script src="https://unpkg.com/konami-emoji-blast/dist/global.js"></script>
<script>
	initializeKonamiEmojiBlast();
</script>

Direct Node.js Usage

First install the konami-emoji-blast package as a dependency:

npm i konami-emoji-blast

You can then import it in your code to access its initializeKonamiEmojiBlast function:

import { initializeKonamiEmojiBlast } from "konami-emoji-blast";

initializeKonamiEmojiBlast();

If you're using ESM or any modern JavaScript bundler or framework, such as ESBuild, Vite, or Webpack, this should just work. ✨

Frameworks

konami-emoji-blast can also be used via integrations for popular frontend frameworks. See:

Development

konami-emoji-blast is managed as part of the emoji-blast monorepo. See the monorepo's development docs first, then ./.github/DEVELOPMENT.md.

💙 This package was templated with create-typescript-app.