Optional
props: StaticProps & MutablePropsProtected
_callbacksCallbacks instance
Protected
_destroyableStores actions that need to be executed when the module is destroyed
Protected
_easedCurrent eased progress of the timeline (after applying easing function).
Protected
_isTracks whether the module has been destroyed
Protected
_isIndicates whether the timeline is paused.
Protected
_isIndicates whether the timeline is currently reversed.
Protected
_progressCurrent linear progress of the timeline (0 to 1).
Protected
_propsCurrent properties
Protected
Optional
_rafStores the ID of the current animation frame request.
Protected
_timeStores the timestamp of the last frame update.
Retrieves the module's callbacks instance.
Get the timeline duration, ensuring it is at least 0 ms.
Get the eased progress of the timeline, derived from the easing function.
Checks if the module has been destroyed.
Whether the timeline is paused.
Whether the timeline is currently playing.
Whether the timeline is reversed (progress decreases over time).
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Get or set the linear progress of the timeline. Setting this triggers an update and associated callbacks.
Current properties. Do not mutate these directly, use updateProps
instead.
Protected
_addAdds a class name on an element, and keeps track of it for removal when the module is destroyed.
The target DOM element.
The class name to toggle.
Protected
_animateAnimate the timeline, updating progress based on elapsed time.
Protected
_cnHelper function to generate classnames with the module's prefix.
The class names to generate.
A string of class names with the module's prefix applied.
Protected
_destroyDestroy the timeline, stopping any active animation and cleaning up resources.
Get default mutable properties.
Get default static properties.
Protected
_handleMethod that is called when the module's properties mutate. In most cases, used to handle callbacks.
Protected
_onHandle progress updates and trigger callbacks.
Destroys the module, cleaning up resources, callbacks, and event listeners.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Adds a callback on the module's destruction.
The function to execute during destruction.
Pause the timeline, halting progress without resetting it.
Play the timeline, advancing progress toward completion. Does nothing if the timeline is destroyed or already completed.
Reset the timeline to the beginning (progress = 0).
Reverse the timeline, moving progress toward the start. Does nothing if the timeline is destroyed or already at the start.
A timeline class for managing animations with easing and precise progress control. It provides methods for playing, reversing, pausing, and resetting the timeline.
Documentation