mirror of
https://github.com/ivabus/www
synced 2024-11-22 14:05:07 +03:00
Really fast #'s
This commit is contained in:
parent
5b5245e3d1
commit
f227de56d6
1 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue