layout |
---|
default |
function typeWriter() { if (i < txt.length) { document.getElementById("demo").innerHTML += txt.charAt(i); i++; if(i == 1) { speed = 55; } setTimeout(typeWriter, speed); } }
this.typeWriter(); </script>
<script> const fadeIns = document.querySelectorAll('.fade-in'); const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.intersectionRatio > 0) { setTimeout(() => { entry.target.style.opacity = '1'; }, 1500); // set a 1 second delay before fading in observer.unobserve(entry.target); // stop observing the element after it fades in } }); }); fadeIns.forEach(fadeIn => { observer.observe(fadeIn); }); </script>