Communitygithub.com

David-Li0406/meta-skill-evloving

網頁介面的動畫與微互動模式。用於為 UI 元件加入轉場、動畫、懸停效果、載入狀態或任何動態效果。

meta-skill-evloving 是什麼?

此技能專門為 AI 代理提供一套完整的網頁動畫與微互動設計指引,涵蓋了從核心設計原則到具體實作模式的全面知識。它明確說明了動畫的目的(如反饋、方向、焦點與愉悅感),並特別強調了何時不該使用動畫,例如當使用者啟用「減少動畫效果」偏好、動畫會延遲關鍵操作或對低效能裝置不友善時。技能內容包含了詳細的時間與緩動曲線指南,並提供了標準 CSS 以及 Tailwind CSS、Framer Motion 與 GSAP 等主流動畫庫的實作範例。支援平台的範圍廣泛,從純 CSS 到 React 生態系中的 Framer Motion,再到適合複雜時間軸控制的 GSAP,都能找到對應的程式碼片段。此外,它還提供了效能最佳化建議(如優先使用 transform 和 opacity)以及一個實用的動畫檢查清單,確保開發者能創建既流暢又高效的動畫體驗。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/David-Li0406/meta-skill-evloving/tree/HEAD/skill-flow/data/skills-refined-36k/skillsmp/animator

在你喜歡的 AI 中提問

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

說明文件

動態設計

創建有意義、高效能的動畫,以提升使用者體驗。

核心原則

動畫的目的

  • 反饋 - 確認使用者操作(按鈕點擊、表單提交)
  • 方向 - 顯示元素來自何方/前往何處
  • 焦點 - 引導注意力至重要的變化
  • 愉悅感 - 在不拖慢使用者的情況下增添個性

何時不該使用動畫

  • 使用者已啟用 prefers-reduced-motion
  • 動畫會延遲關鍵操作
  • 動畫不增添意義
  • 在低效能裝置上
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

時間與緩動

持續時間指南

類型持續時間使用情境
微互動100-150ms按鈕狀態、開關、小型反饋
標準200-300ms多數 UI 轉場、彈窗、下拉選單
複雜300-500ms頁面轉場、大區塊揭示
強調500ms+引導流程、慶祝效果(謹慎使用)

緩動函數

/* 自然動態 - 適用於多數 UI */
--ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);      /* 減速 */
--ease-in: cubic-bezier(0.4, 0.0, 1, 1);          /* 加速 */
--ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);   /* 兩者兼具 */

/* 表達性動態 - 進入/離開 */
--ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);  /* 過衝 */
--ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);   /* 彈跳 */

/* 快速參考 */
ease-out: 元素進入(趨於靜止)
ease-in: 元素離開(加速遠離)
ease-in-out: 元素在狀態間轉換

Tailwind 預設值

<!-- 持續時間 -->
duration-75 duration-100 duration-150 duration-200 duration-300 duration-500

<!-- 緩動 -->
ease-linear ease-in ease-out ease-in-out

常見模式

按鈕互動

.button {
  transition: transform 150ms ease-out,
              box-shadow 150ms ease-out,
              background-color 150ms ease-out;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
// Tailwind
<button className="transition-all duration-150 ease-out
  hover:-translate-y-0.5 hover:shadow-lg
  active:translate-y-0 active:scale-[0.98]">
  點擊我
</button>

淡入與縮放進入

/* 模態框/對話框進入 */
@keyframes fadeScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal {
  animation: fadeScaleIn 200ms ease-out;
}

滑動轉場

/* 從底部滑入 */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 從側邊滑入(用於抽屜) */
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

階梯式列表動畫

// Framer Motion
<motion.ul>
  {items.map((item, i) => (
    <motion.li
      key={item.id}
      initial={{ opacity: 0, y: 20 }}
      animate={{ opacity: 1, y: 0 }}
      transition={{ delay: i * 0.05 }}
    />
  ))}
</motion.ul>
/* CSS 階梯式,使用 animation-delay */
.list-item {
  opacity: 0;
  animation: fadeSlideIn 300ms ease-out forwards;
}

.list-item:nth-child(1) { animation-delay: 0ms; }
.list-item:nth-child(2) { animation-delay: 50ms; }
.list-item:nth-child(3) { animation-delay: 100ms; }
/* ... 或使用 CSS 自訂屬性 */

.list-item {
  animation-delay: calc(var(--index) * 50ms);
}

載入狀態

/* 脈衝(骨架載入) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton {
  animation: pulse 2s ease-in-out infinite;
}

/* 旋轉器 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* 進度條閃爍 */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

懸停揭示

/* 懸停時圖片縮放 */
.image-container {
  overflow: hidden;
}

.image-container img {
  transition: transform 300ms ease-out;
}

.image-container:hover img {
  transform: scale(1.05);
}

/* 底線增長 */
.link {
  position: relative;
}

.link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 250ms ease-out;
}

