What problem does it solve?
This Skill provides a collection of utility functions for GSAP animations, addressing common needs such as clamping, mapping ranges, normalizing values, and more.
Core Features & Use Cases
- Clamping Values: Constrains a value between specified min and max values.
- Mapping Ranges: Converts a value from one range to another.
- Normalizing Values: Returns a value normalized to a 0-1 range.
- Interpolating Values: Interpolates between two values at a given progress.
- Randomization: Generates random numbers or picks random elements from an array.
- Snap to Values: Snaps a value to the nearest multiple or to an array of allowed values.
- Array Manipulation: Converts values to arrays and composes functions for value transformations.
- Use Case: Enhance your GSAP animations by using these utilities to handle edge cases, simplify code, and add dynamic behavior.
Quick Start
Use the gsap-utils skill to clamp a value between 0 and 100 and get a function to apply to other values: 'gsap.utils.clamp(0, 100)(150)'.