Get started
Utilities

Utilities

Utilities are a set of helper functions designed to simplify common tasks when creating animations. They provide a low-level API that can be used to build custom animations or to extend the functionality of the existing presets. Our library currently features four powerful utilities:

Summary

  • Motion: The createMotion() utility is the core of our library. It provides a flexible API for creating custom motion effects. This utility is used in all presets, but can also be used directly to create custom animations.

  • Easing: The Ease utility provides a collection of easing functions that can be used to control the rate of change of an animation. These functions can be used to create more natural and dynamic animations by varying the speed over the duration of the animation.

  • Mouse Position: The mousePosition() utility provides a simple way to interact with the mouse position. It provides normalized positions (between 0 and 1) for the client (window), page, and screen. This can be useful for creating interactive animations that respond to the user's mouse movements.

  • Physics-Based Motion: The physicsBasedMotion() utility provides a way to create animations that simulate the motion of physical objects. It uses parameters such as speed, damping, and response to create realistic motion effects.

Each utility is designed to be easy to use and flexible, allowing you to create complex animations with minimal effort.