Timelines allow you to sequence multiple animations with precise timing control. They provide a powerful way to create complex animation choreography.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juliangarnier/anime/llms.txt
Use this file to discover all available pages before exploring further.
Creating Timelines
Create a timeline using thecreateTimeline() function:
Adding Animations
Basic Addition
Use the.add() method to add animations to a timeline:
Positioning Animations
Control when animations start using position parameters:Absolute positioning:
0- Timeline start1000- 1000ms from start
'+=500'- 500ms after previous animation ends'-=200'- 200ms before previous animation ends'<'- Same time as previous animation'>'- When previous animation ends
'myLabel'- At a defined label'myLabel+=500'- 500ms after a label
Timeline Parameters
Default animation parameters applied to all children.
Easing applied to the entire timeline playback.
Enable composition for timeline animations.
Labels
Create named points in your timeline:label(name, position)
Adds a label at the specified position:Set Method
Instantly set properties without animation:The
set() method has zero duration and uses replace composition.Seamless Looping Example
Create perfect seamless loops with precise timing:Synchronizing External Animations
Sync Web Animations API or other animation instances:sync(animation, position)
Synchronizes an external animation with the timeline:Callbacks
Add callback functions at specific timeline points:call(callback, position)
Executes a callback at the specified position:Timeline Control Methods
All standard animation methods work on timelines:Refresh Method
Refresh function-based values in the timeline:Stretch Method
Scale the timeline duration:Remove Method
Remove specific animations from the timeline:Nested Timelines
Timelines can contain other timelines:Complex Choreography Example
API Reference
createTimeline(parameters)
Creates a new timeline instance. Parameters:parameters(Object) - Timeline configurationdefaults(Object) - Default animation parametersplaybackEase(string | function) - Timeline playback easingcomposition(boolean) - Enable compositionloop(number | boolean) - Loop count- All standard timer parameters
Timeline - Timeline instance