Communitygithub.com

NeverSight/learn-skills.dev

使用 Motion.dev(Framer Motion 後繼者)為 React、Next.js、Svelte 及 Astro 專案建立 120fps GPU 加速動畫。當使用者請求動畫、滾動效果、視差、英雄區動畫、手勢、拖曳互動、彈簧物理、whileHover 效果、whileInView 動畫、動態 UI、微互動、頁面轉場或佈局動畫時使用。生成可生產級的 TypeScript/JSX 程式碼,內建無障礙支援(prefers-reduced-motion)與效能驗證(≥60fps)。支援入場動畫、手勢互動(懸停/點擊/拖曳)、基於滾動的揭示效果,以及使用彈簧物理與自然時間控制的佈局轉場。請勿用於純 CSS 轉場(應使用原生 CSS)、無 JavaScript 的靜態網站、Vue 動畫(應改用 motion-v 套件),或 SVG/Canvas 複雜動畫(GSAP 更適合)。

learn-skills.dev 是什麼?

此技能利用 Motion.dev 函式庫(Framer Motion 的現代化後繼者,每月下載量超過 1000 萬次),為 React、Next.js、Svelte、Astro 及 Vue 框架生成生產級 GPU 加速動畫。其設計哲學遵循 Apple/Jon Ive 原則:目的性、流暢性(120fps)、無障礙性(尊重減少動畫設定)、效能性(僅使用 GPU 加速屬性)與一致性(統一的時間控制)。支援四種核心動畫模式:入場動畫(淡入/滑入)、手勢互動(懸停縮放、點擊回饋、拖曳)、滾動觸發效果(視差、揭示)及佈局動畫(FLIP 自動動畫)。內建完整的品質驗證標準,包括效能(≥60fps)、佈局穩定性(CLS = 0)、無障礙支援,以及生產級範本與範例庫(按需漸進載入)。

相容平台✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/NeverSight/learn-skills.dev/tree/HEAD/data/skills-md/199-biotechnologies/motion-dev-animations-skill/motion-dev-animations

在你喜歡的 AI 中提問

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

說明文件

Motion Dev 動畫

Motion.dev - 每月超過 1000 萬次下載,Framer Motion 的後繼者 為 React、Next.js、Svelte、Astro、Vue 提供 120fps GPU 加速動畫

宗旨

遵循 Apple/Jon Ive 原則生成生產級動畫: 目的性(服務功能) | 流暢(120fps) | 無障礙(減少動畫) | 高效能(僅 GPU) | 優雅(細緻) | 一致(統一的時間控制)

使用時機

✅ 適用於:

  • React 19+/Next.js 15+/Svelte 5+/Astro 4+ 動畫實作
  • 滾動效果(視差、揭示)、手勢(懸停、拖曳、點擊)、佈局動畫
  • 需要 60fps 以上效能的英雄區、卡片、微互動
  • 需要彈簧物理、自然動態、無障礙支援的專案

❌ 不適用於:

  • 純 CSS 轉場(使用原生 transition 屬性)
  • 不含 JavaScript 框架的靜態網站
  • Vue 專案(應使用 motion-v 套件 - API 不同)
  • SVG/Canvas 複雜動畫(GSAP 更適合)
  • 僅表單 CRUD 應用(過度設計)

工作流程:釐清 → 規劃 → 實作 → 驗證

步驟 1:釐清需求

確定專案背景與動畫目標:

  • 框架(React 19+、Next.js 15+、Svelte 5+、Astro 4+)
  • 動畫類型(入場、手勢、滾動、佈局)
  • 設計目標(細緻、引人注目、活潑、專業)
  • 效能限制(目標裝置、套件大小、無障礙需求)
  • 觸發機制(掛載、視口、使用者互動)

步驟 2:規劃動畫策略

定義實作方式:

  • 要動畫化的元件(頁首、卡片、按鈕、區段)
  • 動態模式(淡入、滑入、縮放、彈簧、視差)
  • 時間規格(持續時間、延遲、交錯間隔)
  • 物理參數(剛性:300-400、阻尼:20、質量:1)
  • 無障礙後備方案(prefers-reduced-motion 替代方案)

