跳到正文
网页珍奇柜Web Curio

纯 CSS 滚动驱动动画集

Scroll-driven Animations,Bramus Van Damme,2023 年

正在布展…

本柜的现场复刻:按原作的技术思路从零编写,不含原作的代码和素材。原作请点上方「去看原作」。

它是怎么做的

  1. 第 1 步animation-timeline: scroll() 把动画进度绑定到容器滚动位置。
  2. 第 2 步animation-timeline: view() 绑定到元素在视口中的可见进度。
  3. 第 3 步animation-range 指定 entry/exit/cover 等区间。
  4. 第 4 步不支持的浏览器用 flackr/scroll-timeline polyfill 降级。

复刻配方

一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。

Write ordinary @keyframes for the effect you want (scale, rotateY, clip-path reveal). Attach them with animation-timeline: view() on each item and set animation-range such as 'entry 0% cover 50%' so the motion maps to the item's passage through the viewport. For a header, use animation-timeline: scroll(root) with a fixed range in pixels. Gate everything behind @supports (animation-timeline: view()) and prefers-reduced-motion, leaving a static layout as fallback.

档案

技术

交互

能不能拿来用

原作不是开源许可(proprietary — inspiration only):只能作为视觉参考,不要复制它的代码或素材,自己按技术思路实现。

性能开销

视觉强度

实现难度

尺度为策展判断(1 到 5),用于比较和推荐。

核实记录:Site loads (HTTP 200, title 'Scroll-driven Animations'); page links to the flackr/scroll-timeline polyfill (Apache-2.0) and a debugger extension. No repo for the demo site itself found.