.link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

Framer Motion 模式

基本動畫

import { motion } from 'framer-motion';

<motion.div
  initial={{ opacity: 0, y: 20 }}
  animate={{ opacity: 1, y: 0 }}
  exit={{ opacity: 0, y: -20 }}
  transition={{ duration: 0.2, ease: 'easeOut' }}
>
  內容
</motion.div>

用於複雜動畫的變體

const containerVariants = {
  hidden: { opacity: 0 },
  visible: {
    opacity: 1,
    transition: {
      staggerChildren: 0.05,
    },
  },
};

const itemVariants = {
  hidden: { opacity: 0, y: 20 },
  visible: { opacity: 1, y: 0 },
};

<motion.ul variants={containerVariants} initial="hidden" animate="visible">
  {items.map((item) => (
    <motion.li key={item.id} variants={itemVariants}>
      {item.name}
    </motion.li>
  ))}
</motion.ul>

佈局動畫

// 自動動畫佈局變化
<motion.div layout>
  {isExpanded ? <ExpandedContent /> : <CollapsedContent />}
</motion.div>

// 共享佈局動畫(元素變形)
<motion.div layoutId="shared-element">
  {/* 此元素在位置之間動畫過渡 */}
</motion.div>

手勢

<motion.button
  whileHover={{ scale: 1.05 }}
  whileTap={{ scale: 0.95 }}
  transition={{ type: 'spring', stiffness: 400, damping: 17 }}
>
  按我
</motion.button>

使用 AnimatePresence 實現離開動畫

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

<AnimatePresence mode="wait">
  {isVisible && (
    <motion.div
      key="modal"
      initial={{ opacity: 0 }}
      animate={{ opacity: 1 }}
      exit={{ opacity: 0 }}
    >
      模態內容
    </motion.div>
  )}
</AnimatePresence>

GSAP 模式

基本動畫

import gsap from 'gsap';

// 簡單補間
gsap.to('.element', {
  x: 100,
  opacity: 1,
  duration: 0.3,
  ease: 'power2.out'
});

// 從動畫
gsap.from('.element', {
  y: 20,
  opacity: 0,
  duration: 0.3,
  ease: 'power2.out'
});

用於序列的時間軸

const tl = gsap.timeline();

tl.from('.header', { y: -50, opacity: 0 })
  .from('.content', { y: 20, opacity: 0 }, '-=0.2')
  .from('.footer', { y: 20, opacity: 0 }, '-=0.2');

// 控制時間軸
tl.play();
tl.pause();
tl.reverse();

階梯動畫

gsap.from('.list-item', {
  y: 20,
  opacity: 0,
  duration: 0.3,
  stagger: 0.05,
  ease: 'power2.out'
});

ScrollTrigger

import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);

gsap.from('.section', {
  scrollTrigger: {
    trigger: '.section',
    start: 'top 80%',
    end: 'bottom 20%',
    toggleActions: 'play none none reverse'
  },
  y: 50,
  opacity: 0,
  duration: 0.6
});

GSAP 緩動

// 冪次緩動(1-4,數字越大越強烈)
ease: 'power1.out'  // 輕微
ease: 'power2.out'  // 標準(類似 ease-out)
ease: 'power3.out'  // 明顯
ease: 'power4.out'  // 強烈

// 特殊緩動
ease: 'back.out(1.7)'   // 過衝
ease: 'elastic.out(1, 0.3)'  // 有彈性
ease: 'bounce.out'      // 結束時彈跳

React 整合

import { useGSAP } from '@gsap/react';
import gsap from 'gsap';

function Component() {
  const containerRef = useRef(null);

  useGSAP(() => {
    gsap.from('.item', {
      y: 20,
      opacity: 0,
      stagger: 0.1
    });
  }, { scope: containerRef });

  return (
    <div ref={containerRef}>
      <div className="item">項目 1</div>
      <div className="item">項目 2</div>
    </div>
  );
}

效能技巧

使用 Transform 與 Opacity

/* 良好 - GPU 加速 */
transform: translateX(100px);
transform: scale(1.1);
transform: rotate(45deg);
opacity: 0.5;

/* 避免動畫化 - 觸發佈局 */
width, height, top, left, margin, padding

will-change 提示

/* 謹慎使用 - 僅用於已知的動畫 */
.animated-element {
  will-change: transform, opacity;
}

/* 動畫結束後移除 */
.animated-element.done {
  will-change: auto;
}

減少動態效果查詢

// React hook
const prefersReducedMotion = window.matchMedia(
  '(prefers-reduced-motion: reduce)'
).matches;

// Framer Motion
<motion.div
  animate={{ x: 100 }}
  transition={{
    duration: prefersReducedMotion ? 0 : 0.3
  }}
/>

快速參考

