Description
One of the things that did not make it into the scroll-animations rewrite is the ability to animate as a scroller scrolls for a fixed distance. This used to be covered by the scroll-offsets.
There are some use-cases, such as this cover page that transforms to a header bar as you scroll over a distance of 90vh
.
One could use use a ViewTimeline
here, but not on the cover/header element itself because it is sticky and therefore never exit
s. Instead, one would have to look at the succeeding element.
This, however, is only possible if all of these apply:
- There is a succeeding element
- That succeeding element is not in view at the start of the animations, so you can watch it
enter
- The ViewTimeline can be seen by the preceding header
The first 2 conditions might not always be the case, but the author could work around that if they rearrange some things in their markup. The 3rd condition is not possible, since we decided in #7047 to have “timeline search look at preceding siblings and ancestors”.
Therefore I think we should reintroduce the Scroll Offsets.