Scroll-Driven Animations The article introduces the CSS Animation Timeline API, which allows developers to create scroll-driven animations natively without JavaScript by mapping keyframe animations to an element's viewport progress instead of a time duration. It explains that by using `animation-timeline: view()`, animations scrub through keyframes based on scroll position, and it covers customization options like timing functions and spring-based easings. The post also notes that this API builds on existing CSS primitives, making it accessible to those familiar with CSS keyframe animations. Introduction One of the best ways to add a bit of personality to our websites is to animate things on scroll. For example, I recently created the following scroll-driven animation on the Whimsical Animations opens in new tab https://whimsy.joshwcomeau.com/ homepage: Historically, we’ve needed to use JavaScript for this kind of effect, but an exciting new API, Animation Timeline , makes it possible to do this sort of thing in native CSS ✨ I’ve been experimenting with this new API for a few months, and honestly, it’s so good. It’s built on top of existing CSS primitives in a really elegant and natural way. In fact, if you’re familiar with CSS keyframe animations, you already know most of what you need to know In this blog post, I’ll show you exactly how this new API works, and we’ll explore some of the more advanced things we can do with it. I’ll also share some of the gotchas to watch out for. Link to this heading the-core-concept-1 The core concept In CSS, we can use keyframe animations to interpolate smoothly between two chunks of CSS. For example, suppose we have the following keyframe animation: @keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } } We can use this keyframe animation to fade an element in over a certain duration: .elem { animation: fadeIn 1000ms; } Here’s the core concept with the Animation Timeline API: what if we map a keyframe over a scroll distance rather than a duration? Check this out: Code Playground