跳到正文
Skillpedia
通用编程48k · #3750

animejs-animation

它能做什么

这个工具可以使用 JavaScript 代码为网站创建复杂而流畅的动画。它能让视觉元素以精细的方式移动、改变大小或出现。

适用场景

  • ✓制作多阶段的落地页动画时。
  • ✓让元素按顺序依次出现(错落效果)时。
  • ✓为矢量图形(SVG)制作动画,创建动态的形状或线条时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/animejs-animation/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/animejs-animation/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

📦 包含此技能的技能包

可以这样问 AI

“为页面的标题和主图创建一个动画:标题先轻微移动着出现,然后主图再浮现出来。”

每周 5 个新技能,1 分钟读完。

工作原理

你需要指定页面中哪些元素需要动画,以及它们应该如何移动(例如从下往上、逐渐缩小)。这个工具会把这些指令组合起来,生成流畅、可控的动画序列。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Anime.js Animation Skill

Anime.js is a lightweight but extremely powerful JavaScript animation engine. It excels at complex timelines, staggering, and precise control over DOM, CSS, and SVGs.

Context

This skill is used for creating high-fidelity, jaw-dropping web animations that go far beyond simple CSS transitions. It's the tool of choice for awards-caliber interactive sites.

When to Use

Trigger this skill when:

  • Creating complex, multi-stage landing page orchestrations.
  • Implementing staggered animations for revealing grids, text, or data visualizations.
  • Animating SVG paths (morphing shapes, drawing dynamic lines).
  • Building highly interactive, kinetic UI elements that respond fluidly to user input.

Execution Workflow

  1. Identify Targets: Select the DOM elements or SVGs to be animated.

  2. Define Properties & Easing: Specify values to animate. Crucially, utilize advanced easing functions (e.g., custom cubicBezier, spring, or elastic) instead of basic linear or ease-in-out to make the motion feel expensive and natural.

  3. Orchestrate Timelines: Inspect the installed major version first. This example targets Anime.js v3; use anime.timeline() to sequence complex choreography. Master the use of timeline offsets (relative '-=200' vs absolute) to create seamless overlapping motion.

  4. Implement: For a bundler with Anime.js v3 installed, import anime from "animejs"; supplies the anime binding. The selectors must exist in the rendered DOM.

    const tl = anime.timeline({
      easing: "spring(1, 80, 10, 0)",
      duration: 1000,
    });
    tl.add({
      targets: ".hero-text",
      translateY: [50, 0],
      opacity: [0, 1],
      delay: anime.stagger(100),
    }).add(
      { targets: ".hero-image", scale: [0.9, 1], opacity: [0, 1] },
      "-=800",
    );
    

Motion and Compatibility

  • Scope: Use motion when it serves the product brief and user task. Respect the existing design system; simple transitions and static states are valid choices.
  • Staggering: Leverage anime.stagger() extensively to add organic rhythm to multiple elements.
  • Performance: Monitor main thread usage; use will-change: transform, opacity where appropriate for GPU acceleration.

Example

User request:

Create complex, multi-stage landing page orchestrations.

Limitations

  • The code above uses the v3 API. Anime.js v4 uses imported createTimeline() and a different target/parameter signature; do not mix major-version examples. Consult official timeline documentation for the installed version.
  • Respect prefers-reduced-motion: provide a static final state, avoid scroll hijacking, and keep focus/keyboard interactions immediately usable. Dispose animations when their component unmounts.
  • will-change is a temporary optimization hint, not a guarantee of GPU acceleration; measure real frames and avoid leaving it on every element.
  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题

什么是 stagger(错落效果)?

这是一种让多个元素一个接一个地出现或移动的效果,每两个元素之间有短暂的延迟,从而形成一种视觉节奏。

什么是缓动函数(easing functions)?

它们用来控制动画随时间变化的速度,让动作更自然、不那么生硬,就像现实世界中的运动一样。

可以在任何网站上使用吗?

可以,但它最适合用在那些能真正提升设计和用户体验的精致动画上,不太适合简单的动画。

详情

作者的原始描述

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#3750
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能