Subtle animations make a portfolio feel professional and modern. The key word is subtle.
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add("visible");
}
});
}, { threshold: 0.1 });
document.querySelectorAll(".animate").forEach(el => {
observer.observe(el);
});
.animate {
opacity: 0;
transform: translateY(30px);
transition: opacity .6s ease, transform .6s ease;
}
.animate.visible {
opacity: 1;
transform: translateY(0);
}
/* Each card appears slightly later than the previous */
.card:nth-child(1) { transition-delay: 0ms; }
.card:nth-child(2) { transition-delay: 100ms; }
.card:nth-child(3) { transition-delay: 200ms; }
opacity and transform. They use the GPUwidth, height, or top/left. They cause reflowwill-change: transform sparingly on animated elementsprefers-reduced-motion for accessibility