Bug fixes

This commit is contained in:
jheaps
2025-10-17 11:41:50 -06:00
parent 69e1e8450d
commit 93bdb3518a
5 changed files with 68 additions and 39 deletions
+9 -8
View File
@@ -12,18 +12,19 @@
let intervalId;
let index = 0;
const punctuation = ['.', '!', '?'];
const punctuationDict = {
'.': 150,
'!': 200,
'?': 200,
',': 100,
'`': 25,
};
let currentText = "";
function changeIntervalTime(element, text) {
if (punctuation.includes(text.charAt(index))) {
clearInterval(intervalId);
simulateTyping(element, text, 200);
}
else {
clearInterval(intervalId);
simulateTyping(element, text);
}
clearInterval(intervalId);
simulateTyping(element, text, punctuationDict[text.charAt(index)] ?? 50);
}
function simulateTyping(element, text, speed = 50) {