Communitygithub.com

hacimertgokhan/geomotion

从简单形状创建手绘风格的变形线条动画(沸腾墨水、Riso 填充效果),并导出为动画 SVG、Lottie JSON、HTML 或可分享链接。适用于用户需要动画图标、加载动画、插画、解说动效、Logo 短片、空状态/成功动画,或“手绘”、“涂鸦”、“草稿”风格动画,以及涉及几何运动(geomotion)的场景。

geomotion 是什么?

geomotion 是一款将 JSON 规范(spec)转化为手绘风格动画的工具。用户通过定义关键帧(keyframe)列表,每个关键帧包含一系列形状,相同 `id` 的形状会在关键帧之间平滑变形,同时线条会持续“沸腾”(约 12 帧/秒),营造手绘般的不完美质感。该技能支持多种输出格式(动画 SVG、Lottie JSON、HTML)和可分享链接,并内置丰富的预设库(界面、自然、沟通、创意、角色、抽象等)。用户可以通过 MCP 工具、CLI 或直接编写规范来使用。核心设计要素包括:使用 JSON 定义画布大小、帧率、配色(提供 ink, oat, clay 等调色板名称或 hex)、形状类型(circle, line, rect, path 等)以及缓动函数。最终生成的动画可以轻松嵌入网页,适合制作图标、加载动画、解说动效或空状态/成功动画,尤其适合“手绘”、“涂鸦”、“草稿”风格的需求。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hacimertgokhan/geomotion/tree/HEAD/skills/geomotion

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

geomotion 是做什么的?

gcomotion 将 JSON 规范(spec)—— 即一个关键帧列表,每个关键帧包含一组形状 —— 转化为手绘风格的动画。相同 id 的形状会在关键帧之间互相变形;线条会持续“沸腾”(约 12 帧/秒 重新描画),使最终效果如同手绘一般。

网站与工作室:https://hacimertgokhan.github.io/geomotion · 仓库:https://github.com/hacimertgokhan/geomotion

工作流程

  1. 选择途径(使用第一个可用的):
    • MCP 工具(geomotion_guide、geomotion_get_preset、geomotion_render、geomotion_share_link):先调用一次 geomotion_guide,然后渲染。
    • CLI(Node 18+ 并有网络连接):npx -y github:hacimertgokhan/geomotion render spec.json --both --formats svg,lottie,html
    • 无工具:编写规范,然后运行 python scripts/link.py spec.json(在本技能文件夹中),得到一个播放器/工作室链接,用户可以直接打开、编辑和导出。
  2. 如果某个预设比较接近,就以其为基础(见下方目录)并调整 id、位置和颜色。
  3. 按照以下规则编写规范。进行验证(MCP geomotion_validate 或 geomotion check spec.json)。
  4. 交付:文件路径和/或播放器链接。提供工作室链接,方便用户自行调整。当动画将用于网站时,建议提供透明版本(transparent: true 或 "both")。

规范要点

{
  "name": "idea",
  "size": [1200, 1200],
  "fps": 24, "boil": 12, "loop": true,
  "background": "ivory",
  "hold": 0.7, "duration": 0.9, "ease": "inOutCubic",
  "style": { "width": 24, "wobble": 1, "misregister": [-14, 10] },
  "keyframes": [
    { "shapes": [ { "id": "bulb", "type": "circle", "cx": 600, "cy": 520, "r": 220, "fill": "oat" } ] },
    { "hold": 1.2, "shapes": [
      { "id": "bulb", "type": "circle", "cx": 600, "cy": 520, "r": 240, "fill": "sun" },
      { "id": "ray", "type": "line", "from": [600, 200], "to": [600, 110], "enter": "draw", "delay": 0.3 }
    ] }
  ]
}
  • 关键帧:hold(显示秒数)、duration(变形到下一个关键帧的时间)、ease。
  • 形状类型:circle {cx,cy,r}、ellipse {cx,cy,rx,ry}、rect {x,y,w,h,radius?} 或 {cx,cy,w,h}、 line {from,to}、polyline {points,closed?}、polygon {points}、regular {cx,cy,r,sides}、 triangle {cx,cy,r}、star {cx,cy,r,inner?,points?}、heart {cx,cy,size}、blob {cx,cy,r,seed?}、 crescent {cx,cy,r,thickness?,angle?}、wave {from,to,amplitude?,waves?,phase?}、spiral {cx,cy,r,turns?}、 arc {cx,cy,r,start,end}(角度,0 度=右侧,顺时针)、path {d}(任意 SVG 路径)。
  • 形状选项:id(跨关键帧匹配 —— 务必设置)、fill、stroke(颜色或 false)、 width、opacity、enter/exit(grow | pop | draw | fade | cut)、delay(0–0.95,交错使用)、 ease、transform {translate, rotate, scale, origin}、misregister: false(用于微小的实心点)。
  • 调色板名称:ink, slate, ivory, paper, oat, kraft, clay, coral, fig, sky, cactus, olive, heather, sun, white(或任意 hex 颜色)。
  • 缓动函数:linear, in/out/inOut Quad·Cubic·Sine, inOutQuart, outExpo, inOutExpo, outBack, inOutBack, outElastic, outBounce。

让效果更好的设计规则

  1. 画布 1200×1200,边距约 120 px,每个姿势 2–5 个粗体形状。小细节会显得模糊。
  2. 每个轮廓使用 ink,每个姿势使用 一到两种强调填充色(oat, clay, sun, sky, cactus, coral)。
  3. 通过 id 讲故事:同一个元素发生变换(太阳→月亮,信封→纸飞机,点→心形)。
  4. 使用 delay 0 / 0.15 / 0.3 实现交错效果;需要书写感的线条使用 "enter": "draw",俏皮的出现使用 "pop"。
  5. 停留时间 0.5–1.2 秒,变形时间 0.5–1.2 秒。inOutCubic = 平静,inOutBack/outBack = 俏皮,outElastic = 果冻感。
  6. 两个关键帧之间旋转 > 30° 会导致线条切角——将大旋转拆分为多个关键帧(参见 spinner、gears、orbit 预设)。
  7. 实心点(眼睛、打字点):"stroke": false, "fill": "ink", "misregister": false。

预设目录(起点)

  • 界面:loader, spinner, success, error, toggle, bell, search
  • 自然:sunrise, sprout, rain, night, sea
  • 沟通:chat, send, like, connect
  • 创意:idea, growth, target, gears, house
  • 角色:smile, ghost, sparkle
  • 抽象:drift, orbit, kaleido, pebbles
  • 运动:bounce, pendulum, jelly

所有预设可直接打开:https://hacimertgokhan.github.io/geomotion/play/#preset=<名称> (添加 &bg=0 可获得透明背景)或在工作室中打开:/studio/#preset=<名称>。

嵌入网页

<script type="module" src="https://hacimertgokhan.github.io/geomotion/src/embed.js"></script>
<geo-motion preset="success" transparent style="width:160px"></geo-motion>
<geo-motion code="z…"></geo-motion>   <!-- 分享链接中的 #s=… 部分 -->

相关技能