fix: normalize animation time
This commit is contained in:
parent
ad13299030
commit
68311bfa3b
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ function refresh(e) {
|
||||||
function removeChar() {
|
function removeChar() {
|
||||||
if (i++ < topicLength) {
|
if (i++ < topicLength) {
|
||||||
terminalPrompt.textContent = terminalPrompt.textContent.slice(0, -1);
|
terminalPrompt.textContent = terminalPrompt.textContent.slice(0, -1);
|
||||||
setTimeout(removeChar, 1000 / topicLength);
|
setTimeout(removeChar, 500 / topicLength);
|
||||||
} else {
|
} else {
|
||||||
i = 0;
|
i = 0;
|
||||||
clearing = false;
|
clearing = false;
|
||||||
|
|
@ -77,7 +77,7 @@ function typechars(e) {
|
||||||
function typechar() {
|
function typechar() {
|
||||||
if (i < terminalText.length) {
|
if (i < terminalText.length) {
|
||||||
terminalPrompt.innerHTML += terminalText.charAt(i++);
|
terminalPrompt.innerHTML += terminalText.charAt(i++);
|
||||||
setTimeout(typechar, 1000 / terminalText.length);
|
setTimeout(typechar, 500 / terminalText.length);
|
||||||
} else {
|
} else {
|
||||||
renderPosts(topic);
|
renderPosts(topic);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue