portfolio-webpage/public/js/animate.js

12 lines
331 B
JavaScript
Raw Normal View History

2024-04-04 22:08:06 +02:00
function animate() {
const animateElements = document.querySelectorAll('.animate')
animateElements.forEach((element, index) => {
setTimeout(() => {
element.classList.add('show')
}, index * 150)
});
}
document.addEventListener("DOMContentLoaded", animate)
document.addEventListener("astro:after-swap", animate)