Communitygithub.com

FerroxLabs/murage

专业的Web动画专业知识,涵盖CSS动画与过渡、Web Animations API、Framer Motion、GSAP、滚动驱动动画、布局动画、弹簧物理、减少动效偏好及性能预算。

murage 是什么?

Murage是一个全面的Web动画技能,旨在帮助开发者和AI代理设计并实现高性能、有目的性的Web动画,同时兼顾性能和可访问性。该技能支持多种主流动画工具和平台,包括原生的CSS过渡与关键帧、React的Framer Motion、Vue的过渡系统、GSAP复杂时间线、以及CSS滚动驱动动画等。它提供了一套完整的决策矩阵,帮助用户根据动画需求(如悬停效果、入场/出场、滚动触发、手势交互等)选择最合适的工具。技能还深入涵盖了性能优化原则(如仅合成transform和opacity属性、保持60fps)、无障碍设计(通过prefers-reduced-motion尊重用户偏好)、以及弹簧物理与缓动函数的最佳实践。此外,Murage还提供了动画设计原则(如目的性、时长指南、缓动选择)和架构检查清单,确保每一个动画都有明确的功能而非装饰。该技能非常适合在React、Vue或原生JavaScript项目中实施专业级动画解决方案。

兼容平台~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/FerroxLabs/murage/tree/HEAD/skills-library/animation-designer

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

动画设计师

目的

设计和实现高性能、有目的性的Web动画,在提升用户体验的同时不牺牲性能或可访问性。本技能涵盖动画工具、模式以及选择正确方法的决策框架。

动画工具选择

决策矩阵

动画需求                          推荐工具
--------------------------------------------------------------
简单的悬停/焦点效果               CSS 过渡
关键帧序列(加载等)               CSS @keyframes
入场/出场组件动画                 Framer Motion (React)
                                  Vue <Transition> (Vue)
滚动触发揭示                      CSS 滚动驱动动画
                                  (或 Intersection Observer)
复杂时间线序列                    GSAP
SVG 路径动画                      GSAP 或 CSS
弹簧/物理驱动运动                 Framer Motion (spring)
布局动画(位置/尺寸)              Framer Motion (layoutId)
手势驱动(拖拽、捏合)              Framer Motion (drag)
共享元素过渡                      View Transitions API
数据可视化动画                    D3 过渡或 GSAP
微交互(图标、开关)               CSS 或 Lottie

CSS 过渡

基础知识

/* 过渡简写:property duration timing-function delay */
.button {
  background: var(--color-brand);
  transition: background 200ms ease-out, transform 150ms ease-out;
}
.button:hover {
  background: var(--color-brand-hover);
  transform: scale(1.02);
}

/* 单独属性 */
.card {
  transition-property: transform, box-shadow, opacity;
  transition-duration: 200ms, 300ms, 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 命名缓动函数 */
--ease-in:        cubic-bezier(0.4, 0, 1, 1);     /* 加速 */
--ease-out:       cubic-bezier(0, 0, 0.2, 1);     /* 减速 */
--ease-in-out:    cubic-bezier(0.4, 0, 0.2, 1);   /* 标准 */
--ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1); /* 过冲 */

常见过渡模式

/* 淡入/淡出 */
.fade-enter { opacity: 0; }
.fade-enter-active { opacity: 1; transition: opacity 300ms ease-out; }
.fade-exit { opacity: 1; }
.fade-exit-active { opacity: 0; transition: opacity 200ms ease-in; }

/* 从下方滑入 */
.slide-up {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 300ms ease-out, opacity 200ms ease-out;
}
.slide-up.active {
  transform: translateY(0);
  opacity: 1;
}

/* 骨架屏加载闪烁 */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

CSS @keyframes

/* 旋转器 */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  animation: spin 1s linear infinite;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  width: 24px; height: 24px;
}

/* 脉冲(注意力指示器) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.notification-dot {
  /* ...(压缩)... */
.list-item:nth-child(2) { animation-delay: calc(1 * 50ms); }
.list-item:nth-child(3) { animation-delay: calc(2 * 50ms); }

/* 或使用 style 属性:style="--i: 3" */
.list-item {
  animation-delay: calc(var(--i) * 50ms);
}

CSS 滚动驱动动画

