Remove unused animations

This commit is contained in:
Tressley Cahill
2022-10-30 21:27:13 -04:00
parent fb6f17aa12
commit 8b28d1f973
3 changed files with 7 additions and 86 deletions
-39
View File
@@ -5,42 +5,3 @@ function dateTime () {
document.getElementsByName('q')[0].placeholder = today + ' ' + time
setTimeout(dateTime, 1000)
}
var konamiCode = [
'ArrowUp',
'ArrowUp',
'ArrowDown',
'ArrowDown',
'ArrowLeft',
'ArrowRight',
'ArrowLeft',
'ArrowRight',
'b',
'a'
]
var currentKey = 0
var keyHandler = function (event) {
// If the key isn't in the pattern, or isn't the current key in the pattern, reset
if (
konamiCode.indexOf(event.key) < 0 ||
event.key !== konamiCode[currentKey]
) {
currentKey = 0
return
}
// Update how much of the pattern is complete
currentKey++
// If complete, add animation class and reset
if (konamiCode.length === currentKey) {
currentKey = 0
document.getElementById('traichu-running').classList.add('slide')
setTimeout(function () {
document.getElementById('traichu-running').classList.remove('slide')
}, 4250)
}
}
// Listen for keydown events
document.addEventListener('keydown', keyHandler, false)