@@ -177,7 +177,12 @@ it animates fully to close or open position depending on its current position.
177
177
178
178
<script >
179
179
await 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
+ });
181
186
const documentTimeline = document .timeline ;
182
187
183
188
@@ -249,8 +254,13 @@ const animation = new WorkletAnimation('twitter-header',
249
254
{duration: 1000 , iterations: 1 }),
250
255
new KeyframeEffect ($header, /* loses transparency as we scroll up */
251
256
[{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 }),
254
264
);
255
265
animation .play ();
256
266
< / script>
@@ -296,7 +306,11 @@ registerAnimator('twitter-header', class {
296
306
297
307
< script>
298
308
await 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
+ });
300
314
const scrollRange = $scrollingContainer .scrollHeight - $scrollingContainer .clientHeight ;
301
315
302
316
const slowParallax = new WorkletAnimation (
0 commit comments