Reveal on scroll with view()
Elements fade in as they enter the screen.
CSS · Reveal on scroll with view()Advanced
.reveal {
animation: reveal linear both;
animation-timeline: view();
animation-range: entry 0% cover 30%;
}
@keyframes reveal {
from { opacity: 0; transform: translateY(40px); }
to { opacity: 1; transform: none; }
}
@supports not (animation-timeline: view()) {
.reveal { animation: none; opacity: 1; }
}animation-timelineviewrevealscroll-driven