BintzGavin/helios / skills/examples/gsap
example-gsap
VerifiedPatterns for using Helios with GSAP (GreenSock). Use when integrating GSAP timelines with the Helios timeline for precise scrubbing and rendering.
GSAP Integration Patterns
To use GSAP with Helios, you must drive the GSAP Timeline instance using the Helios frame state. This allows GSAP animations to be scrubbed, paused, and rendered frame-by-frame.
Quick Start
The "Paused Timeline" Pattern
- Create a GSAP Timeline with
paused: true. - Subscribe to Helios updates.
- Inside the subscription, convert the Helios frame to seconds.
- Call
timeline.seek(seconds)to synchronize.
<script type="module">
import { Helios } from '@helios-project/core';
import { gsap } from 'gsap';
// 1. Initialize Helios
const helios = new Helios({
fps: 30,
durationInSeconds: 5,
});
// 2. Setup GSAP Timeline (PAUSED is critical)
const tl = gsap.timeline({ paused: true });
// 3. Define animations
tl.to(".box", {
rotation: 360,
x: 100,
duration: 2,
ease: "power1.inOut"
})
.to(".box", {
scale: 2,
duration: 2
});
// 4. Subscribe and Sync
helios.subscribe((state) => {
// Convert frame count to seconds
const timeInSeconds = state.currentFrame / helios.fps;
// Seek GSAP to exact time
tl.seek(timeInSeconds);
});
// 5. Bind for Preview
helios.bindToDocumentTimeline();
window.helios = helios;
</script>
Critical Rules
- Always Pause: The GSAP timeline must be initialized with
{ paused: true }. If it plays automatically, it will fight with Helios for control. - Use Seek: Do not use
tl.progress()unless you calculate the normalized 0-1 value.tl.seek(seconds)is usually more direct since Helios knows FPS and Frame Count. - No
requestAnimationFrame: Do not create your own rAF loop for GSAP. Let Helios drive the updates viasubscribe.
Source Files
- Example:
examples/gsap-animation/
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |