edit fx
This commit is contained in:
@@ -85,26 +85,19 @@
|
||||
const text = "Take Control of Your AI Future";
|
||||
const textElement = document.getElementById("typing-text");
|
||||
let loopCount = 0;
|
||||
const maxLoops = 5;
|
||||
const maxLoops = 1;
|
||||
|
||||
function typeText(i, callback) {
|
||||
if (i < text.length) {
|
||||
textElement.textContent += text.charAt(i);
|
||||
setTimeout(() => typeText(i + 1, callback), 100);
|
||||
setTimeout(() => typeText(i + 1), 100);
|
||||
} else {
|
||||
setTimeout(callback, 1000);
|
||||
setTimeout(callback, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteText(callback) {
|
||||
let currentText = textElement.textContent;
|
||||
if (currentText.length > 0) {
|
||||
textElement.textContent = currentText.substring(0, currentText.length - 1);
|
||||
setTimeout(() => deleteText(callback), 50);
|
||||
} else {
|
||||
setTimeout(callback, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loopTyping() {
|
||||
if (loopCount < maxLoops) {
|
||||
|
Reference in New Issue
Block a user