Loading...
.reveal {
opacity: 0;
animation: fade-in linear forwards;
animation-timeline: view();
}@keyframes fade-in {
from { opacity: 0; }
}
.reveal {
animation: fade-in linear both;
animation-timeline: view();
animation-range: entry;
}Opacity lives only in the keyframes, so content stays visible where view() isn't supported.
opacity: 0.animation-timeline: view() instead of IntersectionObserver and toggled classes.animation-range, like 'entry', limits the effect to when the element enters.@media (prefers-reduced-motion: reduce).For visual effects tied to scrolling, often yes. For logic like lazy loading or analytics, IntersectionObserver is still the right tool.
An optional axis, like 'block' or 'inline', and an optional inset that adjusts the visible area, like view(block 20%).