gsap-canvas
Installation
SKILL.md
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
onUpdatecallback to the timeline that reads the current object values and draws them to canvas using the Canvas 2D API.