iotron/gsap-cookbook/gsap-canvas
Claude Code and agent skill by iotron/gsap-cookbook
- community
Checking that the SKILL.md file is still in the repository.
Production recipes for GSAP animations rendered to HTML5 Canvas. Companion to official gsap-core and gsap-timeline skills (API reference). Triggers: canvas animation, GSAP canvas, particle system, canvas particles, canvas rendering, onUpdate canvas, draw loop, sprite animation, canvas timeline, canvas GSAP, canvas morph, MorphSVG canvas, shape morphing canvas. Non-triggers: Not for DOM-based animation (use gsap-animate), not for SVG DOM morphing (use gsap-svg), not for WebGL/Three.js. Outcome: Produces canvas-based animations using GSAP timelines with custom onUpdate rendering pipelines, particle systems, and resize handling.
Install
npx vskill@latest install iotron/gsap-cookbook/gsap-canvasSKILL.md
The same SKILL.md was published earlier as iotron/gsap-cookbook/gsap-canvas.
GSAP Canvas — Rendering Patterns
Flow: gsap-setup → gsap-canvas → gsap-optimise → gsap-test
Companion: For GSAP core API reference, invoke gsap-core. For timeline sequencing, invoke gsap-timeline. This skill covers canvas rendering recipes only. Requires:greensock/gsap-skills
1. The Pattern
Canvas animation with GSAP is fundamentally different from DOM animation. GSAP never touches a DOM element directly. Instead:
- Create plain JS objects with numeric properties (x, y, scale, rotation, alpha).
- Animate those objects with a GSAP timeline or tween — GSAP interpolates the numbers.
- Attach an `onUpdate` callback to the timeline that reads the current object values and draws them to canvas using the Canvas 2D API.
This means GSAP handles easing, stagger, repeat, yoyo, and timeline sequencing — while you own the rendering pipeline entirely.
2. Particle System Recipe
Animate an array of particles with sprite images orbiting inward. GSAP handles all motion; onUpdate redraws every frame.
Setup particle array
Build the timeline
The draw function
3. Controls & Resize
Play/pause toggle via timeScale
Resize handler with invalidate
invalidate() forces GSAP to re-evaluate function-based values (the trig calculations) using updated dimensions.
4. Performance Tips
| Tip | Why | |
|---|---|---|
Use gsap.ticker.add(fn) for render loops | Syncs with GSAP's internal rAF — one frame budget, no double-paints | |
| Minimize state changes | Batch translate/rotate calls; call resetTransform() once per particle | |
| Sort sparingly | particles.sort() every frame is O(n log n) — skip if z-order is fixed | |
Use will-change: transform on the <canvas> | Promotes to GPU layer, reduces compositing cost | |
Prefer ctx.resetTransform() over save/restore | Faster — avoids stack push/pop overhead | |
| Pre-render to offscreen canvas | For static sprites, draw once to OffscreenCanvas, then drawImage from it |
References
references/canvas-patterns.md— Full implementations: particle orbit system, canvas morphs (MorphSVG rendered to canvas)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/gsap-canvas/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 31 Oct 2026, 27 days ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/iotron/gsap-cookbook/gsap-canvas)