Communitygithub.com

Andersonlimahw/lemon-ai-hub

動作標記、彈簧預設值以及 React/Next.js (motion/react) 互動模式,用於影片中出現的產品 UI——忠實重建真實產品畫面,將其動畫化為可尋場景,並使實際產品的動作與影片保持一致。當動畫影片顯示或重現產品 UI 時使用;對於沒有影片交付物的網頁 UI 工作,請改用 design-expert。

lemon-ai-hub 是什麼?

這是一個專為產品 UI 動畫設計的 AI 技能,特別適合需要將真實產品 UI 重新製作成影片或保持 Web UI 與影片動畫一致的場景。它支援 React 和 Next.js 框架,並以 `motion/react` 為核心動畫庫。此技能的核心原則為「先定義動畫標記」,將持續時間、緩動函數、距離和彈簧參數集中管理,避免在元件中直接使用內聯數值。此外,它涵蓋了輔助功能(如減少動畫設定)、伺服器端渲染相容性,以及一系列常見 UI 互動模式的實作規則。對於影片製作,它強調以真實產品的設計標記為基礎進行精準復刻,而非重新設計,並使用絕對時間驅動動畫以達到可尋的影片效果。最後,它也包含了效能與可及性驗證的建議。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Andersonlimahw/lemon-ai-hub/tree/HEAD/plugins/motion-movie-expert/skills/ui-motion-patterns

在你喜歡的 AI 中提問

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

說明文件

UI 動畫模式

兩項任務:在網頁上為真實產品 UI 添加動畫,以及在不重新設計的情況下為影片重建產品 UI。兩者使用相同的標記。

1. 先定義標記

一次性定義動畫,並在各地引入使用。元件中避免使用內聯數值。

// lib/motion-tokens.ts
export const motionTokens = {
  duration: { instant: 0.1, fast: 0.18, normal: 0.3, slow: 0.5, scene: 0.7 },
  easing: {
    standard: [0.2, 0, 0, 1],   // 進入 + 移動
    exit: [0.4, 0, 1, 1],       // 離開
    emphasized: [0.3, 0, 0, 1],
  },
  distance: { nudge: 4, small: 8, medium: 16, large: 32 },
  stagger: 0.06,                // 保持在 0.05 到 0.10 之間
} as const;

export const springs = {
  press:   { type: "spring", stiffness: 600, damping: 38 },  // 按鈕、切換開關
  snappy:  { type: "spring", stiffness: 420, damping: 34 },  // 晶片、選單
  gentle:  { type: "spring", stiffness: 260, damping: 27 },  // 卡片、面板
  layout:  { type: "spring", stiffness: 320, damping: 30 },  // 重新排序、調整大小
  camera:  { type: "spring", stiffness: 140, damping: 20 },  // 大幅移動,僅用於影片
} as const;

在質量為 1 的情況下,阻尼比 ζ = damping / (2·√stiffness):press 0.78、snappy 0.83、gentle 0.84、layout 0.84、camera 0.85 — 全部落在 0.75–0.90 的區間內(超調量 ≤ ~6%)。可根據品牌需求使用該公式進行調整,並將此表作為單一來源。

2. 輔助功能與 SSR

"use client";
import { useReducedMotion } from "motion/react";

export function useSafeMotion() {
  const reduce = useReducedMotion();
  return {
    reduce,
    // 減少動畫:移除變形,保留短暫的不透明度變化(≤0.2 秒)
    enter: reduce ? { opacity: 1 } : { opacity: 1, y: 0 },
    initial: reduce ? { opacity: 0 } : { opacity: 0, y: 8 },
    transition: reduce ? { duration: 0.2 } : undefined,
  };
}
  • 對於首次繪製時已可見的元素,請使用 initial={false} 以避免水合閃爍。
  • 僅對 transform 和 opacity 進行動畫處理。切勿在循環中對 width、height、top、left 或 box-shadow 進行動畫處理;應改用 layout 或 scale。
  • 低端裝置:縮短持續時間並跳過裝飾性動畫。

3. 模式及其規則

模式規則
按鈕按壓whileTap={{ scale: 0.96 }} 搭配 springs.press;在 100 毫秒內提供回饋
條件式渲染使用 AnimatePresence 包裹,並附上穩定的 key;每個 initial + animate 都需搭配一個 exit
頁面/路由轉場AnimatePresence mode="wait":退出動畫完成後才開始進入動畫
列表交錯顯示staggerChildren 0.05–0.10 秒;交錯項目標上限約為 8 個,其餘項目同時出現
重新排序/調整大小僅在小型子樹(≲5 個子元素)上使用 layout;否則使用明確的 x/y
模態框/底部面板焦點陷阱、Escape 鍵關閉、滾動鎖定、role="dialog"、aria-modal="true"、歸還焦點
提示訊息從其所處的邊緣進入;自動消失,懸停或聚焦時暫停
數字變化垂直滾動:舊值向上移出並模糊,新值從下方進入;使用 font-variant-numeric: tabular-nums
滾動觸發顯示使用 whileInView 搭配 viewport={{ once: true }};切勿在滾出後重新觸發動畫
載入 → 成功按鈕壓縮 → 旋轉載入圖示 → 打勾;保持按鈕寬度穩定

