Communitygithub.com

christiansalazar-wk/ai-lore

HyperFrames 動畫技能 — 包含所有動畫預設以及 GSAP、Lottie、Three.js、Anime.js、CSS、WAAPI 和 TypeGPU 執行時期適配器。

ai-lore 是什麼?

此技能提供了 HyperFrames 動畫系統的完整功能,讓開發者能透過簡單的 HTML 屬性(data-hf-animate)即可套用 15 種以上的內建動畫預設,例如淡入、滑入、縮放、打字機效果等,無需撰寫任何 JavaScript。除此之外,它也支援多種主流動畫引擎的執行時期適配器(Runtime Adapter),包括 GSAP、Lottie、Three.js、Anime.js、WAAPI 以及 TypeGPU(WebGPU),讓開發者可以在同一個專案中靈活切換或混合使用不同的動畫技術。其核心 Timeline API(hf.at、hf.onFrame 等)更提供了時間軸控制與幀回呼機制,適用於 Cursor、Claude Code 等 AI 輔助開發工具,能有效加速動畫場景的建立與迭代。

相容平台~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
fadefade-in + fade-out
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設定的 FPS

Individual skills in this repo

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

相關技能