/* 根据滚动位置进行动画 */
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 当元素进入视口时触发 */
.reveal-on-scroll {
  animation: reveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 50%;
}
/* ...(压缩)...
  to { transform: translateY(-50px); }
}

.parallax-element {
  animation: parallax linear;
  animation-timeline: scroll();
}

Framer Motion (React)

基础模式

import { motion, AnimatePresence } from 'framer-motion';

// 入场动画
function Card() {
  return (
    <motion.div
      initial={{ opacity: 0, y: 20 }}
      animate={{ opacity: 1, y: 0 }}
      transition={{ duration: 0.3, ease: 'easeOut' }}
    >
      <h2>卡片内容</h2>
    </motion.div>
  );
}

// 出场动画(需要 AnimatePresence)
function Modal({ isOpen, onClose }: ModalProps) {
  return (
    /* ...(压缩)... */
    <motion.li key={item.id} variants={itemVariants}>
      {item.name}
    </motion.li>
  );
}
}

弹簧物理

// 弹簧动画(自然的、基于物理的运动)
<motion.div
  animate={{ x: 100 }}
  transition={{
    type: 'spring',
    stiffness: 300,   // 越高越灵敏
    damping: 20,      // 越高越少弹跳
    mass: 1,          // 越高惯性越大
  }}
/> .// 预设
const springPresets = {
  snappy:  { type: 'spring', stiffness: 400, damping: 25 },
  bouncy:  { type: 'spring', stiffness: 300, damping: 10 },
  gentle:  { type: 'spring', stiffness: 120, damping: 14 },
  molasses: { type: 'spring', stiffness: 60, damping: 20 },
};

// 何时使用弹簧 vs 缓动:
// 弹簧:交互式元素、拖拽、布局变化(感觉自然)
// 缓动:简单过渡、入场/出场(感觉可预测)

布局动画

// 自动布局动画
function ExpandableCard({ expanded }: { expanded: boolean }) {
  return (
    <motion.div layout className={expanded ? 'card-expanded' : 'card-collapsed'}>
      <motion.h2 layout="position">标题</motion.h2>
      {expanded && (
        <motion.p
          initial={{ opacity: 0 }}
          animate={{ opacity: 1 }}
          exit={{ opacity: 0 }}
        >
          展开的内容在这里。
        </motion.p>
      )}
    </motion.div>
  );
}

/* ...(压缩)... */
        {item.title}
      </motion.div>
    ))}
  </div>
</LayoutGroup>
);
}

手势动画

// 拖拽
<motion.div
  drag
  dragConstraints={{ top: -100, bottom: 100, left: -100, right: 100 }}
  dragElastic={0.2}
  whileDrag={{ scale: 1.1, cursor: 'grabbing' }}
/> .// 悬停和点击
<motion.button
  whileHover={{ scale: 1.05 }}
  whileTap={{ scale: 0.95 }}
  transition={springPresets.snappy}
>
  点击我
</motion.button> .// 滚动触发(使用 useInView)
/* ...(压缩)... */
      animate={isInView ? { opacity: 1, y: 0 } : {}}
      transition={{ duration: 0.6, ease: 'easeOut' }}
    >
      {children}
    </motion.div>
  );
}

GSAP(复杂时间线)

import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';

gsap.registerPlugin(ScrollTrigger);

// 时间线序列
const tl = gsap.timeline({ defaults: { ease: 'power2.out', duration: 0.5 } });

tl.from('.hero-title', { y: 60, opacity: 0 })
  .from('.hero-subtitle', { y: 40, opacity: 0 }, '-=0.3')   // 重叠0.3秒
  .from('.hero-cta', { scale: 0.8, opacity: 0 }, '-=0.2')
  .from('.hero-image', { x: 100, opacity: 0 }, '-=0.4');

// 滚动触发动画
gsap.from('.feature-card', {
  scrollTrigger: {
    trigger: '.features-section',
    start: 'top 80%',
    /* ...(压缩)... */
  const ctx = gsap.context(() => {
    // 此处放置所有 GSAP 动画
    gsap.from('.item', { opacity: 0, y: 20, stagger: 0.1 });
  }, containerRef);

  return () => ctx.revert();  // 清除所有动画
}, []);

减少动效偏好

实现

/* CSS:全局尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
// React:useReducedMotion 钩子
function useReducedMotion(): boolean {
  const [reduced, setReduced] = useState(false);

  useEffect(() => {
    const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
    setReduced(mq.matches);
    const handler = (e: MediaQueryListEvent) => setReduced(e.matches);
    mq.addEventListener('change', handler);
    return () => mq.removeEventListener('change', handler);
  }, []);

  return reduced;
}

// 用法
function AnimatedCard() {
  const reduced = useReducedMotion();
  /* ...(压缩)... */
      内容
    </motion.div>
  );
}

