It converts a position in a scroll range into a percentage of progress. View Progress Timeline: a timeline that is linked to the relative position of a particular element within its scroll container.Ī Scroll Progress Timeline is an animation timeline that is linked to progress in the scroll position of a scroll container–also called scrollport or scroller–along a particular axis.
Scroll Progress Timeline: a timeline that is linked to the scroll position of a scroll container along a particular axis.The Scroll-driven Animations Specification defines two new types of timelines that you can use: This is the default animation timeline and, until now, was the only animation timeline you had access to. Its origin time starts at 0 when the page loads, and starts ticking forwards as clock time progresses. # Animation timelinesīy default, an animation attached to an element runs on the document timeline. This visual result of the JavaScript snippet above is identical to the previous CSS version. You can do this by either creating new Animation and KeyFrameEffect instances, or use the much shorter Element animate() method. In JavaScript, the Web Animations API can be used to achieve exactly the same. To learn more about CSS Animations, visit Learn CSS Animations Yes, read that correctly: you can now have silky smooth animations, driven by scroll, running off the main thread, with just a few lines of extra code. That includes the ability to have these animations run off the main thread.
Integrating scroll-driven animations with two existing APIs, means that they benefit from the advantages of these APIs. This makes creating performant scroll-driven animations that are in-sync with scrolling impossible or very difficult.Ĭoming to Chrome is a new set of APIs and concepts that work in conjunction with the existing Web Animations API (WAAPI) and CSS Animations API to enable declarative scroll-driven animations.