Graphic Gif 标志

Graphic Gif

组织
Varnan-Tech
graphic-gif

根据 CSS 动画(默认)或 AI 图像转视频制作循环播放的动态 GIF。默认尺寸为 800 × 800 px,支持 6 种动画类型和 4 种风格预设。用户说“创建动态 GIF”“制作循环 GIF”“动态横幅”“CSS 动画 GIF”“社交媒体动画”“让这个动起来循环播放”“动态图形”或“运动图形”时触发。

Add to TypingMind

概览

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

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

  • 兼容任何大语言模型

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

  • 5 个附带文件

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

  • 开源

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

安装

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

1

安装到 TypingMind

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

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Varnan-Tech/opendirectory/tree/main/skills/graphic-gif
  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/graphic-gif .claude/skills/graphic-gif
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

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

一旦请求与技能匹配,模型就会自动加载 Graphic Gif。

兼容任何 AI 模型

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

  • 仅在需要时加载

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

  • 在聊天中切换模型

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

技能指令

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

graphic-gif

Generates an animated looping GIF from CSS animations or an AI image-to-video API. Output: animation.gif.

Unlike every other graphic- skill that outputs a static PNG or PDF, this skill outputs an animated .gif. Uses CSS @keyframes animations captured frame-by-frame via Playwright and the Web Animations API (Option A, default), or an AI image-to-video pipeline via Kling (Option B).


Critical Rules (read before every generation)

  1. Default is css-animated. Never use ai-generated unless explicitly requested.
  2. Canvas is 800×800px square. All clamp() values computed at 800px (1vw = 8px).
  3. Single self-contained HTML. All CSS inline in <style>. Font CDN <link> only external dependency.
  4. Never dump HTML in chat. Save to file, show summary only.
  5. Frame capture uses Web Animations API seeking. NOT setTimeout loops, NOT animation-delay tricks.
  6. Exact frame count: Math.floor(duration_seconds * fps) frames. The frame at t=duration_ms MUST NOT be captured — it duplicates t=0 and causes a visible stutter at the loop point.
  7. No placeholder boxes. CSS-generated visuals only. No "image goes here" elements.
  8. Simpler palettes = smaller files. Use: clean-slate, terminal, electric-burst, brutalist.
  9. No animation-delay for stagger. Bake stagger into @keyframes percentages — frame seeking handles timing.
  10. Commit to design direction before writing CSS. Tone, signature element, motion style, unforgettable detail — all decided before first line of code.

Step 1: Intake

Required: prompt (content description AND motion brief)

Optional with defaults:

ParameterDefaultOptions
animation_typecss-animatedcss-animated / ai-generated
duration3.0seconds
fps12frames per second
looptruetrue / false
styleclean-slateclean-slate / terminal / electric-burst / brutalist
dimensions800x800WxH in pixels
optimizationbalancedquality / balanced / filesize

If prompt is missing or lacks motion description, ask exactly:

"What should the GIF show? Describe the content AND the motion (e.g., 'Stats count up: 73% of buyers read 3+ pieces of content before purchase. Typewriter effect, one character at a time. Style: terminal. 3 seconds, 12fps.')

Key settings (all optional, defaults shown):

  • animation_type: css-animated (default) or ai-generated
  • duration: 3.0 seconds
  • fps: 12
  • loop: true
  • style: clean-slate (options: clean-slate / terminal / electric-burst / brutalist)
  • dimensions: 800x800
  • optimization: balanced (options: quality / balanced / filesize)"

If all required info is present → skip directly to Step 2.


Step 2: Internal Architecture (never shown to user)

For css-animated:

  1. Choose animation type from: fade-in, slide-in, typewriter, counter, pulse, loop-scroll
  2. Read references/animation-library.md — find the chosen type's full HTML/CSS spec
  3. Read references/style-presets.md — load the chosen style's CSS token block
  4. Calculate frame count: Math.floor(duration_seconds * fps) — write this number down
  5. Commit to design direction:
DecisionDerive from
ToneEmotional register for audience (mechanical / warm / electric / professional)
Signature elementONE visual device used consistently (cursor blink, ghost number, scan-line overlay, accent border)
Motion styleEase curve philosophy for this type (spring / linear / step / ease-in-out)
Unforgettable detailThe ONE thing a viewer will remember about this GIF

