Communitygithub.com

YepAPI/skills

使用 Framer Motion 實現 React 動畫,包括過渡、捲軸動畫與佈局動畫。

skills 是什麼?

這是一個專注於 Framer Motion 動畫庫的 AI 技能,專為 React 開發者設計,提供從基本元件過渡到複雜佈局動畫的完整指引。技能涵蓋四種核心動畫類型:使用 `motion.div` 與 `initial`/`animate`/`exit` props 的元件級過渡、透過 `AnimatePresence` 處理的掛載/卸載動畫、利用 `layout` 屬性實現自動佈局調整(如重新排序、大小變化),以及借助 `useScroll()` 與 `useTransform()` 實現的捲軸觸發動畫(例如視差效果)。技能特別強調效能最佳化與無障礙設計,要求僅動畫化 `transform` 與 `opacity` 以確保流暢度,並透過 `useReducedMotion()` 鉤子尊重使用者的減少動畫偏好設定。此外,提供了子元素錯開動畫的 `staggerChildren` 變體用法,以及嚴格控制在 200-400ms 的 UI 過渡與 400-800ms 的頁面轉場時間範圍。此技能支援所有使用 Framer Motion 的 React 專案,無論是 Cursor、Claude Code 或 Codex 等 AI 代理平台皆可應用,能顯著提升開發者實作高品質動畫的效率與一致性。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/animations

在你喜歡的 AI 中提問

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

說明文件

動畫

規則

  • 使用 Framer Motion 為 React 實作動畫 — 使用 motion.div 搭配 initial、animate、exit props
  • 使用 AnimatePresence 處理掛載/卸載動畫 — 包裹條件式渲染內容
  • 使用 layout 屬性實現自動佈局動畫(重新排序、調整大小)
  • 捲軸動畫:使用 useScroll() + useTransform() 實現視差效果和捲軸觸發的顯示動畫
  • 尊重減少動畫偏好:使用 useReducedMotion() 鉤子 — 停用非必要的動畫
  • 子元素錯開動畫:使用含有 staggerChildren 的 variants 實現列表動畫
  • 效能最佳化:僅動畫化 transform 和 opacity — 切勿動畫化 width、height、margin
  • 保持動畫時長簡短:UI 過渡動畫 200-400ms,頁面轉場動畫 400-800ms

避免

  • 動畫化佈局屬性(width、height、top、left)— 應使用 transform: translate/scale
  • UI 互動動畫超過 1 秒 — 會造成遲滯感
  • 未經使用者觸發自動播放動畫 — 會導致迷失方向
  • 忽略 prefers-reduced-motion — 這是無障礙功能的必要條件

Individual skills in this repo

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

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相關技能