From c20017171f2513b210b248c463ae9af716120d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 5 Oct 2019 19:45:44 +0200 Subject: [PATCH] fix for starting with more than 2 up arrows --- konami.js | 4 +++- konami.min.js | 6 ------ 2 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 konami.min.js diff --git a/konami.js b/konami.js index 162591a..01af2e3 100644 --- a/konami.js +++ b/konami.js @@ -24,7 +24,9 @@ Usage: konami(callback); progress = 0; } } else { - progress = 0; + if (!(e.keyCode == 38 && progress <= 2)) { + progress = 0; + } } }; diff --git a/konami.min.js b/konami.min.js deleted file mode 100644 index 13e0ccd..0000000 --- a/konami.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! konami.js -https://github.com/MightyPork/konami.js -(c) MightyPork 2015, MIT License -Usage: konami(callback); -*/ -!function(n){"use strict";var e=n.document,o=[38,38,40,40,37,39,37,39,66,65],t=0;n.konami=function(n){var i=function(e){e.keyCode==o[t]?++t==o.length&&(console.log("コナミ"),"function"==typeof n&&n(),t=0):t=0};e.addEventListener?e.addEventListener("keyup",i):e.onkeyup=i}}(window);