Watch elements animate into view as you scroll
Elements slide up as they fade in
Elements slide down as they appear
Sliding in from the right
Sliding in from the left
Growing from smaller size
Shrinking from larger size
Rotating while scaling
3D horizontal flip effect
3D vertical flip effect
From blurred to sharp
// Intersection Observer for Reveal Animations
const revealElements = document.querySelectorAll('.reveal-element');
const revealObserver = new IntersectionObserver(
(entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('revealed');
// Stagger children if present
const children = entry.target.querySelectorAll('.stagger-item, .word');
children.forEach((child, index) => {
setTimeout(() => {
child.style.transitionDelay = `${index * 100}ms`;
}, 0);
});
// Optional: Stop observing after reveal
observer.unobserve(entry.target);
}
});
},
{
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
}
);
// Start observing all elements
revealElements.forEach(element => {
revealObserver.observe(element);
});