// Framer Motion 内置(v6+)
import { useReducedMotion } from 'framer-motion';

动画性能预算

目标:动画必须保持60fps(每帧16.67ms)

规则:
  1. 仅对 transform 和 opacity 进行动画(仅合成器属性)
  2. 避免对 width, height, top, left, margin, padding 进行动画
  3. 谨慎使用 will-change(增加内存开销)
  4. 同时动画的元素限制在约10-15个
  5. 对JS驱动的动画使用 requestAnimationFrame
  6. 对滚动处理函数进行防抖(或使用CSS滚动驱动动画)
  7. 避免动画化会导致其他元素布局变化的元素

测量:
  - Chrome DevTools > Performance > Frame chart
  - 目标:没有帧超过16ms
  - 检查布局抖动(强制回流指示器)

优化技术:
  - 使用 transform: translateZ(0) 或 will-change 提升图层
  - 对动画容器使用 contain: layout paint
  - 对屏幕外的动画内容使用 content-visibility: auto
  - 不可见时暂停动画(Intersection Observer)

动画设计原则

1. 目的:每个动画必须服务于一个功能
   - 引导注意力
   - 显示关系(父子、前后)
   - 提供反馈(点击、悬停、成功、错误)
   - 保持空间方向(内容从何而来)
   - 减少感知等待时间

2. 时长指南:
   微交互(悬停、开关):  100-200ms
   入场动画:              200-400ms
   出场动画:              150-300ms(比入场更快)
   页面过渡:              300-500ms
   复杂序列:              500-1000ms 总计

3. 缓动:
   进入:ease-out(减速——快速出现,稳定到位)
   退出:ease-in(加速——缓慢开始,快速离开)
   移动:ease-in-out(自然运动)
   连续:linear(旋转器、进度条)

4. 交错:
   列表项之间30-80ms(项目越多越快)
   最大总交错时长:约500ms(即使有20个以上项目)

动画架构检查清单

  • 根据复杂性需求选择了动画工具
  • 简单的悬停/焦点效果使用CSS过渡
  • 循环和加载动画使用CSS @keyframes
  • 入场/出场/布局动画使用Framer Motion或等效工具
  • 复杂时间线序列保留给GSAP
  • 所有动画保持60fps(已在DevTools中验证)
  • 仅对 transform 和 opacity 进行动画(无布局属性)
  • 全局尊重 prefers-reduced-motion
  • 动画时长遵循UX指南(100-500ms)
  • 交错时间限制在合理的总时长内
  • 每个动画都有明确的目的(不是装饰性的)
  • 交互/手势动画使用弹簧物理
  • 滚动驱动动画在支持处使用CSS API
  • GSAP动画在组件卸载时清理
  • will-change 仅在动画活跃期间使用

何时使用

在以下情况使用此技能:

  • 设计或实现动画设计师解决方案
  • 审查或改进现有的动画设计师方法
  • 对动画设计师做出架构或实现决策
  • 学习动画设计师模式和最佳实践
  • 排查动画设计师相关问题

在以下情况不要使用此技能:

  • 问题涉及一个根本不同的技术领域
  • 更相关的兄弟技能恰好涵盖了所需的确切主题
  • 用户需要完整的实践教程而非专家指导

输出格式

# 动画设计师分析

## 上下文评估
[情况总结和限制条件]

## 推荐方法
[包含理由的主要建议]

## 实现步骤
1. [包含具体细节的步骤]
2. [包含具体细节的步骤]
3. [包含具体细节的步骤]

## 权衡与考量
- [关键权衡1]
- [关键权衡2]

## 下一步
- [即时行动项]
- [后续行动项]

示例

输入: "帮助我为中等规模的生产应用实现动画设计师"