步驟 3:分階段實作

增量建立動畫:

  • 設定:安裝 Motion.dev、配置匯入、準備元件結構
  • 核心動畫:套用運動屬性(initial、animate、transition)
  • 精煉:調整時間控制、緩動曲線、彈簧物理以獲得自然感受
  • 無障礙:加入減少動畫偵測、鍵盤導航支援
  • 最佳化:驗證 GPU 加速、最小化套件大小、測試效能

步驟 4:驗證品質標準

根據需求檢查:

  • 效能:≥60fps(Chrome DevTools → Performance 分頁)
  • 佈局穩定性:CLS = 0(Lighthouse 稽核)
  • 無障礙:遵守 prefers-reduced-motion(系統設定測試)
  • 鍵盤導航:所有互動元素可鍵盤操作
  • 行動裝置響應式:觸控友善手勢,在 iOS/Android 上測試

動畫模式決策樹

輸入:應對什麼進行動畫?

├─ 入場(頁面載入、掛載)
│   → 模式:initial={{opacity: 0, y: 20}} animate={{opacity: 1, y: 0}}
│   → 時間:0.6-0.8s,ease: [0.22, 1, 0.36, 1]
│   → 交錯:元素間 0.1-0.2s
│   → 範例:./examples/hero-fade-up.md
│
├─ 手勢(懸停、點擊、拖曳)
│   → 模式:whileHover={{scale: 1.05}},whileTap={{scale: 0.95}}
│   → 物理:彈簧(剛性:300-400,阻尼:20)
│   → 時間:即時響應(無持續時間)
│   → 範例:./examples/card-hover.md,./examples/magnetic-button.md
│
├─ 滾動(揭示、視差)
│   → 模式:whileInView + viewport 或 useScroll + useTransform
│   → 觸發:viewport={{once: true, amount: 0.3}}
│   → 效能:僅使用 transform/opacity
│   → 範例:./examples/scroll-reveal.md,./examples/parallax-layers.md
│
└─ 佈局(重新排序、展開)
    → 模式:layout 屬性(自動 FLIP)
    → 共享:layoutId="id" 用於變形
    → 注意:僅變換 transform

API 快速參考

元件/鉤子用法時機
motion.div<motion.div animate={{x: 100}}>基本動畫
whileHoverwhileHover={{scale: 1.05}}懸停狀態(0.2-0.3s)
whileTapwhileTap={{scale: 0.95}}點擊回饋
whileInViewwhileInView={{opacity: 1}}滾動揭示
dragdrag="x" dragConstraints可拖曳元件
layout<motion.div layout />自動 FLIP 動畫
useScroll追蹤滾動進度視差、進度條
useTransform映射值滾動連結效果
useSpring彈簧物理平滑值變化
useInView視口偵測觸發動畫

完整 API:請參閱 完整 API 參考

框架整合

框架匯入元件退出動畫
React/Next.js"motion/react"<motion.div><AnimatePresence>
Svelte"motion"Vanilla API無
Astro"motion"用戶端腳本無
Vue"motion-v"<motion.div>與 React 類似

品質標準

類別要求驗證方式
效能≥60fpsChrome DevTools → Performance
GPU 加速僅使用 transform/opacity不使用 width/height/left/top
套件大小<50KBwebpack-bundle-analyzer
無障礙遵守 prefers-reduced-motion系統設定測試
行動裝置觸控友善iOS/Android 測試
佈局位移CLS = 0Lighthouse 稽核

範例庫(漸進載入)

根據動畫類型按需載入:

英雄區

  • 英雄區淡入上移 - 經典 Apple 風格入場
  • 英雄區交錯 - 編排元素
  • 英雄區文字分割 - 字元揭示

滾動效果

手勢與互動

