Communitygithub.com

HyperFrames 动画技能

涵盖 HyperFrames 的所有动画知识——原子运动规则、多阶段场景蓝图、场景过渡、更广泛的动效设计技巧,以及七个运行时适配器(默认 GSAP,外加 Lottie、Three.js、Anime.js、CSS 关键帧、Web 动画 API、TypeGPU)。适用于任何动画任务。

HyperFrames 动画技能 是什么?

这是一个专为 HyperFrames 框架设计的综合性动画专业知识包。它将动画知识系统化地组织为几个层次:原子规则(可组合的微交互)、多阶段场景蓝图、场景过渡以及高阶动效设计模式。技能内置了七个运行时适配器,其中 GSAP 是默认运行时,覆盖了超 95% 的动效工作,其他适配器包括用于处理 After Effects 导出的 Lottie、用于 3D 场景的 Three.js、轻量级补间动画 Anime.js、零 JavaScript 成本的 CSS 关键帧、原生浏览器 API 的 WAAPI,以及 GPU 渲染的 TypeGPU(基于 WebGPU)。 其核心设计原则是:单条暂停的时间线、可寻址、确定性。所有动画都在一条暂停的 GSAP 时间线上定义,通过数据属性控制时长,并禁用随机性(`Math.random`、`Date.now` 等)。技能强调预计算布局常量而非运行时 DOM 测量,并要求空间运动仅使用 GSAP 的变换属性别名(x、y、scale、rotation),以避免渲染反序列化问题。它支持多运行时共存于同一合成中,每个运行时将其实例注册在特定的全局变量上,以便 HyperFrames 引擎通过单次寻道同步控制所有动画。此外,该技能还提供了一个分析脚本 `animation-map.mjs`,用于审计动画编排的节奏、空白区域和生命周期警告。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/courtneymgabrus-star/Video/tree/HEAD/.agents/skills/hyperframes-animation

在你喜欢的 AI 中提问

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

文档

插件安装: 在运行设置或刷新命令之前,如果此技能位于 HyperFrames 插件内部,请遵循 插件执行规则。独立安装则保留下面的更新说明。

HyperFrames 动画

所有动效知识汇集于一个技能:规则(原子配方)、蓝图(多阶段场景模板)、过渡(场景到场景)、技巧(更广泛的动效设计模式)以及适配器(各运行时 API)。

关于合成契约(数据属性、子合成、确定性的详细说明)请参阅 hyperframes-core。

默认方式:组合原子规则

从 rules-index.md 中挑选 2-4 条规则,将它们用一条暂停的 GSAP 时间线串联起来即可。这比从蓝图开始更快,生成的代码也更少。

何时加载蓝图

  • 当场景匹配已有的预设计多阶段模板(品牌展示、社交证明等),且复用其阶段流程可以节省大量创作时间。
  • 当你需要针对复杂的 4-5 阶段编排获得可运行的真实基准代码时。

蓝图位于 blueprints-index.md。每个条目指向 blueprints/<id>.md(配方)。不要凭空读取;只有在确定需要场景级编排时才应加载它。

路由表

目标读取内容
按触发器/标签挑选原子动画模式rules-index.md
阅读某个规则的完整 HTML / CSS / GSAP 配方rules/<name>.md
挑选多阶段场景模板blueprints-index.md
阅读某个蓝图的完整配方blueprints/<id>.md
编写场景过渡(CSS 驱动,在两个片段之间)transitions/overview.md, transitions/catalog.md
查阅更广泛的动效设计技巧techniques.md
运动模糊——元素上的快门拖影效果,以及何时不应使用references/motion-blur.md
分析现有合成的动画映射scripts/animation-map.mjs
GSAP API —— 时间线 / 补间 / 位置参数adapters/gsap.md
GSAP —— 即用型效果配方rules/gsap-effects.md
GSAP —— 变换 / 性能adapters/gsap-transforms-and-perf.md
GSAP —— 缓动 / 交错adapters/gsap-easing-and-stagger.md
GSAP —— 时间线 / 标签adapters/gsap-timeline-and-labels.md
Lottie / dotLottie(After Effects 导出,window.__hfLottie)adapters/lottie.md
角色动画(行走循环、吉祥物、关节木偶、手势)adapters/lottie.md → Characters
Three.js / WebGL(3D 场景,AnimationMixer,hf-seek)adapters/three.md
Anime.js(window.__hfAnime)adapters/animejs.md
CSS 关键帧(animation-delay / play-state / fill-mode)adapters/css-animations.md
Web 动画 API(element.animate(),currentTime 寻址)adapters/waapi.md
TypeGPU / WebGPU(navigator.gpu,WGSL,计算管线)adapters/typegpu.md
HTML 纹理 + WebGL/GLSL 后期特效(通过 drawElementImage 捕获实时 DOM)adapters/html-in-canvas-patterns.md
命名字本动画效果(24 个 ID,通过外部 animate-text 技能实现)adapters/animate-text.md

