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>
次の点を私に確認してください:このシェイプが変化すべきUI状態を8〜12個(例:ボタン、ローダー、プレイヤー、スライダー、トグル、タブ、チャート、コマンドパレット、トースト)、純粋な白黒か1色のアクセントカラー、そして120 BPM前後のロイヤリティフリー楽曲(例:Mixkit、商用利用無料)。
</inputs>

<direction>
DribbbleレベルのUIモーション。1つのシェイプで、カットは一切なし:どの状態も同じ要素がサイズ・角丸・色をモーフィングさせ、その内容は短いブラーで入れ替わる。カーソルが実際のクリックとドラッグで全ての変化を駆動する。明るいウォームグレーのキャンバス、白黒のコンポーネント、クリーンなUIフォントを1つ(Geist)。あらゆる箇所にスプリングを使い、オーバーシュートはごくわずかに。カメラがズームして各状態がフレームを埋める。最後のフレームは最初のフレームと同じにしてループさせる。
禁止:跳ねるようなイージング、パーティクルの飛散、グロー、UIクローム上のグラデーション、線幅が揃わないアイコン、無駄な静止時間、テンプレートに見えるものすべて。
</direction>

<structure>
120 BPM、7小節、毎拍何かが起こる。
ボタン → ローダー → チェック → ダイナミックアイランド → 再生/一時停止がモーフするミュージックプレイヤー → プログレスバーをスクラブ → 最大値を超えてドラッグすると伸びる音量スライダーに変化 → トグルが拍に合わせて切り替わる → ノブがリキッドなタブインジケーターになる → タブが開いて自己描画するチャートになり、ホバーでツールチップ → それが⌘Kに折りたたまれる → 入力してフィルター → enter → トースト → ボタンに戻る。
</structure>

<build>
1. HTMLファイル1つ、正方形の1440x1440。すべてのスタイルは seek(t) 内で時間から計算する:CSSトランジションなし、タイマーなし、フレーム間で状態を持ち越さない。
2. スプリングは閉形式のステップ応答。ターゲットを何度も変える値は、変更ごとに1つのスプリングを足し合わせたものになるので、時間の純粋な関数のまま保たれる。
3. タブインジケーターの両端は別々のスプリングで動くので、先端が後端より先に伸びる。トグルのノブも同じ仕組み。
4. ドラッグは直接操作:カーソルを押している間、値はその位置から計算される。離すと、その時点の位置からスプリングで戻る。
5. numpyで楽曲を解析してビートグリッドを求め、ダウンビートから開始する。UIサウンドはすべて計測したピークに配置する。
6. Playwrightでレンダリング:1フレームにつき4サブフレーム、60fpsのモーションブラー用にffmpegのtmixでブレンドする。
7. 本番レンダリングの前に、1拍につき1フレームをレンダリングする。グリッドから外れているもの、窮屈なもの、読みにくいものを修正する。
</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 件の出典を統合・重複排除して作られました