gsap-utils

Applies GSAP utility functions for clamping, mapping, snapping, and transforming animation values.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/TOBIASpuchito/Citec --skill gsap-utils-tobiaspuchito
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gsap-utils
Source: https://github.com/TOBIASpuchito/Citec/tree/main/citec-frontend/.claude/skills/gsap-utils
Command: npx skills add https://github.com/TOBIASpuchito/Citec --skill gsap-utils-tobiaspuchito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap.

What problem does it solve? Writing animation logic often requires repetitive math for clamping values, mapping ranges, snapping to grids, and normalizing inputs. This Skill provides correct usage patterns for the gsap.utils API so these transformations are applied properly in tweens, ScrollTrigger callbacks, and event handlers. ## Core Features & Use Cases - Range and Math Utilities: Covers clamp, mapRange, normalize, interpolate, wrap, and wrapYoyo for converting scroll progress, pointer positions, and inputs into animation values. - Randomization and Snapping: Explains random (including the reusable function form via the true argument), snap for grid-aligned values, shuffle, and distribute for position-based stagger values. - Collections and Parsing: Documents selector for scoped component queries, toArray for converting NodeLists, pipe for composing transforms, and getUnit, unitize, and splitColor for value parsing. - Use Case: When building a scroll-driven animation, use mapRange to convert scroll progress to degrees, snap to lock values to a grid, and distribute to spread scale values across a grid of elements from the center. ## Quick Start Ask the AI to show how to use gsap.utils.mapRange and clamp to convert scroll progress into a rotation value for a tween.

Frequently Asked Questions about gsap-utils

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use gsap.utils.mapRange in GSAP?▼

Call gsap.utils.mapRange(inMin, inMax, outMin, outMax, value) to convert a value from one range to another, such as mapping scroll progress 0-1 to 0-360 degrees. Omit the value argument to get a reusable function for repeated conversions.

How to get a reusable function from GSAP utility methods?▼

Omit the final value argument for most utilities like clamp, mapRange, snap, and wrap to receive a function that accepts the value later. The exception is random, which requires passing true as the last argument to return a reusable function.

Does gsap.utils.random support snapping to increments?▼

Yes, gsap.utils.random(min, max, snapIncrement) snaps the random result to the nearest multiple of the increment, such as random(0, 500, 5) for multiples of 5. It also accepts an array to pick a random element.

Can I use gsap.utils selector with React refs?▼

Yes, gsap.utils.selector accepts a DOM element or a React ref and handles .current automatically. It returns a scoped selector function so queries like '.box' only match descendants of that component container.

What is the difference between gsap.utils wrap and wrapYoyo?▼

wrap cycles a value back to the start of the range when it exceeds the bounds, useful for infinite loops. wrapYoyo bounces the value back in the opposite direction at the range edges, creating a back-and-forth effect.

When should I not use gsap.utils mapRange?▼

Avoid mapRange and normalize when values carry CSS units, since they operate only on plain numbers. Use getUnit and unitize to strip and reattach units when unit-aware conversion is required.