added speedup

This commit is contained in:
2024-04-25 11:52:19 -07:00
parent 9e10f23157
commit f176e7d773
+14 -1
View File
@@ -73,10 +73,14 @@ function changeBK() {
document.body.style.backgroundColor = backgroundColor; document.body.style.backgroundColor = backgroundColor;
} }
let animIntId;
let animIntTime = 2000;
// Animate emotes every second // Animate emotes every second
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
emotes.push(document.querySelector('.NOCLONE')); emotes.push(document.querySelector('.NOCLONE'));
setInterval(animateEmotes, 2000); animIntId = setInterval(animateEmotes, animIntTime);
const konamiCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a', 'Enter']; const konamiCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a', 'Enter'];
let userInput = []; let userInput = [];
@@ -116,6 +120,15 @@ document.addEventListener('DOMContentLoaded', () => {
container.style.opacity = 0; container.style.opacity = 0;
}, 3000); }, 3000);
} }
else if (event.ctrlKey && event.key === 'a') {
event.preventDefault();
clearInterval(animIntId);
animIntTime = (animIntTime <= 500) ? 2000 : animIntTime - 500;
console.debug(animIntTime);
animIntId = setInterval(animateEmotes, animIntTime);
}
}); });
}); });