佈局動畫

  • 清單重新排序 - 拖曳重新排序 FLIP
  • 手風琴 - 展開/收合
  • 分頁切換 - 共享佈局

完整範例:./examples/ 目錄中的所有檔案

參考文件(按需載入)

  • 完整 API 參考 - 所有元件、鉤子、屬性
  • 彈簧物理指南 - 調整剛性、阻尼、質量
  • 效能最佳化 - GPU、will-change、懶載入
  • 無障礙指南 - 減少動畫、鍵盤、螢幕閱讀器
  • 疑難排解 - 常見問題、解決方案
  • Framer Motion 遷移指南 - 升級指南

範本(可生產級)

  • Next.js 頁面範本 - 英雄區 + 特色 + 推薦
  • 元件庫範本 - 10 個以上可重用元件
  • 滾動範本 - 視差 + 揭示模式
  • 儀表板範本 - 互動式卡片、圖表

安裝

# React/Next.js/Svelte/Astro
npm install motion

# Vue
npm install motion-v

常用模式(可直接複製貼上)

模式 1:淡入上移入場

<motion.div
  initial={{ opacity: 0, y: 20 }}
  animate={{ opacity: 1, y: 0 }}
  transition={{ duration: 0.6, ease: [0.22, 1, 0.36, 1] }}
/>

模式 2:懸停卡片

<motion.div
  whileHover={{ y: -8, boxShadow: "0 20px 40px rgba(0,0,0,0.12)" }}
  transition={{ type: "spring", stiffness: 300, damping: 20 }}
/>

模式 3:滾動揭示

<motion.div
  initial={{ opacity: 0, y: 50 }}
  whileInView={{ opacity: 1, y: 0 }}
  viewport={{ once: true, amount: 0.3 }}
/>

更多模式:交錯清單、退出動畫、佈局轉場 → ./examples/ 目錄

錯誤處理

問題解決方案
動畫未觸發檢查 initial ≠ animate 值
效能不佳僅使用 transform/opacity + will-change CSS
佈局位移設定明確尺寸,使用 layout 屬性
退出動畫無效使用 <AnimatePresence> 包裹,加入 key 屬性

實作最佳實踐

  1. 從簡單開始 → 從淡入 + 滑入建構,逐步增加複雜度
  2. 提取變體 → 將動畫狀態定義為具名變體,以利維護
  3. 偏好彈簧物理 → 預設使用彈簧轉場(比 tween 更自然)
  4. 交錯清單項目 → 使用 staggerChildren(0.1-0.2s)建立節奏與階層
  5. 徹底測試行動裝置 → 驗證觸控手勢、在 iOS/Android 裝置上的效能
  6. 包含減少動畫 → 始終提供 prefers-reduced-motion 後備動畫
  7. 分析效能 → 使用 Chrome DevTools Performance 分頁,目標 ≥60fps

設計哲學(Apple/Jon Ive 原則)

將這些設計原則應用於所有動畫:

  • 簡潔:使用 200-400ms 持續時間,最小化同時動態,偏好 transform 屬性
  • 自然物理:實作彈簧基礎轉場,避免線性緩動,根據質量進行移動
  • 目的性動態:引導使用者注意,提供互動回饋,建立視覺層次
  • 優雅節制:應用「少即是多」原則,維持一致的時間控制,尊重使用者動態偏好

驗證

關於結構化輸出驗證,請參閱:

元資料

版本:3.0.0(研究驅動最佳化) 最佳化:命令式語言、少樣本模式(3 個範例)、分層複雜度、漸進載入 Token 效率:87% 核心縮減(15K → 2K)+ 自動快取 Motion.dev:v11+ 框架:React 19+、Next.js 15+、Svelte 5+、Astro 4+、Vue 3+ 研究:arXiv 2402.07927v1、2211.01910、2310.14735v5、PubMed 40334089 授權:MIT

Individual skills in this repo

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

NeverSight/learn-skills.dev

Use when generating or modifying Remotion video code, creating demo videos, or working with the demo-video/ directory

NeverSight/learn-skills.dev

