konamimojisplosion
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

Konamimojisplosion

Code Style: Prettier TypeScript: Strict NPM version

🅱 🅰

🎉 🎆

Hooks konami-code-js to trigger emojisplosion.

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

Check it out on Codecademy Docs!

Usage

Quick Mode

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

<script async src="https://unpkg.com/konamimojisplosion/dist/global.js"></script>

Alternately, you can import and use this as a standalone function, a React hook, or a React class component.

Standalone Function

import { initializeKonamimojisplosion } from "konamimojisplosion";

initializeKonamimojisplosion();

React Hook

import { useKonamimojisplosion } from "konamimojisplosion";

function MyComponent() {
  useKonamimojisplosion();

  return <main>Hello, world!</main>;
}

React Class Component

Tip: the class component just calls the hook internally.

import { Konamimojisplosion } from "konamimojisplosion";

class MyComponent {
  render() {
    return (
      <main>
        <Konamimojisplosion />
        Hello, world!
      </main>
    );
  }
}

Development

Requires:

After forking the repo from GitHub:

git clone https://github.com/<your-name-here>/konamimojisplosion
cd konamimojisplosion
yarn

Contribution Guidelines

We'd love to have you contribute! Check the issue tracker for issues labeled accepting prs to find bug fixes and feature requests the community can work on. If this is your first time working with this code, the good first issue label indicates good introductory issues.

Please note that this project is released with a Contributor Covenant. By participating in this project you agree to abide by its terms. See CODE_OF_CONDUCT.md.

Package Sidebar

Install

npm i konamimojisplosion

Weekly Downloads

388

Version

0.5.2

License

MIT

Unpacked Size

28.8 kB

Total Files

32

Last publish

Collaborators

  • joshuakgoldberg
  • codecademy