For ai-generated:

  1. Generate base still frame HTML (poster-style layout for the canvas)
  2. Export as PNG using screenshot
  3. Call Kling API: POST https://api.klingai.com/v1/videos/image2video with image_url and prompt describing the motion
  4. Poll for job completion
  5. Download video → convert to GIF with ffmpeg:
    bash
    # Two-pass palette for best color quality
    ffmpeg -i input.mp4 -vf "fps=12,scale=800:800:flags=lanczos,palettegen=stats_mode=diff" palette.png
    ffmpeg -i input.mp4 -i palette.png -vf "fps=12,scale=800:800:flags=lanczos,paletteuse=dither=bayer:bayer_scale=5" output.gif

Step 3: HTML Generation (css-animated path)

Read references/animation-library.md and references/style-presets.md before generating.

Canvas base — required on every GIF:

css
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  width: 800px;
  height: 800px;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-body);
}

.canvas {
  width: 800px;
  height: 800px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

Animation rules:

  • animation-fill-mode: forwards (or both) on ALL animated elements
  • Timing functions per type:
    • typewriter → steps(N, end) where N = exact character count
    • counter → linear
    • fade-in → cubic-bezier(0.22, 1, 0.36, 1) (ease-out)
    • slide-in → cubic-bezier(0.34, 1.56, 0.64, 1) (spring overshoot)
    • pulse → ease-in-out with animation-iteration-count: infinite
    • loop-scroll → linear with animation-iteration-count: infinite
  • For one-shot animations (fade-in, slide-in, typewriter, counter): animation-iteration-count: 1 — looping happens at GIF level
  • No animation-delay — stagger is baked into @keyframes percentages

Typewriter N calculation: Count every character including spaces, punctuation, numbers:

  • "73% of buyers" = 14 characters → steps(14, end)
  • "Hello, World!" = 13 characters → steps(13, end)

Counter CSS @property (required for counter type):

css
@property --num {
  syntax: '<integer>';
  inherits: false;
  initial-value: 0;
}
.counter {
  animation: countUp var(--duration) linear forwards;
  counter-reset: num var(--num);
}
.counter::after { content: counter(num); }
@keyframes countUp {
  from { --num: 0; }
  to   { --num: var(--target); }
}

Loop-scroll: content MUST be duplicated:

html
<!-- 4 original items + 4 duplicate items -->
<div class="ticker-track" style="--item-count: 4;">
  [item1][item2][item3][item4][item1][item2][item3][item4]
</div>

translateX(0 → -50%) with linear infinite.

Design quality rules (from commit in Step 2):

  • Named signature element MUST be present in CSS/HTML (not just described)
  • Typography: weight contrast minimum 2:1 (e.g., 700 vs 400) between display and supporting text
  • Background: no pure white #fff for dark styles — use the preset's exact --bg value
  • For terminal style: add scan-line overlay ::after with repeating-linear-gradient at opacity: 0.03
  • For brutalist: thick border 4px solid #000 or 4px solid var(--accent) on key element
  • Unforgettable detail: if it requires an extra element — add it now

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

Canvas:

  • body and .canvas exactly 800×800px (or specified dimensions)
  • overflow: hidden on both body and .canvas
  • No elements overflowing the canvas boundary

Animations:

  • NO animation-delay anywhere — stagger is in @keyframes percentages
  • All animations start at t=0 (Web Animations API will seek from there)
  • animation-fill-mode: forwards or both on all animated elements
  • One-shot animations: animation-iteration-count: 1
  • Infinite animations (pulse, loop-scroll): animation-iteration-count: infinite

Type-specific checks:

  • Typewriter: N in steps(N, end) = exact character count of text string
  • Counter: @property --num declared with syntax: '<integer>' and initial-value: 0
  • Counter: counter-reset: num var(--num) and ::after { content: counter(num) }
  • Loop-scroll: content duplicated exactly once in HTML

Design:

  • No placeholder boxes
  • Style preset tokens applied from references/style-presets.md — no free-floating hex colors
  • Signature element named in Step 2 is actually present in the HTML/CSS
  • Unforgettable detail from Step 2 is actually implemented
  • Font CDN <link> present for chosen style's font

Step 5: Export

Determine slug from prompt (kebab-case, ≤30 chars). Create output directory:

bash
mkdir -p [slug]

Save HTML:

[slug]/animation.html

Open in browser for quick visual check:

bash
open [slug]/animation.html

Run export script (replace [skill-root] with the actual path to this skill):

bash
bash [skill-root]/scripts/export-gif.sh \
  [slug]/animation.html \
  [slug]/animation.gif \
  --duration [duration] \
  --fps [fps] \
  [--no-loop if loop=false] \
  --optimization [optimization] \
  --width [W] \
  --height [H]

The script:

  1. Installs gifenc, sharp (or jimp), and playwright in a temp directory
  2. Downloads Chromium if not cached
  3. Runs capture-and-encode.mjs — pauses animations, seeks each frame, screenshots, assembles GIF
  4. Runs gifsicle optimization pass if available
  5. Reports file size and opens result

If export script not found at [skill-root]/scripts/export-gif.sh, check that the skill was installed with its scripts/ folder intact.


Step 6: Output Summary

Show after successful export:

## GIF: [1-line description]
Date: [YYYY-MM-DD] | Style: [style] | Animation: [type] | [duration]s @ [fps]fps
Dimensions: [WxH] | Frames: [N] | Loop: [true/false]

Files
  Source:   [slug]/animation.html
  Output:   [slug]/animation.gif
  Size:     [X] KB

Checklist
- [ ] Preview loops cleanly at start/end point (no stutter)
- [ ] Text legible at intended display size
- [ ] File size appropriate: email <500KB / social <3MB

AI-Generated Path (Option B)

Only use when animation_type: ai-generated is explicitly specified.

Requirements:

  • Kling API key in environment: KLING_API_KEY (66 free credits/day, no credit card for free tier)
  • ffmpeg installed locally for video→GIF conversion

Workflow:

  1. Generate a base still frame HTML matching the prompt (poster/graphic style at specified dimensions)
  2. Export still frame as PNG:
    bash
    # Quick screenshot via Playwright
    node -e "
      const { chromium } = require('playwright');
      (async () => {
        const browser = await chromium.launch();
        const page = await browser.newPage({ viewport: { width: W, height: H } });
        await page.goto('file://[slug]/animation.html');
        await page.screenshot({ path: '[slug]/base-frame.png' });
        await browser.close();
      })();
    "
  3. Upload to Kling image-to-video endpoint
  4. Convert result to GIF with ffmpeg two-pass palette
  5. Apply gifsicle optimization

When Kling is unavailable: Fall back to css-animated with a note to the user: "AI generation requires a Kling API key (KLING_API_KEY). Falling back to css-animated. Set the key to enable AI generation."


Prompt Tips (show when user asks for guidance)

"Describe motion, not just content. 'Stats count up one by one' beats 'show stats'."

"Keep it simple for file size. 1–3 animated elements and a solid background."

"Think in loops. The animation should flow invisibly from end back to start."

"Specify the animation type explicitly. typewriter and counter are the most effective for social."

✅ Good: "Create an animated GIF, css-animated, typewriter effect. Text: '73% of B2B buyers read 3+ pieces of content before contacting sales.' Each character types out one at a time. Style: terminal. 3 seconds, 12fps, loop=true."

❌ Bad: "make an animated gif of marketing tips"

附带文件

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

常见问题

Graphic Gif AI 技能有什么作用?

根据 CSS 动画(默认)或 AI 图像转视频制作循环播放的动态 GIF。默认尺寸为 800 × 800 px,支持 6 种动画类型和 4 种风格预设。用户说“创建动态 GIF”“制作循环 GIF”“动态横幅”“CSS 动画 GIF”“社交媒体动画”“让这个动起来循环播放”“动态图形”或“运动图形”时触发。

为什么在 TypingMind 中使用 Graphic Gif?

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

如何在 TypingMind 中安装 Graphic Gif?

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

哪些 AI 模型可以使用 Graphic Gif?

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

Graphic Gif 可以搭配多少个 AI 模型使用?

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

Graphic Gif AI 技能免费吗?

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

什么是 AI 技能?

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

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

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

查看全部

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

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