ai21.net
语言

纯代码UI动效设计短片

演示视频

纯代码UI动效设计短片 — 1纯代码UI动效设计短片 — 2纯代码UI动效设计短片 — 3纯代码UI动效设计短片 — 4纯代码UI动效设计短片 — 5纯代码UI动效设计短片 — 6纯代码UI动效设计短片 — 7纯代码UI动效设计短片 — 8纯代码UI动效设计短片 — 9纯代码UI动效设计短片 — 10

提示词

<inputs>
Ask me for: 8 to 12 UI states I want the shape to become (e.g. button, loader, player, slider, toggle, tabs, chart, command palette, toast), pure black and white or one accent color, and a royalty-free song around 120 BPM (e.g. Mixkit, free for commercial use).
</inputs>

<direction>
Dribbble-level UI motion. One shape, never cut: every state is the same element morphing its size, radius and color while its content swaps with a short blur. A cursor drives every change with real clicks and drags. Light warm-gray canvas, black and white components, one clean UI font (Geist). Springs everywhere, a tiny overshoot at most. The camera zooms so each state fills the frame. The last frame is the first frame, so it loops.
Banned: bouncy easing, particle bursts, glows, gradients on UI chrome, mismatched icon strokes, dead time, anything that looks like a template.
</direction>

<structure>
120 BPM, 7 bars, something happens on every beat.
Button → loader → check → dynamic island → music player with a play/pause morph → scrub the progress bar → it becomes a volume slider that stretches when dragged past max → a toggle flips on the beat → the knob becomes a liquid tab indicator → the tabs open into a chart that draws itself, with a tooltip on hover → it collapses into ⌘K → type to filter → enter → toast → back to the button.
</structure>

<build>
1. One HTML file, square 1440x1440. Every style is computed from time inside seek(t): no CSS transitions, no timers, no state carried between frames.
2. Springs are closed-form step responses. A value that changes target many times is the sum of one spring per change, so it stays a pure function of time.
3. The tab indicator's two edges ride different springs, so the leading edge stretches ahead of the trailing one. Same trick for the toggle knob.
4. Drags are direct manipulation: while the cursor is held, the value is computed from its position. On release it springs back from wherever it was.
5. Analyze the song with numpy for the beat grid and start on a downbeat. Place every UI sound by its measured peak.
6. Render with Playwright: 4 subframes per frame, blended with ffmpeg tmix for motion blur at 60fps.
7. Render one frame per beat before the full render. Fix anything off the grid, cramped or hard to read.
</build>

<gotchas>
Never put will-change on anything the camera scales or the text renders blurry. Text that swaps inside a morphing container needs its own enter and exit timing or it overlaps. Make the last frame identical to the first, cursor position and speed included, or the loop stutters.
</gotchas>

<start>
Ask me for the inputs, then show me the state list on the beat grid before you write any code.
</start>

中文译文

<inputs>
请向我询问:我希望这个形状变成的 8 到 12 个 UI 状态(例如按钮、加载器、播放器、滑块、开关、标签页、图表、命令面板、toast)、纯黑白或一种强调色,以及一首约 120 BPM 的免版税歌曲(例如 Mixkit,可免费商用)。
</inputs>

<direction>
Dribbble 水准的 UI 动效。一个形状,绝不剪辑:每个状态都是同一个元素在改变其尺寸、圆角和颜色,同时内容以短暂的模糊进行切换。一个光标通过真实的点击和拖拽驱动每一次变化。浅暖灰色画布、黑白组件、一种简洁的 UI 字体(Geist)。到处都用弹簧,至多只有极小的过冲。摄像机会缩放,使每个状态充满画面。最后一帧就是第一帧,因此可以循环。
禁止:弹性缓动、粒子爆发、辉光、UI 外框上的渐变、不一致的图标描边、无意义的停顿,以及任何看起来像模板的东西。
</direction>

<structure>
120 BPM,7 小节,每一拍都有事情发生。
按钮 → 加载器 → 对勾 → 灵动岛 → 带有播放/暂停变形动画的音乐播放器 → 拖动进度条 → 它变成一个音量滑块,拖过最大值时会拉伸 → 一个开关在节拍上翻转 → 旋钮变成一个液态标签页指示器 → 标签页展开成一张自行绘制的图表,悬停时显示工具提示 → 它收拢成 ⌘K → 输入以筛选 → 回车 → toast → 回到按钮。
</structure>

<build>
1. 一个 HTML 文件,正方形 1440x1440。每种样式都在 seek(t) 内根据时间计算:不使用 CSS 过渡、不使用定时器,也不在帧之间携带状态。
2. 弹簧是闭式阶跃响应。一个多次改变目标值的量,等于每次变化各一个弹簧的叠加,因此它始终是时间的纯函数。
3. 标签页指示器的两条边由不同的弹簧承载,因此前缘会拉伸到后缘之前。开关旋钮也用同样的技巧。
4. 拖拽是直接操控:按住光标期间,数值由其位置计算得出。释放时,它从当时所在的位置弹回。
5. 用 numpy 分析歌曲以得到节拍网格,并从强拍开始。按实测峰值放置每一个 UI 音效。
6. 用 Playwright 渲染:每帧 4 个子帧,用 ffmpeg tmix 混合,以实现 60fps 的运动模糊。
7. 在完整渲染前,先按每一拍渲染一帧。修正任何偏离网格、拥挤或难以阅读的地方。
</build>

<gotchas>
绝不要给摄像机会缩放的任何元素加 will-change,否则文字会渲染得模糊。在变形容器内部切换的文字需要各自独立的进入和退出时间,否则会重叠。让最后一帧与第一帧完全一致,包括光标位置和速度,否则循环会卡顿。
</gotchas>

<start>
先向我询问这些输入,然后在写任何代码之前,把状态列表按节拍网格展示给我看。
</start>

溯源

原作者
twoclipping
发布日期
2026-09-24(由推文 ID 反解)
原始出处
查看原帖 ↗
收录来源
yihui-dev/awesome-opus5-5-videos · twoclipping-402193 · MIT
yihui-dev/awesome-opus5-5-videos · morse-369333 · MIT
yihui-dev/awesome-opus5-5-videos · demonugc-525162 · MIT
yihui-dev/awesome-opus5-5-videos · dzhohola-249003 · MIT
yihui-dev/awesome-opus5-5-videos · hicallmechai-878304 · MIT
yihui-dev/awesome-opus5-5-videos · nezbuilds-294391 · MIT
yihui-dev/awesome-opus5-5-videos · sanjeevn72-457691 · MIT
yihui-dev/awesome-opus5-5-videos · niebin-gg-621849 · MIT
yihui-dev/awesome-opus5-5-videos · yankis0x-174321 · MIT
zhuyansen/awesome-opus-5.5-video · 2103273003555402193 · 未声明许可
本条由 10 个来源合并去重得来