元素持續時間緩動屬性
按鈕懸停150msease-outtransform, shadow, bg
切換開關200msease-outtransform
下拉選單開啟200msease-outopacity, transform
模態框進入250msease-outopacity, scale
模態框離開200msease-inopacity, scale
頁面轉場300msease-in-outopacity, transform
Toast 進入300msspringtransform
骨架脈衝2000msease-in-outopacity

動畫檢查清單

  • 動畫有明確的目的(反饋、方向、焦點)
  • 持續時間感覺輕快(不遲緩)
  • 緩動符合動畫類型(進入用 ease-out)
  • 尊重 prefers-reduced-motion
  • 盡可能只動畫化 transform/opacity
  • 離開動畫比進入動畫快
  • 階梯延遲微妙(30-50ms)
  • 動畫不阻擋使用者互動

Individual skills in this repo

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

David-Li0406/meta-skill-evloving

Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.

David-Li0406/meta-skill-evloving

Create technical diagrams using Mermaid syntax for architecture, sequences, ERDs, flowcharts, and state machines. Use for visualizing system design, data flows, and processes. Triggers: diagram, mermaid, architecture diagram, sequence diagram, flowchart, ERD, entity relationship, state diagram, C4 model, component diagram, visualize, draw.

David-Li0406/meta-skill-evloving

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

David-Li0406/meta-skill-evloving

Complete color manipulation and green screen effects system. PROACTIVELY activate for: (1) Green screen/chromakey removal, (2) Color grading with LUTs, (3) Color correction (levels, curves, white balance), (4) Colorkey/color removal effects, (5) Hue/saturation manipulation, (6) Color space conversions (BT.709, BT.2020, HDR), (7) Color isolation effects, (8) Teal and orange look, (9) Vintage/film looks, (10) Color keying for transparency. Provides: chromakey and colorkey filters, LUT application (lut3d), curves and levels adjustment, color balance, selective color manipulation, color space handling, HDR tone mapping, professional color grading chains.

David-Li0406/meta-skill-evloving

Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.

David-Li0406/meta-skill-evloving

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

David-Li0406/meta-skill-evloving

Build with OpenAI's stateless APIs - Chat Completions (GPT-5, GPT-4o), Embeddings, Images (DALL-E 3), Audio (Whisper + TTS), and Moderation. Includes Node.js SDK and fetch-based approaches for Cloudflare Workers. Use when: implementing chat completions with GPT-5/GPT-4o, streaming responses with SSE, using function calling/tools, creating structured outputs with JSON schemas, generating embeddings for RAG (text-embedding-3-small/large), generating images with DALL-E 3, editing images with GPT-Image-1, transcribing audio with Whisper, synthesizing speech with TTS (11 voices), moderating content (11 safety categories), or troubleshooting rate limits (429), invalid API keys (401), function calling failures, streaming parse errors, embeddings dimension mismatches, or token limit exceeded.

David-Li0406/meta-skill-evloving

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

David-Li0406/meta-skill-evloving

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

David-Li0406/meta-skill-evloving

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

David-Li0406/meta-skill-evloving

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

David-Li0406/meta-skill-evloving

Best practices for Remotion - Video creation in React

David-Li0406/meta-skill-evloving

Provides bidirectional translation (Chinese/English), grammar checking, and sentence polishing. Supports specific tense constraints, context-aware tone adjustment, and natural expression optimization. Outputs direct text without formatting.

David-Li0406/meta-skill-evloving

指导如何通过自定义注解(如@Unicom)标识Dubbo接口,利用BeanDefinitionRegistryPostProcessor在启动时扫描并动态注册ReferenceBean,实现RPC调用的封装。

David-Li0406/meta-skill-evloving

生成Python脚本,利用FFmpeg将图片序列按3x3布局合并,或将合并图拆分。要求使用subprocess模块执行命令,并支持用户交互式输入路径。

David-Li0406/meta-skill-evloving

SOP for extracting and analyzing promotional activity details, handling time formatting, location mapping, payment logic, and step-by-step process validation.

David-Li0406/meta-skill-evloving

Specializes in creating TikTok short video scripts using an anthropomorphic 'Chef' perspective to explain wildlife food chains and survival environments, utilizing real field footage.

David-Li0406/meta-skill-evloving

针对TikTok平台,以拟人化视角(如动物作为厨师)创作系列短视频脚本。重点介绍野生动物、食物链及生态环境,要求使用野外实拍素材,风格幽默且具有教育意义。

David-Li0406/meta-skill-evloving

Generates KWL (Know, Want to know, Learned) charts for educational videos, specifically BrainPOP, using simple 7th-grade language and short, concise bullet points.

David-Li0406/meta-skill-evloving

Tracks complex, multi-session work using the Beads issue tracker and dependency graphs, and provides persistent memory that survives conversation compaction. Use when work spans multiple sessions, has complex dependencies, or needs persistent context across compaction cycles. Trigger with phrases like "create task for", "what's ready to work on", "show task", "track this work", "what's blocking", or "update status".

相關技能