Quick Start
Create a simple animation in just a few lines:Creating Timelines
Basic Timeline
Timeline Control
Adding Animations
Animating Properties
Animate any numeric properties on JavaScript objects:Multiple Targets
Animate multiple objects together:Easing Functions
Control animation curves with easing functions:- Linear
- Quad
- Expo
- Elastic & Bounce
- Circular
- Back
linear- Constant speedinQuad,outQuad,inOutQuad- QuadraticinExpo,outExpo- ExponentialinOutSine- SinusoidaloutBounce,inBounce- BouncingoutElastic- Elastic springinCirc,outCirc,inOutCirc- CircularinBack,outBack,inOutBack- Overshoot
Looping Animations
Basic Looping
Alternating Loops
Reverse direction on each loop:Loop Delay
Add delay between loops:Timeline Callbacks
Animation Callbacks
Timeline-wide Callbacks
Function Calls
Execute functions at specific times:Sequencing Animations
Sequential Animations
Run animations one after another:Overlapping Animations
Nested Timelines
Sync multiple timelines together:Dynamic Animations
One-Time Animations
Add animations that run once and are removed:Updating Timeline
Update timeline manually (useful withoutrenderer.start()):
Complete Examples
Animated Box
Color Fade
Progress Bar
Alternating Movement
Integration with Renderer
Timelines automatically integrate with the renderer’s frame loop:Performance Tips
Round Animated Values
Round Animated Values
Always round values when applying to renderables:
Limit Simultaneous Animations
Limit Simultaneous Animations
Too many animations can affect performance:
Use Appropriate Easing
Use Appropriate Easing
Complex easing functions (elastic, bounce) are more expensive:
Next Steps
3D Rendering
Render 3D graphics with WebGPU
Syntax Highlighting
Add tree-sitter syntax highlighting