滚动列表的 3D 入场效果
stroll.js,Hakim El Hattab,2012 年

正在布展…
它是怎么做的
- 第 1 步监听列表容器滚动,判断每个 li 是否处于视口之外的上方或下方
- 第 2 步给视口外的条目加上 past/future 类
- 第 3 步CSS 为每种效果定义 past/future 状态下的 3D 变换(rotateX、translateZ 等)
- 第 4 步条目进入视口时移除类名,由 transition 动画回到原位
复刻配方
一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。
Give each list item a CSS transition on transform and opacity and set perspective on the list. On scroll (throttled with requestAnimationFrame), compare each item's offset with the visible range and toggle a 'past' class for items above and a 'future' class for items below. Define per-effect CSS for those classes, for example rotateX(-90deg) with transform-origin at the top for a flip, or translateZ and rotateY for a helix. Items animate back to identity when they enter view.
档案
性能开销
视觉强度
实现难度
尺度为策展判断(1 到 5),用于比较和推荐。
核实记录:Opened http://lab.hakim.se/scroll-effects (200, title 'stroll.js - CSS3 Scroll Effects'); repo hakimel/stroll.js exists, licence MIT via GitHub API.


