const texts = [ "Linux enthusiast", "I love Nintendo", "Open Source everything", "Lord of The Rings is the best trilogy ever made", "Plain HTML,CSS and JS are my favorite Web Dev tools", ]; const facts = document.getElementById("Facts"); let index = 0; function showText() { facts.textContent = texts[index]; facts.style.opacity = 1; setTimeout(() => { facts.style.opacity = 0; }, 3500); index = (index + 1) % texts.length; } showText(); setInterval(showText, 4000);