4. 為影片重建產品 UI

  • 測量,而非猜測。 從產品原始碼或計算後的樣式中取得標記:顏色、圓角、字型系列/粗細/字距、間距、圖示集和筆畫粗細。從真實螢幕截圖中取樣顏色並進行比較。
  • 預設採用混合方式。 使用真實螢幕截圖作為背景;僅重建會動畫化的元素,並與其像素級對齊。
  • 未經明確許可,切勿重新設計。 不使用新的顏色、字型、圖示或文案。
  • 捕捉乾淨的畫面。 使用登出或示範帳號、虛構資料、不包含個資,也不包含第三方品牌(除非使用者擁有該品牌)。
  • 可尋的。 在影片中,每個動畫值都應由絕對時間驅動(value = f(t)),而非來自 motion/react 的執行時狀態。在實際網站上使用 motion/react;對於渲染後的影片,則使用閉合形式的彈簧或 GSAP 時間軸。

當這些模式應用於網站而非影片時,請在發佈前執行 design-expert 驗證關卡(鍵盤、焦點、減少動畫、效能)。

Individual skills in this repo

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

Andersonlimahw/lemon-ai-hub

When the user wants to plan a product launch, feature announcement, or release strategy. Also use when the user mentions 'launch,' 'Product Hunt,' 'feature release,' 'announcement,' 'go-to-market,' 'beta launch,' 'early access,' 'waitlist,' 'product update,' 'how do I launch this,' 'launch checklist,' 'GTM plan,' or 'we're about to ship.' Use this whenever someone is preparing to release something publicly. For ongoing marketing after launch, see marketing-ideas. For the offer being launched (bonuses, guarantees, scarcity, naming), see offers.

Andersonlimahw/lemon-ai-hub

Create and edit motion videos end to end — product motion films, motion graphics, narrated explainers, captioned clips, UI animation recreations, and recuts. Orchestrates brief, storyboard, choreography, build (HyperFrames or any deterministic renderer), voice/caption sync, and render QC. Use when the user asks to make, animate, storyboard, narrate, caption, edit, or render a video or motion piece; skip for static images and web UI work with no video deliverable.

Andersonlimahw/lemon-ai-hub

Build and render a deterministic video composition — HyperFrames (HTML + GSAP) by default, or a custom seek(t) + Playwright + FFmpeg pipeline. Covers project setup, composition contract, timeline rules, creative direction for frames, lint/check/snapshot, preview, and local render. Use when implementing an approved storyboard as code.

Andersonlimahw/lemon-ai-hub

Motion law for multi-scene videos — seam continuity (axis, direction, speed, phase), carriers, causal motion, springs and timing, camera, transitions, stillness, and loop design. Use when planning or fixing how scenes connect and move, before and during any animation build.

Andersonlimahw/lemon-ai-hub

Short design-led motion graphics where motion is the message — kinetic typography, stat count-up, chart/data-viz reveal, logo sting, lower third or callout, animated map, tweet/news/headline card, webpage or UI walkthrough, and image-plus-data fusion. Usually under 10 s, up to about 30 s, no narration; renders to MP4 or a transparent overlay. Use when the user wants a short motion graphic, animated stat/chart/logo/map/card, or overlay; when the upstream HyperFrames `motion-graphics` skill is installed, use it for exact CLI flags and registry blocks.

Andersonlimahw/lemon-ai-hub

Turn a video idea, product, or script into an approved master prompt and pre-implementation storyboard — intake, concept, 8–12 state sequence, beat grid, transition map, camera plan, audio cue plan, and render architecture. Use before building any new video, or when a video brief is vague.

Andersonlimahw/lemon-ai-hub

Edit existing video and verify any render before delivery — recut, trim, reframe to other aspect ratios, burn in or attach captions, swap or remix audio, loop, and export; plus the QC gates (probe, contact sheet, stills per beat, loudness, loop seam, legibility, facts, PII). Use for editing footage or for the final check of any motion video.

Andersonlimahw/lemon-ai-hub

Synchronize narration, captions, music, and SFX with picture — narration writing, script lock, TTS or recorded voiceover, word-level timestamps, caption blocks, shot windows derived from the voice track, dwell budgets, ducking, and loudness targets. Use for narrated explainers, voiceover changes, subtitles, or any video where timing must follow audio.

Andersonlimahw/lemon-ai-hub

Agent skill at plugins/video/SKILL.md

相關技能