gsap-utils
Official GSAP skill for gsap.utils — clamp, mapRange, normalize, interpolate, random, snap, toArray, wrap, pipe. Use when the user asks about gsap.utils, clamp, mapRange, random, snap, toArray, wrap, or helper utilities in GSAP.
供给资产档案
编程与开发 Agent
代码审查、仓库分析、测试、CI、GitHub、DevOps 与开发工作流 Skill。
场景
编程 Agent
我需要一个能理解仓库、修改代码并审查 Pull Request 的编程 Agent。
适配 Agent
Claude Code + CLI + Codex
适用于 Codex、Claude Code、Cursor、CLI 或自定义 Agent。
安装
就绪
npx skills add greensock/gsap-skills --skill gsap-utils
维护状态
新鲜
今天有推送
风险
可安全尝试
Quality score needs review
GitHub 质量
14K
89/100 质量 · 84/100 信任
覆盖标签
审查说明
Quality score needs review
Agent 采用评分卡
一眼查看信任、审计与安装准备度
这些分数综合公开仓库元数据、OpenAgentSkill 审查信号、维护新鲜度与安装准备度。它用于候选筛选,不替代人工审查。
质量
优秀高置信候选,具有较强的采用度与健康维护信号。
信任
审查后安装适合加入候选清单,但 Agent 在运行前应审查审计说明、安装策略和结果证据。
审计
可安全尝试对安装准备度、安全元数据、维护情况与采用风险的机器可读审查。
OpenAgentSkill 信任评分 v5
安装前需人工审查
在人工审查或沙盒验证后作为首选候选。
Stars
14K 个 GitHub Stars
仓库活跃度
14K 个 Star,830 个 Fork
维护状态
今天有推送
许可证
MIT
安装
npx skills add greensock/gsap-skills --skill gsap-utils
安装安全性
标准软件包或运行时安装路径
权限范围
filesystem or document access, network or browser access
Agent 结果
暂未有 Agent 结果数据
文档
Usable metadata, review docs
风险摘要
低元数据风险
- Quality score needs review
安装准备度
安装路径可用
- 安装路径可用
- 仓库证据可用
- 已声明许可证
- 暂无 Agent 验证结果证据
Agent 可读元数据
这个 Skill 的机器可读决策数据。
使用此区块或内嵌 JSON 判断 Agent 是否应安装该 Skill、选择替代方案,或先请求人工审查。
适用任务
- Browser automation 工作流
- Claude Code 团队
- 重视 GitHub 采用信号的团队
- Navigate pages
适用 Agent
安装决策
- 命令
- npx skills add greensock/gsap-skills --skill gsap-utils
- 策略
- 审查
- 人工审查
- 是
信任与风险
- 信任
- 79/100
- 审计
- 88/100
- 风险级别
- 可安全尝试
结果闭环
- 端点
- /api/agent/outcome
- 事件 ID
- resolve
- 结果
- 5
不适用场景
- 需要厂商支持 SLA 的团队
- 没有内部安全审查的高合规环境
- 当前元数据中未发现重大风险信号
- Quality score needs review
- Production credentials, payments, or irreversible account changes without explicit human review
Agent 安全 v2
68/100 · 安装前审查
审计与安全信号良好,公开元数据中没有高风险权限提示。
先查看审计页面,再在沙盒工作流中允许 Agent 安装。
中
Browser automation
Skill may drive a browser or interact with web pages.
中
网络访问
Skill 可能访问远程页面、API、仓库或外部服务。
中
文件系统访问
Skill 可能读取或写入项目文件、文档、生成产物或本地工作区状态。
- Quality score needs review
安装目标
在你的 Agent 工作流中安装此 Skill
通过公开安装端点获取命令、安全清单、目标提示词和该 Skill 的规范链接。
OpenAgentSkill CLI
Resolve policy, run the source installer safely, and report a verified install receipt.
$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install greensock-gsap-utilsAgent 解析计划
让 Agent 在安装前验证匹配度。
Resolve API 返回首选 Skill、替代方案、安全策略、审计说明、安装目标和可直接执行的提示词,无需抓取此页面。
打开 JSON
/api/agent/resolve?task=Use%20gsap-utils%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve 文本
/api/agent/resolve?task=Use%20gsap-utils%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
安装交接
/api/skills/greensock-gsap-utils/install
Agent 应检查
- 从 Resolve API 检查任务匹配与替代方案。
- 检查审计评分、信任评分和安全策略警告。
- 检查 Codex、Claude Code、Cursor 或 CLI 的安装目标兼容性。
复制提示词
Task: Use gsap-utils in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20gsap-utils%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/greensock-gsap-utils/install
Install command: npx skills add greensock/gsap-skills --skill gsap-utils
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent 交接
把安装路径交给 Agent,而不是再给一个目录页。
通过公开安装端点获取命令、安全清单、目标提示词和该 Skill 的规范链接。
安装交接
/api/skills/greensock-gsap-utils/install
LLM 文本格式
/api/skills/greensock-gsap-utils/install?format=text
寻找替代方案
/api/skills/search?q=gsap-utils&limit=3
Agent 提示词
Use gsap-utils for this task. Review https://www.openagentskill.com/api/skills/greensock-gsap-utils/install, then install with: npx skills add greensock/gsap-skills --skill gsap-utilsRegistry 元数据
用于自动选择 Skill 的 Agent 可读档案。
本页通过 Registry API 提供相同的决策、信任、审计、场景和安装信号,让 Agent 无需抓取界面即可排序。
Agent 决策面板
适合 Browser automation 的首选
将其作为优先候选,再在你的 Agent 环境中验证 README 与安装路径。
栈中角色
首选
主要匹配
Browser automation
信任标签
可用于生产
安装路径
命令已就绪
适用场景
- Browser automation 工作流
- Claude Code 团队
- 重视 GitHub 采用信号的团队
证据
- 14,102 个 GitHub Stars
- 仓库近期活跃
- 已提供安装命令或 GitHub 仓库
- 89/100 质量档案
- 3 个 OpenAgentSkill 交互事件
先审查
- 当前元数据中未发现重大风险信号
实施路径
- 1在沙盒 Agent 中安装它,并端到端完成一次Browser automation任务。
- 2Compare output quality, latency, and failure behavior against at least one alternative.
- 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.
信任档案
审查后安装
适合加入候选清单,但 Agent 在运行前应审查审计说明、安装策略和结果证据。
GitHub 采用度
通过14K 个 GitHub Stars
Star/Fork 活跃度
通过14K 个 Star,830 个 Fork; 当前元数据中没有议题活跃度信息
近期维护
通过今天有推送
许可证清晰度
通过MIT
积极信号
- AI 审查已通过
- 安装路径可用
- 仓库证据可用
- 近期维护的仓库
- Large GitHub adoption signal
- 安装命令未发现明显高风险模式
- 结果闭环已就绪,但需要首次真实 Agent 运行
安装前审查
- Quality score needs review
- 暂未有真实 Agent 结果报告
- 无人值守安装前需要人工审查
建议操作
在人工审查或沙盒验证后作为首选候选。
质量档案
优秀 适用于 Agent 工作流的候选
高置信候选,具有较强的采用度与健康维护信号。
工作流匹配
在这些场景使用此 Skill
Operate web apps
Browser automation
I need my agent to control a browser, fill forms, and verify web app workflows.
Build and ship code
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Manage repositories
GitHub automation
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
工作流匹配
加入完整工作流
Operate and verify web apps
Browser QA agent
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Inspect, patch, and verify code
Coding review agent
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Turn skills into distribution
Content growth agent
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
替代方案短名单
安装前对比
可能适合该任务的相近 Skill。
UI-TARS Desktop
Run multimodal agents that operate desktop interfaces
MoneyPrinterTurbo
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
Cua
Open-source infrastructure for Computer-Use Agents. Sandboxes, SDKs, and benchmarks to train and evaluate AI agents that can control full desktops (macOS, Linux, Windows).
概览
--- name: gsap-utils description: Official GSAP skill for gsap.utils — clamp, mapRange, normalize, interpolate, random, snap, toArray, wrap, pipe. Use when the user asks about gsap.utils, clamp, mapRange, random, snap, toArray, wrap, or helper utilities in GSAP. license: MIT ---
# gsap.utils
## When to Use This Skill
Apply when writing or reviewing code that uses **gsap.utils** for math, array/collection handling, unit parsing, or value mapping in animations (e.g. mapping scroll to a value, randomizing, snapping to a grid, or normalizing inputs).
**Related skills:** Use with **gsap-core**, **gsap-timeline**, and **gsap-scrolltrigger** when building animations; CustomEase and other easing utilities are in **gsap-plugins**.
## Overview
**gsap.utils** provides pure helpers; no need to register. Use in tween vars (e.g. function-based values), in ScrollTrigger or Observer callbacks, or in any JS that drives GSAP. All are on **gsap.utils** (e.g. `gsap.utils.clamp()`).
**Omitting the value: function form.** Many utils accept the value to transform as the **last** argument. If you omit that argument, the util returns a **function** that accepts the value later. Use the function form when you need to clamp, map, normalize, or snap many values with the same config (e.g. in a mousemove handler or tween callback). **Exception: random()** — pass **true** as the last argument to get a reusable function (do not omit the value); see [random()](https://gsap.com/docs/v3/GSAP/UtilityMethods/random()).
```javascript // With value: returns the result gsap.utils.clamp(0, 100, 150); // 100
// Without value: returns a function you call with the value later let c = gsap.utils.clamp(0, 100); c(150); // 100 c(-10); // 0 ```
## Clamping and Ranges
### clamp(min, max, value?)
Constrains a value between min and max. Omit **value** to get a function: `clamp(min, max)(value)`.
```javascript gsap.utils.clamp(0, 100, 150); // 100 gsap.utils.clamp(0, 100, -10); // 0
let clampFn = gsap.utils.clamp(0, 100); clampFn(150); // 100 ```
### mapRange(inMin, inMax, outMin, outMax, value?)
Maps a value from one range to another. Use when converting scroll position, progress (0–1), or input range to an animation range. Omit **value** to get a function: `mapRange(inMin, inMax, outMin, outMax)(value)`.
```javascript gsap.utils.mapRange(0, 100, 0, 500, 50); // 250 gsap.utils.mapRange(0, 1, 0, 360, 0.5); // 180 (progress to degrees)
let mapFn = gsap.utils.mapRange(0, 100, 0, 500); mapFn(50); // 250 ```
### normalize(min, max, value?)
Returns a value normalized to 0–1 for the given range. Inverse of mapping when the target range is 0–1. Omit **value** to get a function: `normalize(min, max)(value)`.
```javascript gsap.utils.normalize(0, 100, 50); // 0.5 gsap.utils.normalize(100, 300, 200); // 0.5
let normFn = gsap.utils.normalize(0, 100); normFn(50); // 0.5 ```
### interpolate(start, end, progress?)
Interpolates between two values at a given progress (0–1). Handles numbers, colors, and objects with matching keys. Omit **progress** to get a function: `interpolate(start, end)(progress)`.
```javascript gsap.utils.interpolate(0, 100, 0.5); // 50 gsap.utils.interpolate("#ff0000", "#0000ff", 0.5); // mid color gsap.utils.interpolate({ x: 0, y: 0 }, { x: 100, y: 50 }, 0.5); // { x: 50, y: 25 }
let lerp = gsap.utils.interpolate(0, 100); lerp(0.5); // 50 ```
## Random and Snap
### random(minimum, maximum[, snapIncrement, returnFunction]) / random(array[, returnFunction])
Returns a random number in the range **minimum**–**maximum**, or a random element from an **array**. Optional **snapIncrement** snaps the result to the nearest multiple (e.g. `5` → multiples of 5). **To get a reusable function**, pass **true** as the last argument (**returnFunction**); the returned function takes no args and returns a new random value each time. This is the only util that uses `true` for the function form instead of omitting the value.
```javascript // immediate value: number in range gsap.utils.random(-100, 100); // e.g. 42.7 gsap.utils.random(0, 500, 5); // 0–500, snapped to nearest 5
// reusable function: pass true as last argument let randomFn = gsap.utils.random(-200, 500, 10, true); randomFn(); // random value in range, snapped to 10 randomFn(); // another random value
// array: pick one value at random gsap.utils.random(["red", "blue", "green"]); // "red", "blue", or "green" let randomFromArray = gsap.utils.random([0, 100, 200], true); randomFromArray(); // 0, 100, or 200 ```
**String form in tween vars:** use `"random(-100, 100)"`, `"random(-100, 100, 5)"`, or `"random([0, 100, 200])"`; GSAP evaluates it per target.
```javascript gsap.to(".box", { x: "random(-100, 100, 5)", duration: 1 }); gsap.to(".item", { backgroundColor: "random([red, blue, green])" }); ```
### snap(snapTo, value?)
Snaps a value to the nearest multiple of **snapTo**, or to the nearest value in an array of allowed values. Omit **value** to get a function: `snap(snapTo)(value)` (or `snap(snapArray)(value)`).
```javascript gsap.utils.snap(10, 23); // 20 gsap.utils.snap(0.25, 0.7); // 0.75 gsap.utils.snap([0, 100, 200], 150); // 100 or 200 (nearest in array)
let snapFn = gsap.utils.snap(10); snapFn(23); // 20 ```
Use in tweens for grid or step-based animation:
```javascript gsap.to(".x", { x: 200, snap: { x: 20 } }); ```
### shuffle(array)
Returns a new array with the same elements in random order. Use for randomizing order (e.g. stagger from "random" with a copy).
```javascript gsap.utils.shuffle([1, 2, 3, 4]); // e.g. [3, 1, 4, 2] ```
### distribute(config)
**Returns a function** that assigns a value to each target based on its position in the array (or in a grid). Used internally for advanced staggers; use it whenever you need values spread across many elements (e.g. scale, opacity, x, delay). The returned function receives `(index, target, targets)` — either call it manually or pass the result directly into a tween; GSAP will call it per target with index, element, and array.
**Config (all optional):**
| Property | Type | Description | |----------|------|-------------| | `base` | Number | Starting value. Default `0`. | | `amount` | Number | Total to distribute across all targets (added to base). E.g. `amount: 1` with 100 targets → 0.01 between each. Use **each** instead to set a fixed step per target. | | `each` | Number | Amount to add between each target (added to base). E.g. `each: 1` with 4 targets → 0, 1, 2, 3. Use **amount** instead to split a total. | | `from` | Number \| String \| Array | Where distribution starts: index, or `"start"`, `"center"`, `"edges"`, `"random"`, `"end"`, or ratios like `[0.25, 0.75]`. Default `0`. | | `grid` | String \| Array | Use grid position instead of flat index: `[rows, columns]` (e.g. `[5, 10]`) or `"auto"` to detect. Omit for flat array. | | `axis` | String | For grid: limit to one axis (`"x"` or `"y"`). | | `ease` | Ease | Distribute values along an ease curve (e.g. `"power1.inOut"`). Default `"none"`. |
**In a tween:** pass the result of `distribute(config)` as the property value; GSAP calls the function for each target with `(index, target, targets)`.
```javascript // Scale: middle elements 0.5, outer edges 3 (amount 2.5 distributed from center) gsap.to(".class", { scale: gsap.utils.distribute({ base: 0.5, amount: 2.5, from: "center" }) }); ```
**Manual use:** call the returned function with `(index, target, targets)` to get the value for that index.
```javascript const distributor = gsap.utils.distribute({ base: 50, amount: 100, from: "center", ease: "power1.inOut" }); const targets = gsap.utils.toArray(".box"); const valueForIndex2 = distributor(2, targets[2], targets); ```
See [distribute()](https://gsap.com/docs/v3/GSAP/UtilityMethods/distribute/) for more.
## Units and Parsing
### getUnit(value)
Returns the unit string of a value (e.g. `"px"`, `"%"`, `"deg"`). Use when normalizing or converting values.
```javascript gsap.utils.getUnit("100px"); // "px" gsap.utils.getUnit("50%"); // "%" gsap.utils.getUnit(42); // "" (unitless) ```
### unitize(value, unit)
Appends a unit to a number, or returns the value as-is if it already has a unit. Use when building CSS values or tween end values.
```javascript gsap.utils.unitize(100, "px"); // "100px" gsap.utils.unitize("2rem", "px"); // "2rem" (unchanged) ```
### splitColor(color, returnHSL?)
Converts a color string into an array: **[red, green, blue]** (0–255), or **[red, green, blue, alpha]** (4 elements for RGBA when alpha is present or required). Pass **true** as the second argument (**returnHSL**) to get **[hue, saturation, lightness]** or **[hue, saturation, lightness, alpha]** (HSL/HSLA) instead. Works with `"rgb()"`, `"rgba()"`, `"hsl()"`, `"hsla()"`, hex, and named colors (e.g. `"red"`). Use when animating color components or building gradients. See [splitColor()](https://gsap.com/docs/v3/GSAP/UtilityMethods/splitColor/).
```javascript gsap.utils.splitColor("red"); // [255, 0, 0] gsap.utils.splitColor("#6fb936"); // [111, 185, 54] gsap.utils.splitColor("rgba(204, 153, 51, 0.5)"); // [204, 153, 51, 0.5] (4 elements) gsap.utils.splitColor("#6fb936", true); // [94, 55, 47] (HSL: hue, saturation, lightness) ```
## Arrays and Collections
### selector(scope)
Returns a scoped selector function that finds elements only within the given element (or ref). Use in components so selectors like `".box"` match only descendants of that component, not the whole document. Accepts a DOM element or a ref (e.g. React ref; handles `.current`).
```javascript const q = gsap.utils.selector(containerRef); q(".box"); // array of .box elements inside container gsap.to(q(".circle"), { x: 100 }); ```
### toArray(value, scope?)
Converts a value to an array: selector string (scoped to element), NodeList, HTMLCollection, single element, or array. Use when passing mixed inputs to GSAP (e.g. targets) and a true array is needed.
```javascript gsap.utils.toArray(".item"); // array of elements gsap.utils.toArray(".item", container); // scoped to container gsap.utils.toArray(nodeList); // [ ... ] from NodeList ```
### pipe(...functions)
Composes functions: **pipe(f1, f2, f3)(value)** returns f3(f2(f1(value))). Use when applying a chain of transforms (e.g. normalize → mapRange → snap) in a tween or callback.
```javascript const fn = gsap.utils.pipe( (v) => gsap.utils.normalize(0, 100, v), (v) => gsap.utils.snap(0.1, v) ); fn(50); // normalized then snapped ```
### wrap(min, max, value?)
Wraps a value into the range min–max (inclusive min, exclusive max). Use for infinite scroll or cyclic values. Omit **value** to get a function: `wrap(min, max)(value)`.
```javascript gsap.utils.wrap(0, 360, 370); // 10 gsap.utils.wrap(0, 360, -10); // 350
let wrapFn = gsap.utils.wrap(0, 360); wrapFn(370); // 10 ```
### wrapYoyo(min, max, value?)
Wraps value in range with a yoyo (bounces at ends). Use for back-and-forth within a range. Omit **value** to get a function: `wrapYoyo(min, max)(value)`.
```javascript gsap.utils.wrapYoyo(0, 100, 150); // 50 (bounces back)
let wrapY = gsap.utils.wrapYoyo(0, 100); wrapY(150); // 50 ```
## Best practices
- ✅ Omit the value argument to get a reusable function when the same range/config is used many times (e.g. scroll handler, tween callback): `let mapFn = gsap.utils.mapRange(0, 1, 0, 360); mapFn(progress)`. - ✅ Use **snap** for grid-aligned or step-based values; use **toArray** when GSAP or your code needs a real array from a selector or NodeList. - ✅ Use **gsap.utils.selector(scope)** in components so selectors are scoped to a container or ref.
## Do Not
- ❌ Assume **mapRange** / **normalize** handle units; they work on numbers. Use **getUnit** / **unitize** when units matter. - ❌ Override or rely on undocumented behavior; stick to the documented API.
### Le
技术详情
- 版本
- 1.0.0
- 许可证
- MIT
- 最近更新
- 2026年8月22日
- 发布时间
- 2026年8月22日
决策摘要
首选
14,102 个 GitHub Stars
Agent 验证证据
Agent 验证证据
来自解析、审查、安装和一次小范围运行后的结果报告。
- 成功率
- —
- 近期失败
- —
- 结果
- 0
- 输出质量
- —
- 失败
- 0
- 不相关
- 0
- 安装次数
- 0
- 风险拦截
- 0
- 需要配置
- 0
- 生产环境
- 0
暂时没有 Agent 结果数据。首次 Agent 执行可以通过 /api/agent/outcome 报告成功、需要设置、风险拦截、失败或不相关。
增长闭环
分享工具包
为 gsap-utils 准备的场景化草稿,可手动发布到 X。
A practical pick for a repeatable workflow: gsap-utils: Official GSAP skill for gsap.utils — clamp, mapRange, normalize, interpolate, random, snap, toArray, wrap, pipe. Use when t... 14.1K stars https://www.openagentskill.com/skills/greensock-gsap-utils?ref=x
可选:带安装命令的回复
Listing + install path for gsap-utils: https://www.openagentskill.com/skills/greensock-gsap-utils?ref=x Install: npx skills add greensock/gsap-skills --skill gsap-utils
收录来源
Registry 收录
此列表来自公开来源,维护者认领获批前不会标记为官方。
- 创作者
- greensock
- 收录方
- OpenAgentSkill 社区索引
归属链接指向公开仓库或创作者主页。创作者可认领列表以更新所有权信号。
认领此 Skill所有者认领
认领此 Skill 页面
这条 Registry 收录 列表归属于 greensock,但尚未标记为官方。认领后可增加已验证所有者信号,使后续发布、安装和审计更新更值得信赖。
创作者外链工具包
将证据徽章加入你的 README
在开发者评估仓库的位置展示规范页面、当前信任与审计信号,以及真实的 Agent 验证证据。
[](https://www.openagentskill.com/skills/greensock-gsap-utils)
[](https://www.openagentskill.com/skills/greensock-gsap-utils)
[](https://www.openagentskill.com/skills/greensock-gsap-utils/audit)
[](https://www.openagentskill.com/skills/greensock-gsap-utils)作者
greensock
@greensock
平台适配
健康信号
- GitHub Stars
- 14.1K
- 质量评分
- 53/100
- 最近 GitHub 推送
- 2026年8月22日
- 框架提示
- 未知
- OpenAgentSkill 浏览量
- 3
- 复制安装命令
- 0
- 跳转点击
- 0
社区信号
告诉我们这个 Skill 是否对你的 Agent 工作流有帮助。汇总反馈会持续改善排序。
信任与安全
审查后安装
- GitHub 采用度14K 个 GitHub Stars通过
- Star/Fork 活跃度14K 个 Star,830 个 Fork; 当前元数据中没有议题活跃度信息通过
- 近期维护今天有推送通过
- 许可证清晰度MIT通过
- README/SKILL.md 完整度公开元数据需要更完整的 README/SKILL.md 上下文信息
- 依赖与运行时风险external package install surface, network or browser surface信息
相关 Skill
UI-TARS Desktop
Run multimodal agents that operate desktop interfaces
37.0K StarsMoneyPrinterTurbo
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
88.5K StarsCua
Open-source infrastructure for Computer-Use Agents. Sandboxes, SDKs, and benchmarks to train and evaluate AI agents that can control full desktops (macOS, Linux, Windows).
21.4K Stars