Vid Motion Graphics 标志

Vid Motion Graphics

组织
Varnan-Tech
vid-motion-graphics

Generates motion graphics videos (MP4) from a content brief. Multi-scene HTML/CSS animations rendered frame-by-frame in headless Chromium via Playwright, assembled with FFmpeg. 1080×1080 default, 16:9 (1920×1080) and 9:16 (1080×1920) supported. 5 style presets. Trigger when user says "create a video", "motion graphic", "animated video", "make a reel", "create an explainer", "animated infographic", or "short video".

概览

发布者Varnan-Tech
代码仓库opendirectory
技能名称vid-motion-graphics
星标数
674
复刻数
74
附带文件
5
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 5 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 Varnan-Tech 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Vid Motion Graphics AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Varnan-Tech/opendirectory/tree/main/skills/vid-motion-graphics
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Varnan-Tech/opendirectory.git /tmp/opendirectory
mkdir -p .claude/skills
cp -r /tmp/opendirectory/skills/vid-motion-graphics .claude/skills/vid-motion-graphics
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Vid Motion Graphics,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Vid Motion Graphics。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Vid Motion Graphics 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

vid-motion-graphics

Generates multi-scene motion graphics as MP4. Renders HTML/CSS animations in headless Chromium via Playwright (Web Animations API frame-seeking), assembles PNG frames with FFmpeg. No React, no AI APIs, no Python — zero new dependencies beyond the graphic-gif family.

CDN fonts only. No external libraries in HTML.


Critical Rules (read before every generation)

  1. Use window.renderFrame(t) — no CSS @keyframes for scene transitions. CSS animation currentTime seeking is silently ignored for backward seeks in Chromium. The renderFrame approach: a pure JS function computes opacity/transform directly from milliseconds. Playwright calls it once per frame. Deterministic, race-free.
  2. No animation-delay on ANY element. Not needed with renderFrame. If you catch yourself writing animation-delay, stop — you're using the wrong architecture.
  3. window.__videoReady = true only inside document.fonts.ready.then(...). Never set synchronously — fonts must load before Playwright captures frame 1 or text renders with fallback fonts.
  4. Expose window.__stopPreview(). The browser's rAF preview loop races with Playwright's evaluate/screenshot calls. capture-frames.mjs calls __stopPreview() before the frame loop. Always include it.
  5. Use t < startMs (not <=) in scene boundary checks. t <= 0 at frame 0 makes scene 1 black. The correct guard is if (t < startMs || t >= endMs) return hidden.
  6. Body = exact pixel dimensions. Width and height are integers (1080px, 1920px). No %, vw/vh, or responsive units.
  7. No two scenes visible simultaneously (except 10% enter overlap). All scenes opacity: 0 outside their renderFrame window.
  8. Transitions use opacity only. No display toggle, no visibility — GPU-composited opacity is frame-perfect.
  9. Never dump HTML in chat. Save to file, show summary only.
  10. Title states the message, not the topic. "3 Reasons Q4 Crushed Targets" not "Q4 2024 Performance Video".
  11. Read references/scene-library.md before generating ANY HTML. Use exact HTML structure and CSS class names from that file.

Step 1: Intake

Required: content_brief

Optional parameters and defaults:

ParameterDefaultDescription
content_brief—Text describing what the video communicates (required)
scenesautoNumber of scenes (1–6). Auto = derived from brief.
duration_per_scene3sDuration per scene in seconds (1–8s)
stylekinetic-darkkinetic-dark / editorial-light / data-pulse / bold-type / minimal-clean
aspect_ratio1:11:1 (1080×1080) / 16:9 (1920×1080) / 9:16 (1080×1920)
fps30Frames per second (24, 30, or 60)
musicnonePath to audio file for background track (mp3/m4a/wav)
source—Source attribution shown in final frame footer

If content_brief is missing, ask exactly:

"To create the video, I need a content brief — what should the video communicate?

Example: 'Show 3 reasons why Q4 revenue grew 85%: new enterprise deals, reduced churn, price increase. Use bold numbers. Style: data-pulse.'

Optional: style (default: kinetic-dark), aspect ratio (default: 1:1), seconds per scene (default: 3s)"

If content_brief is present → proceed to Step 2 immediately.


Step 2: Internal Architecture (never shown to user)

1. Parse brief into scenes (max 6):

  • Scene 1 = hook or title (always)
  • Scenes 2–N-1 = supporting points, metrics, or story beats
  • Scene N = CTA or closing summary (always, if more than 1 scene)
  • One key idea per scene — if brief has 7+ ideas, consolidate the weakest ones

