1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 02:19:34 +05:30

(refactor): improved homepage hello text in out animation

This commit is contained in:
2023-12-12 23:32:19 +05:30
parent 6d036e4d47
commit 5b35745bb2
2 changed files with 43 additions and 6 deletions

View File

@@ -2,20 +2,22 @@
function animate_hello() {
const texts = ["Namaste! 🙏", "Hello! 👋", "Konnichiwa! 😄", "Anyeonghaseyo! 😊", "Hola! 😃", "Bonjour! 😄", "Zdravstvuyte! 🙂", "Marhabaan! 😊", "Olá! 😃", "Salve! 🤠"];
const textContainer = document.getElementById("helloContainer");
let currentIndex = 0;
function animateText() {
textContainer.textContent = texts[currentIndex];
textContainer.innerHTML = texts[currentIndex].split(' ').map(word => `<span class="slideUpFade">${word}</span>`).join(' ');
currentIndex = (currentIndex + 1) % texts.length;
setTimeout(() => {
animateText();
}, 3000);
}, 4000);
}
animateText();
}
if(document.getElementById("helloContainer")) {
if (document.getElementById("helloContainer")) {
animate_hello();
}