跳到正文
UIGrammer
EN 中文

动画 · 滚动触发 · 11

滚动揭示

滚动揭示 = 内容随滚动位置按比例显现,用原生 CSS animation-timeline 实现,无需 JavaScript。

直达修改 Prompt

Revealed on scroll

尊重 prefers-reduced-motion:动画关闭,仅保留终态。

滚动揭示是什么?

滚动揭示把动效绑在滚动位置:面板滑过视口时淡入上移。现代做法是原生 CSS 滚动驱动动画(animation-timeline: view()),跑在合成层、零 JS。揭示区间要短,让效果落在元素附近而非整页。

动画 标本

触发
scroll
技术
scroll-driven
时长
2.6s
缓动
cubic-bezier(0.16, 1, 0.3, 1)
性能
transform, opacity

什么时候用

  • Long-form sections, feature blocks, story pages
  • Any scroll-linked reveal where JS would be overkill

什么时候别用

  • Above the fold — scroll-linked motion there never triggers
  • When you need scrubbed precision JS gives but CSS lacks

Native scroll-driven animation needs no scroll listener and stays on the compositor — but add an @supports fallback for older browsers.

Reveal a panel on scroll with native CSS: animation-timeline: view(), fade + translateY tied to scroll position, transform and opacity only.