滚动相关 · 滚到哪、变到哪
滚动推播放头Scroll-scrubbed playback
- 滚动条变进度条
- 能倒着放
- 停住就定格
一段原本自己播的动画,现在不自己播了:往下滚它就往前走,往回滚它就倒着放,停住它就定在那一帧。滚动条变成了这段片子的进度条。
什么时候用它
产品拆解、装配过程、教程这类「用户想自己控制看哪一步」的内容用它;时间敏感的内容(开场、情绪段落)别用 —— 用户可能永远滚不到结尾。
参数
progress 0 → 1 mapped onto the timeline playhead · 1:1 with scroll, no easing · reverse on scroll up · hold when still
配方
滚动推播放头 → progress 0 → 1 mapped onto the timeline playhead · 1:1 with scroll, no easing · reverse on scroll up · hold when still
给 AI 的一句话
把这段动画的播放头交给滚动:把滚动进度 0→1 映射成这条时间线的播放位置,每帧写进去(视频用 currentTime,矢量动画用 goToAndStop,canvas 就重绘那一帧),1:1 跟手、不要加缓动,往回滚要能倒放、停住要定格。