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 個來源合併去重而來