UNPKG

konami-code-js

Version:

Fire a JavaScript Event when you enter the « Up Up Bottom Bottom Left Right Left Right B A » Konami Code Sequence.

23 lines 819 B
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>With Input and Callback options</title> </head> <body> <h1>With Input and Callback options</h1> <p>For succeed this test, push « Up Up Down Down Left Right Left Right B A » and nothing append. <br> After focus the input below by clicking on and push « Up Up Down Down Left Right Left Right B A » on your keyboard and see the « Done » alert message.</p> <p><input type="text" placeholder="Push Keyboard Letter from here" style="width: 400px; height: 400px"></p> <script src="../src/konami-code.js"></script> <script> /* global KonamiCode */ new KonamiCode({ debug: true, callback: function () { alert("Done"); }, listener: document.getElementsByTagName("input")[0] }); </script> </body> </html>