typescript-konami-code

0.2.0 • Public • Published

KONAMI CODE

travis-img codecov-img github-issues-img contrib-welcome-img license-img

Everybody knows the konami code ↑ ↑ ↓ ↓ ← → ← → B A

Now you can add it to your projects.

// Import the konami class
import Konami from 'typescript-konami-code'

// Create a new instance and enable it
const k: Konami = new Konami()
k.enable()

// Add the event listener and callback
document.addEventListener(k.eventName, () => {

    // Successful konami kode will change the body background color
    document.body.style.backgroundColor = '#666'

    // Disable the event now; if you want
    k.disable()
})

Readme

Keywords

none

Package Sidebar

Install

npm i typescript-konami-code

Weekly Downloads

236

Version

0.2.0

License

BSD-3-Clause

Unpacked Size

20.3 kB

Total Files

18

Last publish

Collaborators

  • haukeschulz