web/static/scripts/ccd.js
Adrian Victor 6b8635defe
All checks were successful
Build Eleventy Forgero / build (24.x) (push) Successful in 37s
Use eleventy's url function to apply pathPrefix.
2026-05-14 14:59:13 -03:00

14 lines
No EOL
463 B
JavaScript

const konamiCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'KeyB', 'KeyA'];
let keyIndex = 0;
document.addEventListener('keydown', function(event) {
if (event.code === konamiCode[keyIndex]) {
keyIndex++;
if (keyIndex === konamiCode.length) {
window.location.href = `${rootPrefix}static/toyourdreams.txt`
keyIndex = 0;
}
} else {
keyIndex = 0;
}
});