@@ -177,7 +177,12 @@ it animates fully to close or open position depending on its current position.
177177
178178<script >
179179await CSS .animationWorklet .addModule (' hidey-bar-animator.js' );
180- const scrollTimeline = new ScrollTimeline ($scrollingContainer, {timeRange: 100 });
180+
181+ const scrollTimeline = new ScrollTimeline ({
182+ scrollSource: $scrollingContainer,
183+ orientation: ' block' ,
184+ timeRange: 100
185+ });
181186const documentTimeline = document .timeline ;
182187
183188
@@ -249,8 +254,13 @@ const animation = new WorkletAnimation('twitter-header',
249254 {duration: 1000 , iterations: 1 }),
250255 new KeyframeEffect ($header, /* loses transparency as we scroll up */
251256 [{opacity: 0 }, {opacity: 0.8 }],
252- {duration: 1000 , iterations: 1 })] ,
253- new ScrollTimeline ($scrollingContainer, {timeRange: 1000 , startScrollOffset: 0 , endScrollOffset: $header .clientHeight }),
257+ {duration: 1000 , iterations: 1 })],
258+ new ScrollTimeline ({
259+ scrollSource: $scrollingContainer,
260+ timeRange: 1000 ,
261+ orientation: ' block' ,
262+ startScrollOffset: 0 ,
263+ endScrollOffset: $header .clientHeight }),
254264);
255265animation .play ();
256266< / script>
@@ -296,7 +306,11 @@ registerAnimator('twitter-header', class {
296306
297307< script>
298308await CSS .animationWorklet .addModule (' parallax-animator.js' );
299- const scrollTimeline = new ScrollTimeline ($scrollingContainer, {timeRange: 1000 });
309+ const scrollTimeline = new ScrollTimeline ({
310+ scrollSource: $scrollingContainer,
311+ orientation: ' block' ,
312+ timeRange: 1000
313+ });
300314const scrollRange = $scrollingContainer .scrollHeight - $scrollingContainer .clientHeight ;
301315
302316const slowParallax = new WorkletAnimation (
0 commit comments