Create AI avatar and talking head videos via inference.sh CLI. Recommended: P-Video-Avatar (fastest, cheapest, built-in TTS). Also: OmniHuman, Fabric, PixVerse. Audio: Inworld TTS-2 (100+ languages, emotion steering for characters), ElevenLabs, Kokoro. Capabilities: audio-driven avatars, text-to-avatar, lipsync videos, talking head generation, virtual presenters, UGC content. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos, UGC ads, gaming avatars, NPC dialogue. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human, ugc, ugc video, ugc ad, avatar ugc

NeverSight/learn-skills.dev

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awareness. Triggers: marketing video, ad video, promo video, commercial, brand video, product video, explainer video, ad creative, video ad, facebook ad video, youtube ad, instagram ad, tiktok ad, promotional video, launch video

NeverSight/learn-skills.dev

Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse

NeverSight/learn-skills.dev

ElevenLabs automatic dubbing - translate and dub audio/video into 29 languages while preserving speaker voice via inference.sh CLI. Capabilities: auto speaker detection, voice-preserving translation, video dubbing, audio localization. Use for: content localization, video translation, multilingual content, international distribution. Triggers: dubbing, dub video, translate audio, video translation, audio translation, localize content, elevenlabs dubbing, eleven labs dub, multilingual dub, voice translation, auto dub, language dub, content localization

NeverSight/learn-skills.dev

Explainer video production guide: scripting, voiceover, visuals, and assembly. Covers script formulas, pacing rules, scene planning, and multi-tool pipelines. Use for: product demos, how-it-works videos, onboarding videos, social explainers. Triggers: explainer video, how to make explainer, product video, demo video, video production, video script, animated explainer, product demo video, tutorial video, onboarding video, walkthrough video, video pipeline

NeverSight/learn-skills.dev

Still-to-video conversion guide: model selection, motion prompting, and camera movement. Covers Wan 2.5 i2v, Seedance, Fabric, Grok Video with when to use each. Use for: animating images, creating video from stills, adding motion, product animations. Triggers: image to video, i2v, animate image, still to video, add motion to image, image animation, photo to video, animate still, wan i2v, image2video, bring image to life, animate photo, motion from image

NeverSight/learn-skills.dev

Generate talking head avatar videos with Pruna P-Video-Avatar via inference.sh CLI. Turn a portrait image into a realistic speaking video with built-in TTS. 18x faster and 6x cheaper than competitors. Models: P-Video-Avatar, P-Image (for portrait generation). Capabilities: text-to-avatar, audio-driven avatars, 30 voices, 10 languages, 720p/1080p, built-in TTS, dynamic backgrounds, full-body control. Use for: AI presenters, product demos, explainer videos, virtual influencers, marketing, education, multilingual content, UGC, gaming avatars. Triggers: avatar video, talking head, ai avatar, p-video-avatar, pruna avatar, video avatar, ai presenter, digital human, virtual presenter, lipsync, talking avatar, ai spokesperson, heygen alternative, synthesia alternative, veed alternative, fabric alternative, omnihuman alternative

NeverSight/learn-skills.dev

Generate videos with Pruna P-Video and WAN models via inference.sh CLI. Models: P-Video, WAN-T2V, WAN-I2V. Capabilities: text-to-video, image-to-video, audio support, 720p/1080p, fast inference. Pruna optimizes models for speed without quality loss. Triggers: pruna video, p-video, pruna ai video, fast video generation, optimized video, wan t2v, wan i2v, economic video generation, cheap video generation, pruna text to video, pruna image to video

NeverSight/learn-skills.dev

Render videos from React/Remotion component code via inference.sh. Pass TSX code, get MP4. Supports all Remotion APIs: useCurrentFrame, useVideoConfig, spring, interpolate, AbsoluteFill, Sequence. Configurable resolution, FPS, duration, codec. Use for: programmatic video generation, animated graphics, motion design, data-driven videos, React animations to video. Triggers: remotion, render video from code, tsx to video, react video, programmatic video, remotion render, code to video, animated video, motion graphics code, react animation video