运行时选择指南

  • GSAP 是 95% 动效工作的默认选择——涵盖时间线编排、变换、缓动、交错。本技能中的所有原子规则均基于 GSAP。
  • Lottie 用于资源自带预烘焙时间线的情况(通常是 After Effects 导出),包括行走、做手势或反应的角色。
  • Three.js 用于 3D 场景、相机运动、着色器驱动的视觉效果。
  • Anime.js 用于轻量级补间动画,当 GSAP 显得过度时使用。
  • CSS 用于简单的重复图案、装饰、闪烁效果——无需 JavaScript 动画开销。
  • WAAPI 用于无需 GSAP 依赖的原生浏览器关键帧。
  • TypeGPU / WebGPU 用于 GPU 渲染的画布(粒子、液态玻璃、自定义着色器)。

多个运行时可以共存于一个合成中。每个运行时将其实例注册到特定于该运行时的全局变量上,以便 HyperFrames 可以通过单次寻道同时控制所有实例。

关键约束

前置条件:hyperframes-core → 一条暂停的时间线 + 不可协商的规则(单条暂停时间线,data-duration 控制长度,不能使用 Math.random / Date.now / performance.now,不能在没有有限根 data-duration 的情况下使用 repeat: -1,不能对后场景片段使用页面加载时的 gsap.set,不能使用 display 或原始 visibility 补间,并且必须在时间线完全构建后才注册它,包括在构建运行于异步回调(如 document.fonts.ready)内部时)。GSAP 的 autoAlpha 以及在明确的时间线边界处设置的零时长可见性仍被核心允许。仅可对非片段元素或片段包装器使用这些例外;框架拥有 .clip 的生命周期。此处不再重述完整契约。

在核心契约基础上增加的动画创作约束:

  • 预先计算的布局常量 —— 切勿在补间时刻从 getBoundingClientRect() 推导位置。补间时的 DOM 测量会导致反序列化,因为渲染器会并行采样;在合成设置时一次性计算坐标并重复使用。
  • 空间运动仅使用 GSAP 变换属性别名(x、y、scale、rotation)。核心的允许列表也允许 opacity / color / backgroundColor / borderRadius 用于非空间属性的补间——但绝不允许使用 width / height / top / left 来实现布局变化。

脚本

node <SKILL_DIR>/scripts/animation-map.mjs <composition-dir> \
  --out <composition-dir>/.hyperframes/anim-map

读取注册在 window.__timelines 上的所有 GSAP 时间线,枚举补间,采样边界框,计算标志,输出 animation-map.json。用于在创作后审计编排(空白区域、交错一致性、生命周期警告)。

animation-map.mjs 首先从当前项目解析辅助包,然后可以引导捆绑的 HyperFrames 包版本。仅在技能在捆绑的 CLI/技能安装之外运行,并且你需要显式固定引导版本时,设置 HYPERFRAMES_SKILL_PKG_VERSION=<version>。

参见

  • hyperframes-core —— 合成结构、数据属性、子合成、确定性渲染契约
  • hyperframes-creative —— 调色板、排版、叙述、节拍规划(非动画创意方向)
  • hyperframes-cli —— npx hyperframes lint / check / snapshot / preview / render

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

courtneymgabrus-star/Video

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet `anchor` rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

courtneymgabrus-star/Video

Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a website (/product-launch-video — promo or tour). Unclear → /hyperframes.

courtneymgabrus-star/Video

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link or asks to bring a Figma design, frame, logo, brand, or animation into a video/composition.

courtneymgabrus-star/Video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

相关技能