输出: 一个结构化的分析,包括当前状态评估、推荐的包含具体模式的动画设计师方法、带有里程碑的实现路线图,以及根据应用规模和限制量身定制的风险缓解策略。

边缘情况

  • 遗留系统集成: 当动画设计师必须与遗留方法共存时,提供渐进迁移路径而非完全重写
  • 规模不匹配: 当解决方案复杂度超过项目规模时,推荐更简单的方法并注明何时重新审视
  • 团队技能差距: 当团队缺乏推荐方法经验时,包含学习资源和更简单的替代方案
  • 冲突需求: 当约束条件冲突时(例如性能与可维护性),明确陈述权衡并根据既定优先级给出建议

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

FerroxLabs/murage

Writes board-level narrative updates that complement financial reports with strategic context, competitive positioning, key risks, and forward-looking guidance for board of directors audiences. Use when the user needs to write a board update, board meeting narrative, or director-level briefing. Do NOT use for stakeholder updates to management (use `stakeholder-update`), investor emails (use `investor-update-email`), or full business reports (use `business-report`).

FerroxLabs/murage

>- End-to-end workflow for building a professional photography portfolio from niche selection through shooting, editing, website creation, and client acquisition. Covers gear decisions, shooting technique, post-processing workflow, portfolio curation, online presence, and the transition from hobbyist to working photographer. Use when the user wants to build photography portfolio or needs a structured multi-step process for this goal. Do NOT use when the request is a single-step task or requires professional advice beyond educational guidance.

FerroxLabs/murage

>- End-to-end workflow for creating a high-converting SaaS landing page from copywriting through design, development, SEO optimization, and analytics setup. Covers persuasion frameworks, responsive design, performance optimization, and conversion tracking to turn visitors into customers. Use when the user wants to build saas landing page or needs a structured multi-step process for this goal. Do NOT use when the request is a single-step task or requires professional advice beyond educational guidance.

FerroxLabs/murage

Calculates startup burn rate (gross and net), projects cash runway in months, and builds scenario analysis for different spending and revenue trajectories. Use when the user asks about burn rate, cash runway, how long their money will last, or startup cash management. Do NOT use for personal savings calculations (use budget-planning), full financial modeling (use financial-model-structure), or fundraising narrative (use fundraising-narrative).

FerroxLabs/murage

The user is asking \"how long do we have,\" \"can we afford this hire,\" or \"are we running out.\" Load whenever cash, burn, or time-to-zero shows up — or when a spending decision is on the table and the user doesn't know how many months it costs.

FerroxLabs/murage

Professional corporate video production guidance covering training videos, promotional content, testimonials, and product demos. Includes client brief templates, script approval workflows, achieving professional quality on budget, brand compliance, stakeholder management, and delivery specifications. Use when the user asks about corporate video or needs help with related topics. Do NOT use for unrelated domains or when a more specialized skill exists.

FerroxLabs/murage

Helps artists, designers, and creative professionals curate, organize, and present their work through compelling portfolios across digital platforms, personal websites, and print formats for career advancement. Use when the user asks about creative portfolio builder, related techniques, best practices, or needs guidance in this domain. Do NOT use when the request is outside the scope of creative portfolio builder or requires a different specialized skill.

FerroxLabs/murage

Cross-discipline creative portfolio assessment evaluating artistic cohesion, technical skill, presentation quality, and market positioning. Produces a scored evaluation with recommendations for strengthening creative identity and professional opportunity. Use when the user asks about creative portfolio evaluator, related techniques, best practices, or needs guidance in this domain. Do NOT use when the request is outside the scope of creative portfolio evaluator or requires a different specialized skill.

FerroxLabs/murage

Professional design portfolio evaluation assessing design process, craft quality, range of work, presentation, and industry alignment. Produces a scored review with recommendations for strengthening design practice and career positioning. Use when the user asks about design portfolio reviewer, related techniques, best practices, or needs guidance in this domain. Do NOT use when the request is outside the scope of design portfolio reviewer or requires a different specialized skill.

FerroxLabs/murage

Teaches specific named emotional regulation techniques (the STOP technique, urge surfing, cognitive reframing, emotional labeling, opposite action, and physiological soothing) with step-by-step sequences. Gathers the user's emotional challenges and triggers, then produces a personalized regulation toolkit with technique instructions and a situation-response plan. Use when the user asks about managing emotions, controlling anger, handling frustration, emotional regulation strategies, or building emotional resilience. Do NOT use for clinical emotional dysregulation treatment, personality disorder management, or replacing professional mental health support.

