Optionalprops: IRafStaticProps & IRafMutableProps & Partial<OptionalonCallbacks: Partial<Retrieves the module's callbacks instance.
Duration of the last frame in ms
Real-time FPS
Scaling coefficient based on a 60 FPS target
Current frame index
Checks if the module has been destroyed.
Playback state of the animation frame
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Current properties. Do not mutate these directly, use updateProps instead.
Timestamp of the current frame
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_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 animation frame and stop the loop
Get default mutable properties
Enables or disables the Raf animation loop.
Frames per second (FPS) for the animation. Set to 'auto' for dynamic adjustment.
The number of frames after which the FPS is recalculated. This value determines how often the FPS calculation is updated based on frame counts.
Get default static properties
Protected_handleDestroys the module, cleaning up resources, callbacks, and event listeners.
Calculate linear interpolation factor to make animations run the same regardless of FPS
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 animation loop
Start the animation loop
Manages an animation frame loop with configurable FPS and playback controls.
Documentation