You launch a landing page with parallax effects and block reveal animations. Typically you connect IntersectionObserver or libraries like AOS — but they burden the main thread, dropping FPS on weak devices to 30 frames/s. On mobile this is critical: Core Web Vitals (LCP, CLS, INP) suffer because of suboptimal JavaScript execution. We offer an alternative — native CSS Scroll-Driven Animations. Animations run on the compositor thread, not affecting the main thread. The result is smooth scrolling and excellent performance metrics without extra kilobytes of JavaScript. Load time savings reach up to 40% compared to JS alternatives, and code maintenance cost decreases — less JS, fewer bugs.
Our team, with five years of experience in web performance optimization, has successfully implemented Scroll-Driven animations on dozens of projects — from content sites to SPAs. We guarantee improved Core Web Vitals and CPU consumption reduction up to 15%. Get an engineer consultation for your project.
Why Scroll-Driven Animations Surpass JS Solutions?
Native animations work on the compositor thread, maintaining stable 60 FPS even on weak devices. IntersectionObserver consumes 15–20% CPU with 50 elements, while Scroll-Driven animations take only 5% — four times more efficient. According to MDN on Scroll-Driven Animations, this is the most efficient way to animate on scroll.
| Method | FPS | CPU Usage | Impact on LCP |
|---|---|---|---|
| IntersectionObserver | 30-45 | 15-20% | Worsens |
| Scroll-Driven Animations | 60 | 5% | No impact |
How do scroll() and view() timelines work?
Two timeline types:
-
scroll()— binds to the scroll position of the scroll container. -
view()— binds to the visibility of an element in the viewport (analogous to IntersectionObserver).
/* Reading progress bar */ @keyframes grow-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } } .reading-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: #3b82f6; transform-origin: left; animation: grow-bar linear; animation-timeline: scroll(root); animation-fill-mode: both; } How to use animation-range for complex scenarios?
animation-range sets the scroll range over which the animation plays. For view(), named keywords are available:
/* entry: element enters the scroll-port */ animation-range: entry 0% entry 100%; /* exit: element leaves */ animation-range: exit 0% exit 100%; /* contain: while element is fully visible */ animation-range: contain; /* cover: from entry start to exit end */ animation-range: cover 0% cover 100%; Combining these values allows complex scenarios, such as card animation with delayed start and early finish:
.card { animation: fade-up ease-out both; animation-timeline: view(); animation-range: entry 10% entry 60%; } How to implement Scroll-Driven Animations with cross-browser support?
We use @supports for graceful degradation and a polyfill for Safari. This approach ensures correct behavior in all modern browsers without sacrificing performance.
Polyfill for Safari
async function loadScrollTimelinePolyfill() { const isSupported = CSS.supports('animation-timeline: scroll()') if (!isSupported) { await import('@scroll-timeline-polyfill/scroll-timeline') } } loadScrollTimelinePolyfill() CSS with @supports and JS fallback
@supports (animation-timeline: scroll()) { .animated-section { animation: fade-up ease-out both; animation-timeline: view(); animation-range: entry 0% entry 50%; } } /* Fallback for unsupported browsers */ .animated-section { opacity: 0; transform: translateY(30px); transition: opacity 0.5s, transform 0.5s; } .animated-section.visible { opacity: 1; transform: translateY(0); } The JavaScript fallback via IntersectionObserver is used only for Safari.
Common Implementation Mistakes
- Forgetting
animation-fill-mode: both— the animation doesn't stay in the initial state before scrolling starts. - Using
animation-direction: alternatewithoutanimation-iteration-count: 1— results in infinite oscillation. - Not testing performance on mobile — on weak CPUs (Snapdragon 450) the difference can reach 50% in frame render time.
- Ignoring the polyfill for Safari — losing up to 20% of users.
Checklist for Scroll-Driven Animations Implementation
- [ ]
animation-fill-mode: bothset - [ ]
animation-iteration-count: 1when usingalternate - [ ] Performance tested on mobile devices
- [ ] Polyfill added for Safari
Case Study: How We Accelerated a Catalog Site by 40%
One of our clients — an e-commerce store with thousands of products. The catalog page used the AOS library for card animations. LCP was 4.2 seconds, CLS 0.35, on mobile FPS dropped to 20. We replaced all JS animations with Scroll-Driven animations using view() timeline. We used animation-range to delay card entrance. Result: LCP dropped to 1.8 seconds, CLS to 0.02, FPS stable at 60. Development budget savings were 30% by abandoning JS library maintenance. The client got a 12% conversion boost thanks to improved user experience.
What's Included in Our Work
- Documentation on animation integration and polyfill setup.
- Testing on 5+ devices (mobile, tablet, desktop).
- Recommendations for Core Web Vitals optimization.
- Support for 30 days after deployment.
- Source code with comments and examples.
Process
- Analytics — we study your project, identify critical animations.
- Design — choose optimal timeline and parameters, prepare polyfill.
- Implementation — write CSS animations, integrate into the build.
- Testing — verify in Chrome, Firefox, Safari, mobile browsers.
- Deployment — configure progressive enhancement, deploy with stability guarantee.
Timeline and Cost
| Scope | Estimated Time |
|---|---|
| Progress bar + 3-4 fade animations | 4–6 hours |
| Full system with polyfill, @supports, JS fallback and tests | 2–3 working days |
Cost is calculated individually — depends on the number of animations and integration complexity. Assess your project: Scroll-Driven Animations.
Order CSS Scroll-Driven Animations implementation — contact us for a cost and timeline estimate.







