Communitygithub.com

FerroxLabs/murage

網頁動畫專業知識,涵蓋CSS動畫與過渡、Web Animations API、Framer Motion、GSAP、滾動驅動動畫、佈局動畫、彈簧物理、減少動畫偏好以及效能預算。

murage 是什麼?

此技能旨在為開發者提供設計與實現高效、有目的性的網頁動畫的完整指引。它不僅涵蓋從簡單的CSS過渡到複雜的GSAP時間軸等多種動畫工具,還提供了一個基於動畫複雜度與使用情境的決策框架,幫助用戶選擇最合適的技術方案。技能詳細說明了CSS Transitions、@keyframes、Scroll-Driven Animations、Framer Motion(包含彈簧物理、佈局動畫與手勢動畫)以及GSAP的具體使用模式與程式碼範例。此外,它強調了可及性(透過 prefers-reduced-motion)與效能(60fps預算、只動畫化 transform 和 opacity),並列出了動畫設計原則與實作檢查清單,確保每個動畫都有明確目的且效能優異。此技能適用於任何需要開發或優化網頁動畫的場景,支援所有主流瀏覽器與框架,並以React與Framer Motion為主要範例。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

動畫設計師

目的

設計並實現高效能、有意義的網頁動畫,在不犧牲效能或可及性的前提下提升使用者體驗。此技能涵蓋動畫工具、模式,以及選擇正確方法的決策框架。

動畫工具選擇

決策矩陣

動畫需求                             推薦工具
--------------------------------------------------------------
簡單的懸停/焦點效果                  CSS transitions
關鍵幀序列(載入等)                  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 transitions 或 GSAP
微互動(圖示、開關)                  CSS 或 Lottie

CSS 過渡

基礎知識

/* 過渡簡寫:屬性 持續時間 計時函數 延遲 */
.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.ul>
  );
}

彈簧物理

// 彈簧動畫(自然、基於物理的運動)
<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 hook
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 transitions 用於簡單的懸停/焦點效果
  • 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]

## 後續步驟
- [立即行動項目]
- [後續行動項目]

範例

輸入:「幫我為一個中型規模的生產應用程式實作動畫設計師」

**輸出:**結構化分析,涵蓋當前狀態評估、推薦的動畫設計師方法與特定模式、包含里程碑的實作藍圖,以及針對應用規模和限制量身定制的風險緩解策略。

邊緣案例

  • **舊系統整合:**當動畫設計師必須與舊方法共存時,提供漸進式遷移路徑而非完全重寫
  • **規模不匹配:**當解決方案複雜度超過專案規模時,建議更簡單的方法,並註明何時重新審視
  • **團隊技能差距:**當團隊缺乏推薦方法的經驗時,包含學習資源和更簡單的替代方案
  • **衝突需求:**當限制條件衝突時(例如,效能 vs. 可維護性),明確陳述權衡,並根據聲明的優先級提出建議

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.

相關技能