What problem does it solve?
This Skill documents and explains GSAP's utility helpers to remove repetitive math and DOM handling when building animations, making it easy to map, normalize, snap, randomize, and transform values reliably.
Core Features & Use Cases
- Range mapping & normalization: mapRange and normalize convert values between domains for scroll-driven or progress-based animations.
- Clamping, wrapping, and snapping: clamp, wrap, wrapYoyo, and snap constrain or cycle values for loops, grids, and step-based animations.
- Randomization and distribution: random, shuffle, and distribute produce varied values and staggered assignments for lively motion.
- Collection and parsing helpers: toArray, selector, getUnit, unitize, splitColor, pipe, and interpolate assist with DOM targeting, unit handling, color interpolation, and composing transforms.
- Use Case: Convert scroll progress to a rotation value, clamp it to safe bounds, snap to a grid, and distribute different offsets across targets for a staggered effect.
Quick Start
Use gsap.utils.mapRange to convert scroll progress from 0–1 to 0–360 degrees, then apply gsap.utils.clamp and gsap.utils.snap before assigning the values to your tween.