Communitygithub.com

Bigper4mer/opus-motion

選擇、混合與整合 Opus Motion Library 中的動態圖形 — 約 605 個參數化的 Remotion 動畫(標題、背景、天氣、粒子、角色、數據/HUD、UI 原型、圖片效果、3D)、97 種轉場、148 種風格與 33 個即用配方。當使用者需要特定動畫(如「聲納脈衝」、「蓋章效果說 X」)、將多個動畫混合到一個鏡頭或影片中、有旁白的解說影片,或是網站、網頁應用程式(React、Next.js、Vite、純 HTML、WordPress)、原生應用程式(匯出為 mp4/webm-alpha/ProRes)或簡報中的動畫背景/主視覺/統計/載入器/慶祝狀態時使用 — 包括當函式庫已被複製或連結到另一個專案時。

opus-motion 是什麼?

Opus Motion Library 是一個專為開發者與 AI 代理設計的綜合性動態圖形函式庫,包含超過 600 個參數化的 Remotion 動畫、97 種轉場與 33 個即用配方。它支援多種平台,包括影片製作(Remotion)、網頁開發(React、Next.js、Vite、plain HTML、WordPress)以及原生應用程式(透過 mp4/webm-alpha/ProRes 匯出)。此技能提供 CLI 工具 (`mgl.mjs`) 用於建議、渲染、混合與匯出動畫,並提供 Web 元件 (`<opus-motion>`) 以便快速整合至任何網頁專案。主要優勢在於其結構化的選擇流程(從使用者意圖出發,透過 `mgl suggest` 取得建議)、嚴格的圖層規則(一個主視覺、輔助支援層)以及效能最佳化指導,確保動畫在不同裝置上流暢執行。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Bigper4mer/documentary-film-kit/tree/HEAD/documentary-film/library/skills/opus-motion

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Opus Motion Library

根目錄:此 repo 被 clone 進去的資料夾,或目前主機專案內部的複本。先閱讀該處的 AGENTS.md — 決策程序、圖層規則、網頁效能規則與反模式。然後閱讀 docs/CHOOSING.md(意圖 → 動畫)和 docs/INTEGRATION.md(依技術棧)。

1. 選擇(絕不憑記憶猜測)

  • node cli/mgl.mjs suggest "<使用者描述的簡要說明>" — 對 ★ 配方和動畫進行排名,解釋原因,並輸出 props 片段。支援篩選 --overlay --image --text --loop --light --category <c> --json。
  • node cli/mgl.mjs recipes — 即用混合(預覽圖位於 recipes/previews/<id>.jpg):hero-aurora-night、hero-paper-sketch、hero-blueprint-logo、product-launch、stats-reveal、testimonial-chat、testimonial-quote、loading-loop、section-divider、success-celebration、error-glitch、onboarding-steps、event-countdown、music-neon-promo、ocean-explainer、history-timeline、app-store-preview (9:16)、social-short-captions (9:16)、end-card。
  • node cli/mgl.mjs info <id> — props + roles、overlay/overlayProps、loopable、mood、weight、pairsWith、textProps。
  • 混合 = 背景 + 主體 + 類型 + 細微強調;每個鏡頭一個主視覺;淡化支援層;取代所有範例文字;傳入品牌顏色。

2. 影片(Remotion)

node cli/mgl.mjs render <id> --props '{"key":"value"}' [--format landscape|square|portrait] [--frames N] --out out/<name>.mp4
node cli/mgl.mjs recipe <id> --overrides '{"<motion-id>":{…}}' [--format …] --out out/<name>.mp4
node cli/mgl.mjs still <id> --at 10,60,120 --out out/<name>-sheet.jpg     # 先預覽,再讀取表單
node cli/mgl.mjs compose specs/<name>.json --out out/<name>.mp4             # scenes[] (motion 或 layers[])、transitions、overlays、audio
node cli/direct.mjs storyboards/<name>.json                                 # 含旁白:本地 Qwen3-TTS -> 字幕 -> 渲染 -> 主影片

圖片:使用 public/ 路徑(例如 "demo/owl.jpg")或 https URL。絕不使用雲端語音/音樂服務;音樂/SFX 來自 public/music、public/sfx。 在另一個 Remotion 專案內:node cli/mgl.mjs add <motions|recipes> --to <host>/src(只複製必要的原始碼 + 本地註冊表;會印出 npm install 指令)。

3. 網站 / 網頁應用程式

  • 在函式庫中執行 npm run build:lib,然後 import {MotionBackground, MotionPlayer, MotionMix} from 'opus-motion-library/web' (Vite:設定 resolve.dedupe 處理 react/remotion/@remotion/*/three),或 mgl add … --player --to <app>/src(Next.js:從 'use client' 檔案中使用)。
  • 純 HTML / WordPress / Vue / Svelte:<script src="opus-motion.element.js"> + <opus-motion recipe="…" background> / <opus-motion motion="…" props='{…}'>。
  • HTML 中的文字可疊在 MotionBackground 上方(它會移除 type 圖層);overlay 動畫會浮在頁面上;playOnView、 reduced-motion 靜止畫面、懶加載掛載、每個視口最多 2 個活躍播放器;重度 3D 請在手機上使用匯出的影片。
  • 提供所使用的函式庫 public/ 檔案(或 assetBase / 絕對 URL)。

4. 原生應用程式、簡報、編輯器

node cli/mgl.mjs export <motion|recipe> --as mp4|webm|webm-alpha|prores-alpha|gif|png|poster [--format …] [--props …] (Alpha 匯出會套用 overlayProps;可使用 ffprobe -c:v libvpx-vp9 … pix_fmt 檢查 → yuva420p)。

5. 交接前檢查

將渲染結果拼成圖格(ffmpeg -i out/x.mp4 -vf "fps=1,scale=480:-2,tile=6x5" -frames:v 1 out/x-sheet.jpg)或截取頁面 (node examples/screenshot.mjs <url> <dir> --targets "top,#section" — 兩張截圖間隔 1 秒,回報變動百分比),進行檢查並修正。

新增動畫至函式庫

請遵循 docs/AUTHORING.md,將動畫放入 src/motions/<family>/<id>.tsx,執行 node cli/gen-registry.mjs && npx tsc --noEmit && node cli/gen-docs.mjs; 可選地執行 node cli/probe-meta.mjs --only <id>(測量 loop / overlay / luma)並在 docs/motion-meta.json 中加入覆寫設定。

相關技能