代码生成视频 / 规格模板派

UI 形态变形循环:六段式模板 UI Morph Loop: The Six-Section Template

规格模板派14s · 1:1分享者:zero (@twoclipping)· 出处:X @twoclipping(3 源核验一致:joeseesun prompts/15、claudevideo.org、YouMind)

预览为我们用这条提示词自行生成(seek(t) 逐帧渲染),非原作者成片

▶ 在线运行

Original Prompt

<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>
copy original

中文对照

〔要点对照〕<inputs> 先向我要:8-12 个 UI 状态(按钮、加载器、播放器、滑块、开关、标签页、图表、命令面板、Toast)、纯黑白或单一强调色、一首约 120 BPM 的免版税歌曲。
<direction> Dribbble 级 UI 动效:一个形状从头到尾不切断,每个状态都是同一元素在变形尺寸/圆角/颜色,内容以短促模糊切换;光标以真实点击与拖拽驱动每一次变化;暖灰画布 + Geist 字体;全程弹簧动效、至多轻微过冲;相机缩放让每个状态撑满画面;首尾帧相同形成循环。禁用:弹跳缓动、粒子爆炸、辉光、UI 部件渐变、粗细不一的图标线条、死时间、一切模板感。
<structure> 120 BPM 共 7 小节,每拍都有事件:按钮→加载器→对勾→灵动岛→播放器(播放/暂停变形)→拖动进度条→变成拉过头会拉伸的音量条→开关踩拍翻转→旋钮变液态标签指示器→标签页展开成自绘图表(悬停出提示)→收起成 ⌘K→输入过滤→回车→Toast→回到按钮。
<build> 单个 1440x1440 HTML;一切样式由 seek(t) 从时间计算,无 CSS transition、无计时器、帧间无状态;弹簧用闭式解,多次改目标的值是每次一个弹簧的叠加,保持时间的纯函数;tab 指示器两条边骑不同弹簧使前缘拉伸领先后缘;拖拽即直接操纵,松手从原位弹回;numpy 分析节拍网格、下拍起拍,UI 音效按实测峰值摆放;Playwright 每帧 4 子帧 + ffmpeg tmix 合成 60fps 运动模糊;全量渲染前先逐拍渲静帧检查,修掉脱格、拥挤、难读之处。
<gotchas> 镜头缩放的元素别加 will-change 否则文字发糊;morph 容器内换文字要有独立进出时序否则重叠;末帧必须与首帧完全一致(含光标位置与速度),否则循环卡顿。
<start> 先向我要输入,然后在写任何代码前把状态列表摆上节拍网格给我看。
复制对照

动效行业内行的“六段式”写法:<inputs>(先问什么)→ <direction>(审美方向 + 禁用清单)→ <structure>(逐拍结构)→ <build>(工程铁律)→ <gotchas>(预埋的坑)→ <start>(第一步做什么)。这六段几乎能装下任何视觉 brief——它把品味、编舞、工程、经验分格存放,模型逐段执行不串味。

两个行业级细节:Banned 清单和正面描述同样重要——“禁弹跳、禁粒子、禁辉光、禁模板感”一句话就把“廉价 AI 味”拦在门外;springs are closed-form step responses(弹簧用闭式解)保证动效在 seek(t) 确定性渲染下逐帧可重现,是“能导出视频”的前提。

One shape, never cut 是创意钩:一个形状morph 穿越十几个 UI 状态,形式感全部来自这条自我约束。写 brief 时给自己找一条这样的“不可能约束”,产出立刻脱离模板。

#规格模板#UI 动效#六段式#音乐卡点#seek-t