Communitygithub.com

BintzGavin/helios-skills

用于将 GSAP(GreenSock)与 Helios 集成的模式。在需要将 GSAP 时间线与 Helios 时间线结合以实现精确擦除和渲染时使用。

helios-skills 是什么?

此技能提供了在 Helios 框架内集成 GSAP(GreenSock)动画库的明确模式。核心挑战在于控制权冲突:GSAP 默认自动播放,而 Helios 需要逐帧精确控制。解决方案是使用“暂停时间线”模式——创建时设置 `paused: true`,然后通过 Helios 订阅函数将帧状态转换为秒数,并驱动 GSAP 的 `tl.seek(seconds)` 方法。这确保了 GSAP 动画可以完美同步到 Helios 的时间线,支持精确擦除、暂停和逐帧渲染。技能明确禁止使用 `requestAnimationFrame` 或 `tl.progress()`,推荐直接使用 `tl.seek()`。支持平台包括基于 Helios 构建的任何 Web 应用,适用于需要像素级动画控制的场景,如交互式演示、视频合成和数据可视化。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/BintzGavin/helios-skills/tree/HEAD/skills/examples/gsap

在你喜欢的 AI 中提问

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

文档

GSAP 集成模式

要结合 GSAP 与 Helios 使用,必须使用 Helios 帧状态驱动 GSAP 时间线实例。这样可以让 GSAP 动画被擦除、暂停和逐帧渲染。

快速开始

“暂停时间线”模式

  1. 创建 paused: true 的 GSAP 时间线。
  2. 订阅 Helios 更新。
  3. 在订阅函数中,将 Helios 帧转换为秒。
  4. 调用 timeline.seek(seconds) 进行同步。
<script type="module">
  import { Helios } from '@helios-project/core';
  import { gsap } from 'gsap';

  // 1. 初始化 Helios
  const helios = new Helios({
    fps: 30,
    durationInSeconds: 5,
  });

  // 2. 设置 GSAP 时间线(必须 PAUSED)
  const tl = gsap.timeline({ paused: true });

  // 3. 定义动画
  tl.to(".box", {
    rotation: 360,
    x: 100,
    duration: 2,
    ease: "power1.inOut"
  })
  .to(".box", {
    scale: 2,
    duration: 2
  });

  // 4. 订阅并同步
  helios.subscribe((state) => {
    // 将帧计数转换为秒
    const timeInSeconds = state.currentFrame / helios.fps;

    // 将 GSAP 移动到精确时间点
    tl.seek(timeInSeconds);
  });

  // 5. 绑定预览
  helios.bindToDocumentTimeline();
  window.helios = helios;
</script>

关键规则

  1. 始终暂停: GSAP 时间线必须使用 { paused: true } 初始化。如果它自动播放,会与 Helios 争夺控制权。
  2. 使用 Seek: 除非你计算了归一化的 0-1 值,否则不要使用 tl.progress()。由于 Helios 知道 FPS 和帧数,tl.seek(seconds) 通常更直接。
  3. 不要使用 requestAnimationFrame: 不要为 GSAP 创建自己的 rAF 循环。让 Helios 通过 subscribe 驱动更新。

源文件

  • 示例:examples/gsap-animation/

Individual skills in this repo

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

BintzGavin/helios-skills

Make a video, MP4, GIF, animation, music video, short film, explainer, chart animation, product demo, logo reveal or social clip from code. Write one HTML page that draws any frame from its time t, render it frame-exact to MP4 with Helios, check stills and contact sheets, and add a soundtrack. Use whenever the user asks for a video or an animation file.

BintzGavin/helios-skills

>- Story-first motion design philosophy for animated video: motion must earn its place; arc (establish, complicate, resolve); show vs tell; shots as units of thought; quiet vs loud motion; Disney principles with restraint; timing heuristics; composition; grammar by medium (product demos, logos, data viz, explainers); technical commitments (deterministic time, scrubbability, refs); cutting discipline; explicit anti-patterns. Use when planning, storyboarding, critiquing, or implementing programmatic or motion-driven video (Helios, Remotion, explainers, loops, UI capture, logo reveals), or when the user asks for motion direction, pacing, or visual-story structure.

BintzGavin/helios-skills

>- End-to-end production plan template for feeling-first cinematic product promos: brief interrogation, 45s beat structure (cold open through brand), hero-element metaphor, storyboard fidelity ladder, visual system (palette, type, camera, texture), motion mix and easing vocabulary, audio and captions, tooling (animatic through HTML or AE), deliverables matrix, accessibility, review milestones, and compromises to accept or refuse. Use when planning, pitching, storyboarding, or producing polished brand films for any SaaS or consumer product—not category-specific; pair with skills/design/animated-video-philosophy for broader motion principles.

BintzGavin/helios-skills

Patterns for using Helios with Framer Motion. Use when you want to use Framer Motion's physics and transitions but need frame-perfect synchronization with Helios.

BintzGavin/helios-skills

End-to-end guided workflow for creating an explainer or walkthrough video. Extracts brand identity from the repo, generates a measured soundtrack, and produces a narrative-driven motion.dev composition rendered via Helios CLI. Use when making how-it-works, feature walkthrough, or educational videos.

BintzGavin/helios-skills

Motion design framework for programmatic video. Defines anti-slideshow architecture, visual layering, physics-based easing, choreography rules, and quality validation. Reference this skill from any guided video skill.

BintzGavin/helios-skills

End-to-end guided workflow for creating a promotional hype video. Extracts brand identity from the repo, generates beat-synced music, and produces a high-energy motion.dev composition rendered via Helios CLI. Use when making brand-aligned promo or hype videos.

BintzGavin/helios-skills

End-to-end guided workflow for creating a social proof or testimonial video. Extracts brand identity from the repo, generates a warm soundtrack, and produces a trust-building motion.dev composition rendered via Helios CLI. Use when making customer testimonial, review highlight, or social proof videos.

BintzGavin/helios-skills

Workflow for rendering a Helios composition to a video file. Use when you need to automate video production or export a high-quality animation.

相关技能