Communitygithub.com

HyperFrames 动画技能

HyperFrames 动画技能 — 包含所有动画预设以及 GSAP、Lottie、Three.js、Anime.js、CSS、WAAPI 和 TypeGPU 运行时适配器。

HyperFrames 动画技能 是什么?

HyperFrames 动画技能为 AI 代理提供了一套全面的动画工具包,支持多种运行时适配器,包括 GSAP、Lottie、Three.js、Anime.js、WAAPI 和 TypeGPU。该技能内置 15 种动画预设(如渐入、滑入、缩放、打字机效果等),可通过 `data-hf-animate` 属性快速应用于 HTML 元素。它引入了 `hf` 时间线 API,允许开发者使用 `hf.at()` 和 `hf.onFrame()` 等方法来编排基于时间轴的动画序列。该技能适用于 Claude Code、Cursor 等 AI 代理平台,通过简单的 HTML 属性和脚本标签即可在网页中实现复杂动画,极大简化了动画开发流程。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/christiansalazar-wk/ai-lore/tree/HEAD/skills/hyperframes-animation

在你喜欢的 AI 中提问

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

文档

HyperFrames 动画

内置预设(data-hf-animate)

预设描述
fade-in不透明度 0 → 1
fade-out不透明度 1 → 0
fade渐入 + 渐出
slide-up从下方平移,渐入
slide-down从上方平移,渐入
slide-left从右侧进入,渐入
slide-right从左侧进入,渐入
zoom-in缩放 0.8 → 1,渐入
zoom-out缩放 1 → 1.2,渐出
pop快速弹性缩放
shake水平抖动
typewriter逐字显示文本
wipe-right从左到右的裁剪揭示
wipe-left从右到左的裁剪揭示
blur-in模糊 20px → 0
blur-out模糊 0 → 20px
<div data-hf-clip data-hf-animate="fade-in"
     data-hf-animate-duration="0.6s"
     data-hf-animate-ease="ease-out">
  内容
</div>

GSAP 适配器

<script data-hf-runtime="gsap" src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
<script data-hf-timeline>
  hf.at("0s", () => gsap.from("#hero h1", { y: 60, opacity: 0, duration: 0.8 }));
</script>

Lottie 适配器

<div data-hf-clip data-hf-start="1s" data-hf-duration="auto"
     data-hf-lottie="assets/confetti.json"
     data-hf-lottie-loop="false">
</div>

Three.js 适配器

<canvas id="scene3d" data-hf-clip data-hf-runtime="threejs" data-hf-start="0s" data-hf-duration="6s"></canvas>
<script data-hf-runtime="threejs" data-hf-target="#scene3d">
  const scene = new THREE.Scene();
  hf.onFrame((t) => { mesh.rotation.y = t * 0.5; });
</script>

Anime.js 适配器

<script data-hf-runtime="animejs"></script>
<script data-hf-timeline>
  hf.at("0.5s", () => anime({ targets: "#logo", scale: [0, 1], duration: 600, easing: "spring(1,80,10,0)" }));
</script>

WAAPI 适配器

<script data-hf-timeline>
  hf.at("1s", () => {
    document.querySelector("#badge").animate(
      [{ opacity: 0, transform: "scale(0.5)" }, { opacity: 1, transform: "scale(1)" }],
      { duration: 500, fill: "forwards" }
    );
  });
</script>

TypeGPU 适配器

<canvas id="gpu-canvas" data-hf-clip data-hf-runtime="typegpu" data-hf-start="0s" data-hf-duration="8s"></canvas>
<script data-hf-runtime="typegpu" data-hf-target="#gpu-canvas">
  hf.onFrame((t) => { /* WebGPU 渲染循环 */ });
</script>

hf 时间线 API

方法描述
hf.at(time, fn)在绝对场景时间运行 fn
hf.onFrame(fn)每帧运行;fn 接收秒数
hf.clock当前渲染时间(秒)
hf.scene当前场景 ID
hf.fps配置的帧率

Individual skills in this repo

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

相关技能