2. Read references/scene-library.md — choose scene type for each scene:

  • Hook/opening → title-card
  • Single metric → stat-reveal
  • List of 2–4 points → bullet-list
  • Before vs after / two values → split-screen
  • Testimonial / quote → quote-card
  • Final / CTA → cta-card

3. Read references/style-presets.md — load CSS tokens + animation personality for chosen style.

4. Calculate timing:

totalDuration = sceneCount × duration_per_scene  (seconds)
totalFrames   = totalDuration × fps

Each scene occupies (100 / sceneCount)% of the total @keyframes range.

SceneStart %End %
10%(100/N)%
2(100/N)%(200/N)%
………
N((N-1)×100/N)%100%

Within each scene's range:

  • Enter: first 10% of scene range
  • Hold: 10% to 85% of scene range
  • Exit: 85% to 100% of scene range

5. Determine pixel dimensions:

  • 1:1 → W=1080, H=1080
  • 16:9 → W=1920, H=1080
  • 9:16 → W=1080, H=1920

Step 3: HTML Generation

Read references/scene-library.md AND references/style-presets.md before writing any code.

Required HTML structure:

html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
[font CDN link from style preset]
<style>
:root {
  [all CSS tokens from style preset]
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: [W]px; height: [H]px;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-body);
  position: relative;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px;
  opacity: 0;
  will-change: opacity, transform;
}
.scene-inner {
  width: 100%;
  max-width: 960px;
}

/* Scene-type CSS from scene-library.md */
[paste scene-type CSS here]
</style>
</head>
<body>

<div class="scene scene-1">
  <div class="scene-inner">
    [scene 1 HTML from scene-library.md template]
  </div>
</div>

[repeat for each scene]

<script>
window.__videoReady = false;
window.TOTAL_DURATION_MS = [totalDuration * 1000];

// ── Animation helpers ─────────────────────────────────────────────────────────
function lerp(a, b, p) { return a + (b - a) * p; }
function clamp(v, lo, hi) { return Math.max(lo, Math.min(hi, v)); }
function easeOutCubic(t) { return 1 - Math.pow(1 - clamp(t, 0, 1), 3); }

function sceneState(t, startMs, endMs) {
  if (t < startMs || t >= endMs) return { opacity: 0, ty: 0 };
  const prog = (t - startMs) / (endMs - startMs);
  if (prog < 0.10) {
    const p = easeOutCubic(prog / 0.10);
    return { opacity: p, ty: lerp(24, 0, p) };
  }
  if (prog < 0.85) return { opacity: 1, ty: 0 };
  const p = (prog - 0.85) / 0.15;
  return { opacity: 1 - p, ty: lerp(0, -12, p) };
}

function applySceneState(el, state) {
  el.style.opacity = state.opacity;
  el.style.transform = state.ty !== 0 ? `translateY(${state.ty.toFixed(2)}px)` : '';
}

// ── Main render function — called by Playwright once per frame ────────────────
window.renderFrame = function(t) {
  // Scene 1: 0ms – [D]ms
  applySceneState(document.querySelector('.scene-1'), sceneState(t, 0, [D]));
  // Scene 2: [D]ms – [2D]ms
  applySceneState(document.querySelector('.scene-2'), sceneState(t, [D], [2D]));
  // ... repeat per scene ...
};

// ── Preview loop — stopped by Playwright before frame capture ─────────────────
let __previewActive = false;
let __previewRafId = null;
window.__stopPreview = function() {
  __previewActive = false;
  if (__previewRafId !== null) { cancelAnimationFrame(__previewRafId); __previewRafId = null; }
};

document.fonts.ready.then(() => {
  window.renderFrame(0);
  window.__videoReady = true;
  __previewActive = true;
  const startTime = performance.now();
  function previewTick() {
    if (!__previewActive) return;
    const elapsed = performance.now() - startTime;
    if (elapsed < window.TOTAL_DURATION_MS) {
      window.renderFrame(elapsed);
      __previewRafId = requestAnimationFrame(previewTick);
    } else {
      window.renderFrame(window.TOTAL_DURATION_MS - 1);
      __previewActive = false;
    }
  }
  __previewRafId = requestAnimationFrame(previewTick);
});
</script>
</body>
</html>

