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.
Instance Methods
revert()
Reverts all animations and removes all animatable properties from the instance. This method:- Stops all active animations
- Removes all property methods
- Clears the animations object
- Reverts the internal callbacks animation
- Returns the instance to its initial state
this - The Animatable instance for method chaining.
Factory Function
createAnimatable()
Factory function to create an Animatable instance. This is a convenience wrapper around the Animatable constructor.Target element(s) to make animatable. Can be:
- CSS selector string (e.g.,
'.element') - DOM element
- Array of elements
- JavaScript object
Configuration object defining animatable properties.
AnimatableObject - An Animatable instance with dynamic property methods.
Example
Dynamic Property Methods
Each property defined in the parameters becomes a method on the Animatable instance with dual functionality:Property Getter
Call the property method without arguments to get the current value:number | Array<number> - Current animated value(s).
Property Setter
Call the property method with arguments to animate to a new value:Target value to animate to. Can be:
- Single number for simple properties
- Array of numbers for complex properties (e.g., transforms with multiple values)
Animation duration in milliseconds. If omitted, uses the default duration from property configuration.
Easing function for the animation. Can be:
- String name (e.g.,
'inOutQuad','outElastic') - Custom easing function
- Spring configuration
AnimatableObject - The Animatable instance for method chaining.