How it works
This scroll reveal animation makes a section rise, grow slightly and fade in the first time it scrolls into view. It gives long landing pages a sense of pacing, and it is the effect people usually reach for an animate-on-scroll library to get.
The element starts with opacity 0 and transform: translateY(Rise px) scale(Start scale). When it enters the viewport it gets an is-inview class, which applies the reveal keyframe once with fill-mode both, ending at full opacity, no offset and scale 1. In the CSS tab, the class comes from a ten-line IntersectionObserver script with a 0.2 threshold that unobserves the element after the first reveal, so it does not replay on scroll-up. The Tailwind version uses the same class with a group variant, and the React version uses Motion's whileInView.
Parameters: Width, Rise, Start scale, Duration and Easing. Rise of 24 to 48px and Start scale of 0.95 to 0.98 look polished; scale below 0.9 starts to feel like a zoom. Use one reveal per section rather than on every paragraph.
The starting state hides content until the script runs, so if JavaScript fails the section stays invisible. A safe pattern is to add a js class to the html element and scope the hidden state to it. Transform and opacity keep it smooth while scrolling.
Do I need an animate on scroll library for this?
No. The CSS output includes a small IntersectionObserver snippet that adds a class when the element is 20% visible; the animation itself is a normal CSS keyframe. That is all most AOS-style libraries do, without the extra kilobytes. In React, Motion's whileInView prop does the same with viewport options.
How do I reveal several elements with one script?
Change the snippet to observe a list: use document.querySelectorAll on a shared class and call observer.observe for each element. The callback already handles any element it receives. Add a small transition delay per item, or a CSS variable index, if you want them to cascade.
Can I do scroll reveal with pure CSS and no JavaScript?
Browsers that support scroll-driven animations can link a keyframe to the element's visibility with animation-timeline: view() and animation-range. Support is not yet universal, so wrap it in @supports and keep content visible by default. This preset uses the observer approach so it behaves the same in every current browser.