Communitygithub.com

BintzGavin/helios-skills

使用 GSAP (GreenSock) 與 Helios 整合的模式。在用於精確拉動、暫停與影格渲染時,將 GSAP 時間線與 Helios 時間線結合。

helios-skills 是什麼?

這個技能提供將 GSAP (GreenSock) 動畫整合到 Helios 時間線中的模式與實作指南。它解決了同時控制兩個獨立動畫系統的核心問題,透過強制 GSAP 時間線暫停,並依賴 Helios 的「訂閱」機制來驅動每一影格的更新。技能中的「暫停時間線模式」展示了核心步驟:建立一個標記為 `paused: true` 的 GSAP 時間線、訂閱 Helios 的狀態變化、將 Helios 的影格計數轉換為秒數,最後使用 `tl.seek(seconds)` 來同步 GSAP 到正確的時間點。這種方法確保了動畫可以進行精確的拉動、暫停,以及逐影格渲染;支援 `@helios-project/core` 與 GSAP 的搭配使用。技能中也特別強調了必須避免的常見錯誤,例如不要讓 GSAP 自動播放、避免使用 `tl.progress()` 以及不要自行建立 `requestAnimationFrame` 迴圈。遵循此模式,開發者可以在 Helios 生態系統中完全精確地控制 GSAP 動畫。

相容平台~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.

相關技能