FerroxLabs/murage

Structures a fundraising narrative for startup investors covering traction, market size, business model, use of funds, and milestone targets using standard VC pitch structure. Use when the user asks about fundraising pitch, investor narrative, raising capital, pitch deck story, or investment memo. Do NOT use for sales pitch decks (use sales-pitch-deck), personal loan applications, grant proposals (use grant-proposal-writing), or financial model creation (use financial-model-structure).

FerroxLabs/murage

Interactive storytelling for games covering branching narratives, dialogue trees, environmental storytelling, lore design, character writing for games, quest design, player agency, world-building for interactive media, and narrative integration with game mechanics. Use when the user asks about game narrative writer or needs help with related topics. Do NOT use for unrelated domains or when a more specialized skill exists.

FerroxLabs/murage

Writes Instagram captions with a hook line, story body, hashtag strategy, and platform-optimized call-to-action. Use when the user wants to write an Instagram caption, create Instagram content, or draft text to accompany an Instagram post or reel. Do NOT use for LinkedIn posts (use `linkedin-post`), Twitter threads (use `twitter-thread`), or blog posts (use `blog-post-writing`).

FerroxLabs/murage

Produces conversion-optimized landing page copy with hero section, problem statement, solution, social proof, and CTA sections using conversion copywriting methodology. Use when the user asks to write landing page copy, create a product page, write a sales page, draft conversion copy, or write landing page text for a website. Also useful when asked to write website copy or create a page that converts visitors. Do NOT use for ad copy (use paid-ad-copy), product descriptions for e-commerce listings (use product-description), or full website content strategy (use seo-content-strategy).

FerroxLabs/murage

Guides the user through launching a professional art or creative portfolio from curation through outreach, chaining 5 atomic skills across career-development, design-creative, and writing categories. Covers physical vs. digital portfolio, platform selection, fine art vs. commercial positioning, and curated vs. comprehensive approaches. Use when the user wants to create and launch a portfolio to attract clients, galleries, or employers. Do NOT use for building a job search portfolio in non-creative fields (use land-new-job workflow), personal brand content strategy (use build-personal-brand workflow), or creating the artwork itself.

FerroxLabs/murage

>- Complete YouTube channel launch workflow from niche selection and channel strategy through video production, editing, monetization setup, community building, and personal brand development for sustainable channel growth. Use when the user wants to launch youtube channel or needs a structured multi-step process for this goal. Do NOT use when the request is a single-step task or requires professional advice beyond educational guidance.

FerroxLabs/murage

Run a section-by-section conversion teardown of one landing page — hero, value proposition, social proof, features, objection handling, CTA and footer — plus form, mobile and page-speed audits, ending in prioritised fixes split into quick wins, strategic and long-term, with A/B test hypotheses. Use when one page has traffic and is not converting. Do NOT use for a whole-site marketing audit (use market-audit), for the copy voice and awareness-stage decisions behind it (use copy-awareness-stages) or for the visual system it should sit inside (use mira-visual-system).

FerroxLabs/murage

Comprehensive motion graphics guidance covering title design, lower thirds, animated explainers, kinetic typography, logo animation, After Effects and Apple Motion workflows, design principles for motion, storyboarding for motion, and building a motion design practice. Use when the user asks about motion graphics or needs help with related topics. Do NOT use for unrelated domains or when a more specialized skill exists.

FerroxLabs/murage

Game narrative design covering branching dialogue systems, world lore construction, environmental storytelling techniques, character arc design for interactive media, player agency and consequence systems, quest narrative structure, narrative documentation, and integration with game mechanics. Use when the user asks about narrative designer or needs help with related topics. Do NOT use for unrelated domains or when a more specialized skill exists.

FerroxLabs/murage

Comprehensive animation guidance covering the 12 principles of animation, 2D and 3D production pipelines, tools (Blender, After Effects, Procreate, Toon Boom), frame rates, rigging, motion graphics vs character animation, and building an animation practice from concept to final render. Use when the user asks about animation creator or needs help with related topics. Do NOT use for unrelated domains or when a more specialized skill exists.

相关技能