1仕組みと動作原理
線画アニメーションは dash メカニズムに依存する:stroke-dasharray をパス全体の長さに設定し、dashoffset も同値(不可視状態)に設定した上で、offset を 0 に向けて動かすことで順次描画させる
Draw the dash array as long as the path, offset it fully (invisible), then animate the offset to 0.
パス変形の前提として2つの d のコマンド数および型が一致している必要があり、一致しない場合は MorphSVG や Flubber などのリサンプリングライブラリが必要となる
Paths interpolate point-by-point, so a naive morph requires both `d` attributes to have the **same number and type of commands**.
パスに沿った移動には3つの実装ルート(GSAP MotionPath、mpath を伴う SMIL animateMotion、CSS offset-path)があり、スクロール同期の要否やライブラリ依存関係に応じて選定する
motionPath: { path: "#track", align: "#track", autoRotate: true, alignOrigin: [0.5, 0.5] },
グラデーションやフィルターもアニメーション可能(光の走査を行う gradientTransform や stop offset の制御、変形やフォーカスを行う feDisplacementMap.scale および feGaussianBlur.stdDeviation の制御)だが、フィルターは paint コストの負荷が大きい
Filters are paint-heavy — animate sparingly and prefer `transform`/`opacity` where possible.
納品前には SVG エンジニアリング規律の遵守が必須:SVGO でアニメーション依存設定(cleanupIds、removeViewBox)を削除してはならず、CSS や JS から操作可能にするため SVG をインライン展開する必要がある
keep `viewBox`, drop editor metadata, but disable `cleanupIds`/`removeViewBox` and any plugin that renames IDs you reference from CSS/JS/SMIL.
2コア機能
3外部依存関係
| Kind | Dependency / Endpoint |
|---|---|
| package | gsap 加 MorphSVGPlugin / MotionPathPlugin(可选:形变与沿路径运动) |
| package | flubber(可选:无 GSAP 的路径插值器) |
| cli | SVGO(可选:SVG 清洗与压缩,需关掉会破坏动画的插件) |
| api | 浏览器原语:SVGGeometryElement.getTotalLength()、SMIL animateMotion 与 mpath、CSS offset-path 与 offset-distance |
| network | 交付页可从 CDN 取 GSAP(产物期引用,不判级;正文未点名具体域) |
| cli | npx / Playwright(宿主侧截图工具)与仓库根 scripts/ 助手(seek-shot.sh、contact-sheet.sh 依赖 ffmpeg) |
4推奨統制措置と判定根拠
- 网络端点: 外部ネットワークアクセスの宣言: 実行時の外部通信はゼロ。納品ページは CDN から GSAP を取得可能(生成物側での参照であり、本文中に特定のドメイン名は未記載)
- 本地工作目录: ファイル読み書きおよび成果物出力: 本 skill ディレクトリへの書き込みはゼロ。エージェントが自己完結型 .html ファイル(インライン SVG と単一の駆動コード)を1つ出力
5二重目の独立検証
- [ok] SMIL 的支持与弃用表述是否自洽 — SKILL.md 选型表给出 SMIL 适用面(自包含、无 JS bundle),并在 caveat 段说明 not supported in IE/old Edge and historically deprecation-flagged,要求滚动同步或最大兼容时改用 CSS 或 JS;references 第 4 节以三轴对比表重申,未夸大(未宣称 SMIL 已被移除)。
- [unlocatable] MorphSVG 是否真的免费可用(与 gsap-web 的免费声明同源风险) — SKILL.md 两次称 MorphSVG 在 GSAP 3.12+ 免费(**GSAP MorphSVG** (free as of GSAP 3.12)),但仓库内无上游许可文件可核,属外部事实声明,按文档声明记录(同仓 gsap-web 有同一处声明)。
- [ok] dashoffset 的两条取长度路线是否与 references 一致 — SKILL.md 的 Getting the length 两条(getTotalLength 与 pathLength="1")在 references 的 getTotalLength gotchas 与 No-JS normalization with pathLength 两节展开,且都附代码,前后一致。
- [discrepancy] Packaged helper 的路径基准与适用性 — SKILL.md 写 scripts/seek-shot.sh anim.html 0 1.5 3,scripts/ 在仓库根而非本 skill 目录;且 SMIL 驱动的冻结走 svg.pauseAnimations() 与 setCurrentTime(),helper 只替换 URL 参数,无法冻结 SMIL 时钟——对 SMIL 路径该 helper 失效。
6結論
7a0047bb3c20631d…