Hooks up konami-code-js to trigger emoji-blast. π
β¬ β¬ β¬ β¬ β¬ β‘ β¬ β‘ π ± π °
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!
Plop this π at the end of your <body>
:
<script async src="https://unpkg.com/konamimojisplosion/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/emoji-blast/dist/global.js"></script>
<script>
initializeKonamiEmojiBlast();
</script>
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. β¨
konami-emoji-blast
can also be used via integrations for popular frontend frameworks.
See:
@konami-emoji-blast/react
- More to come ... soon!
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
.