mirror of
https://github.com/ivabus/www
synced 2024-11-25 20:05:05 +03:00
Make hashes faster for hero animation
This commit is contained in:
parent
2e9809ab6d
commit
f468678846
1 changed files with 10 additions and 2 deletions
|
@ -50,11 +50,19 @@
|
|||
return;
|
||||
}
|
||||
|
||||
commandOutput += command.input[0];
|
||||
const currentChar = command.input[0];
|
||||
commandOutput += currentChar;
|
||||
command.input = command.input.slice(1);
|
||||
document.querySelector("#terminal-output").innerHTML = commandOutput;
|
||||
|
||||
// Check if the current character is within the .grid-gray span
|
||||
if (document.querySelector(".grid-gray").contains(document.createTextNode(currentChar))) {
|
||||
setTimeout(typeCommand, 0); // Reduce timeout delay for faster animation
|
||||
} else {
|
||||
setTimeout(typeCommand, 100);
|
||||
}
|
||||
|
||||
document.querySelector("#terminal-output").innerHTML = commandOutput;
|
||||
}
|
||||
|
||||
typeCommand();
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue