This commit is contained in:
2025-02-25 20:59:11 +08:00
parent 46d9f195b1
commit 0263d8a436
8 changed files with 99 additions and 40 deletions

View File

@@ -3,7 +3,7 @@
<div class="mx-auto max-w-7xl px-6 lg:flex lg:items-center lg:gap-x-15 lg:px-8 py-12">
<div class="mx-auto max-w-2xl lg:mx-0 lg:flex-auto">
<!-- Typing Text -->
<h1 id="typing-text2" class="mt-10 font-normal tracking-tight text-black lg:text-[6rem] text-[2.5rem]"></h1>
<h1 class="fade-in mt-10 font-normal tracking-tight text-black lg:text-[6rem] text-[2.5rem]">What's Inside AIBox</h1>
<!-- Specification List -->
<dl class="mt-10 px-10 max-w-xl lg:space-y-6 space-y-3 text-gray-900 lg:max-w-xl">
@@ -38,6 +38,8 @@
opacity: 1;
transform: translateY(0);
}
</style>
<!-- Script -->
@@ -47,24 +49,12 @@
const text = "What's Inside AIBox";
const textElement = document.getElementById("typing-text2");
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);
} else {
setTimeout(callback, 1000);
}
}
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);
setTimeout(() => typeText(i + 1), 100);
}
}
@@ -92,11 +82,7 @@
index++;
setTimeout(showNextItem, 1000);
} else {
setTimeout(() => {
items.forEach(item => item.classList.remove("show"));
index = 0;
setTimeout(showNextItem, 1000);
}, 5000);
image.classList.add("show");
}
}