mirror of
https://github.com/jlelse/GoBlog
synced 2024-06-16 13:05:00 +00:00
14 lines
483 B
JavaScript
14 lines
483 B
JavaScript
|
(function () {
|
||
|
let input = '', key = 'ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba'
|
||
|
document.addEventListener('keyup', function (e) {
|
||
|
input += e.key
|
||
|
if (input == key) {
|
||
|
input = ''
|
||
|
document.documentElement.classList.add('egg-anim')
|
||
|
document.documentElement.classList.toggle('turn-around')
|
||
|
}
|
||
|
if (input != '' && !key.startsWith(input)) {
|
||
|
input = ''
|
||
|
}
|
||
|
})
|
||
|
})()
|