Really fast #'s

This commit is contained in:
Thomas Smith 2023-02-28 13:57:31 -05:00
parent 5b5245e3d1
commit f227de56d6

View file

@ -57,12 +57,13 @@
commandOutput += currentChar; commandOutput += currentChar;
command.input = command.input.slice(1); command.input = command.input.slice(1);
// Check if the current character is within the .grid-gray span // Check if the current character is a '#' character
if (document.querySelector(".grid-gray").contains(document.createTextNode(currentChar))) { if (currentChar === '#') {
setTimeout(typeCommand, 50); // Reduce timeout delay for '#' character for faster animation // Animate the '#' character really fast
setTimeout(typeCommand, 10);
} else { } else {
// Add a random delay between 40ms and 80ms (except for '#' characters) // Add a random delay between 40ms and 80ms (except for '#' characters)
const delay = Math.floor(Math.random() * 40) + 80; const delay = Math.floor(Math.random() * 40) + 40;
setTimeout(typeCommand, delay); setTimeout(typeCommand, delay);
} }