Design quality rules:

  • Headline font size: never smaller than 60px — text must read at mobile thumbnail size
  • Numbers and stats: always the largest element on screen (120–200px)
  • Tight letter-spacing on display type: -0.02em to -0.04em
  • One accent color per scene — don't scatter accent across multiple elements
  • Dark presets: dividers rgba(255,255,255,0.10), never solid
  • Light presets: dividers rgba(0,0,0,0.10), never solid
  • transform-origin: center center on every element that uses transform
  • Padding inside .scene: minimum 80px — never let text touch viewport edges

Step 4: Self-QA (fix every failure before Step 5)

renderFrame correctness:

  • window.renderFrame(t) defined — pure function, no side effects outside style writes
  • Scene boundary uses t < startMs (not t <= startMs) — avoids black frame 0
  • Zero instances of animation-delay or @keyframes for scene transitions
  • No two scenes have overlapping opacity: 1 windows (except 10% enter overlap)
  • window.__stopPreview() exposed and preview rAF loop checks __previewActive

Readiness signal:

  • window.__videoReady = false declared before document.fonts.ready
  • window.__videoReady = true set ONLY inside document.fonts.ready.then(...)
  • window.renderFrame(0) called inside document.fonts.ready.then(...) before setting __videoReady = true

Layout:

  • html, body use exact pixel dimensions ([W]px, [H]px)
  • No %, vw, vh, rem units on body width/height
  • overflow: hidden on html, body
  • All scenes position: absolute; inset: 0

Design:

  • All colors from style preset tokens — no free hex values
  • All fonts from style preset — no free font-family strings
  • Headline font size ≥ 60px
  • Source in final scene if source param provided

Step 5: Export

Determine slug from brief content (kebab-case, ≤30 chars):

bash
mkdir -p chart/[slug]

Save HTML: chart/[slug]/video.html

Browser preview:

bash
open chart/[slug]/video.html

Run export (replace [skill-root] with path to this skill's directory):

bash
bash [skill-root]/scripts/export-video.sh \
  chart/[slug]/video.html \
  chart/[slug]/video.mp4 \
  --duration [totalDuration] \
  --fps [fps] \
  --width [W] \
  --height [H] \
  [--music path/to/audio.mp3]

The script installs Playwright on first run (~200MB Chromium), captures all frames, then assembles MP4 with FFmpeg.


Step 6: Output Summary

## Video: [title from brief]
Date: [YYYY-MM-DD] | Scenes: [N] | Style: [style] | Aspect: [ratio]
Duration: [N]s | FPS: [fps] | Frames: [N]

Files
  Source:   chart/[slug]/video.html
  Output:   chart/[slug]/video.mp4
  Size:     [X] MB

Checklist
- [ ] All scenes appear in sequence with no blank frames
- [ ] Text legible at mobile thumbnail size
- [ ] Scene transitions smooth (no jump cuts)
- [ ] Final scene includes CTA or closing message
- [ ] Source attribution present in final frame (if provided)

Prompt Tips (show when user asks for guidance)

"Provide a content brief — bullet points of what each scene should say."

"Name the insight directly. '3 reasons Q4 grew 85%' gives the video a spine."

"Mention the style if you have a preference: kinetic-dark (default), editorial-light, data-pulse, bold-type, minimal-clean."

"Specify aspect ratio for the platform: 1:1 for LinkedIn/Instagram feed, 9:16 for Stories/Reels, 16:9 for YouTube/presentations."

✅ Good: "Create a 9-second video. Q4 revenue hit $4.2M (85% growth). Drivers: enterprise deals, churn 1.2%, price increase. CTA: acme.com/q4. Style: data-pulse. Aspect: 1:1."

❌ Bad: "make a video about our company"

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Vid Motion Graphics AI 技能有什么作用?

Generates motion graphics videos (MP4) from a content brief. Multi-scene HTML/CSS animations rendered frame-by-frame in headless Chromium via Playwright, assembled with FFmpeg. 1080×1080 default, 16:9 (1920×1080) and 9:16 (1080×1920) supported. 5 style presets. Trigger when user says "create a video", "motion graphic", "animated video", "make a reel", "create an explainer", "animated infographic", or "short video".

为什么在 TypingMind 中使用 Vid Motion Graphics?

因为您只需安装一次,就能搭配任何模型使用。Vid Motion Graphics 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Vid Motion Graphics?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/Varnan-Tech/opendirectory/tree/main/skills/vid-motion-graphics。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Vid Motion Graphics?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Vid Motion Graphics 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Vid Motion Graphics 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Vid Motion Graphics AI 技能免费吗?

是的。Varnan-Tech 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