NeverSight/learn-skills.dev

Video ad creation with exact platform-specific specs for TikTok, Instagram, YouTube, Facebook, LinkedIn. Covers dimensions, duration limits, AIDA framework, and caption requirements. Use for: video ads, social media ads, paid media creative, video marketing, ad production. Triggers: video ad, social media ad, tiktok ad, instagram ad, youtube ad, facebook ad, linkedin ad, video creative, ad specs, paid media, video marketing, ad production, reels ad, stories ad, pre roll, bumper ad

NeverSight/learn-skills.dev

Best practices and techniques for writing effective AI video generation prompts. Covers: Veo, Seedance, Wan, Grok, Kling, Runway, Pika, Sora prompting strategies. Learn: shot types, camera movements, lighting, pacing, style keywords, negative prompts. Use for: improving video quality, getting consistent results, professional video prompts. Triggers: video prompt, how to prompt video, veo prompts, video generation tips, better ai video, video prompt engineering, video prompt guide, video prompt template, ai video tips, video prompt best practices, video prompt examples, cinematography prompts

NeverSight/learn-skills.dev

YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A/B testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image

NeverSight/learn-skills.dev

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

NeverSight/learn-skills.dev

Configure and use the hosted YouTube Data MCP end-to-end with minimal user input. Use when users want the agent to verify Node.js and `npx`, configure MCP server config (Windows/macOS, Cursor/Codex/OpenClaw/OpenCode), request API key at setup time, run post-install capability discovery (`tools/list` and `get_patch_notes`), and then strongly recommend helper skill and Python setup for full local document and spreadsheet workflows.

NeverSight/learn-skills.dev

Static artifact craft skill for self-contained HTML/CSS/JS documents: docs, sheets, dashboards, explainers, slides, tools, and landing pages. Use when the user asks for a durable, openable, shareable web deliverable they'll keep or hand off — a report, a dashboard, a slide deck, a data table, a page. Local folder first, temporary public link via tunnel (localhost.run), optional durable publish to Surge, GitHub Pages, or Cloudflare. Not for quick look renders, inline snippets, or throwaway scratch. Not for SPA frameworks, backend APIs, database apps, or production product UI.

NeverSight/learn-skills.dev

FFmpeg commands for video/audio conversion, trimming, compression, and processing. Use when user mentions "ffmpeg", "convert video", "compress video", "extract audio", "trim video", "gif from video", "video codec", "transcode", "screen recording", "merge videos", "video to mp4", "reduce file size", or any media processing task.

NeverSight/learn-skills.dev

Vim keybindings, motions, text objects, and operators for efficient text editing. Use when user asks about "vim commands", "vim motions", "text objects", "vim keybindings", "vim cheat sheet", "learn vim", "vim in VS Code", or any Vim editing tasks.

NeverSight/learn-skills.dev

Download YouTube videos, extract/proofread/translate subtitles, and render them onto video. Use whenever the user asks to download a YouTube video with subtitles, translate video subtitles to Chinese, add subtitles/burn subtitles to a video, or do ASR transcription on video audio. Covers the full pipeline: video download → subtitle extraction → proofreading → translation → SRT generation → subtitle rendering. Also use for "下载视频加字幕", "视频翻译字幕", "把字幕烧录到视频中". For pure subtitle file creation without rendering (just SRT output), this skill handles that too — stop before Phase 5.

NeverSight/learn-skills.dev

Grok Build ONLY. Turn a 2D character still into smooth animation sprites via image_gen/image_edit base → image_to_video (6s/10s run-in-place) → ffmpeg frames → magenta chroma-key → dense sampled sprites (strip/grid/GIF). Use when the user wants video-to-sprite, motion capture from generated video, smoother run/walk cycles from dense frames, or runs /video2dsprite. Do NOT use on Codex/Claude — only Grok Build has image_to_video. Prefer generate2dsprite for crisp pixel sheets without video.

相關技能