mirror of
https://github.com/RetroDECK/RetroDECK-Website.git
synced 2025-04-10 19:15:13 +00:00
30 lines
654 B
JavaScript
30 lines
654 B
JavaScript
const konamiCode = [
|
|
'ArrowUp',
|
|
'ArrowUp',
|
|
'ArrowDown',
|
|
'ArrowDown',
|
|
'ArrowLeft',
|
|
'ArrowRight',
|
|
'ArrowLeft',
|
|
'ArrowRight',
|
|
'b',
|
|
'a'
|
|
];
|
|
|
|
let konamiCodePosition = 0;
|
|
|
|
window.addEventListener('keyup', function(e) {
|
|
const key = e.key;
|
|
const requiredKey = konamiCode[konamiCodePosition];
|
|
|
|
if (key === requiredKey) {
|
|
konamiCodePosition++;
|
|
if (konamiCodePosition === konamiCode.length) {
|
|
console.log('Konami Code Activated!');
|
|
konamiCodePosition = 0;
|
|
window.location.replace('emulator.html');
|
|
}
|
|
} else {
|
|
konamiCodePosition = 0;
|
|
}
|
|
}); |