Communitygithub.com

Andersonlimahw/lemon-ai-hub

Motion tokens, spring presets, and React/Next.js (motion/react) interaction patterns for product UI that appears in a video — rebuilding real product screens faithfully, animating them as seekable scenes, and keeping the live product's motion consistent with the film. Use when a motion video shows or recreates product UI; for web UI work with no video deliverable use design-expert instead.

lemon-ai-hub 是什么?

lemon-ai-hub is a Claude Code agent skill that motion tokens, spring presets, and React/Next.js (motion/react) interaction patterns for product UI that appears in a video — rebuilding real product screens faithfully, animating them as seekable scenes, and keeping the live product's motion consistent with the film. Use when a motion video shows or recreates product UI; for web UI work with no video deliverable use design-expert instead.

兼容平台~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 Motion Patterns

Two jobs: animate real product UI on the web, and rebuild product UI for video without redesigning it. Both use the same tokens.

1. Tokens first

Define motion once and import it everywhere. No inline numbers in components.

// 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],   // enter + move
    exit: [0.4, 0, 1, 1],       // leave
    emphasized: [0.3, 0, 0, 1],
  },
  distance: { nudge: 4, small: 8, medium: 16, large: 32 },
  stagger: 0.06,                // keep between 0.05 and 0.10
} as const;

export const springs = {
  press:   { type: "spring", stiffness: 600, damping: 38 },  // buttons, toggles
  snappy:  { type: "spring", stiffness: 420, damping: 34 },  // chips, menus
  gentle:  { type: "spring", stiffness: 260, damping: 27 },  // cards, panels
  layout:  { type: "spring", stiffness: 320, damping: 30 },  // reorder, resize
  camera:  { type: "spring", stiffness: 140, damping: 20 },  // big moves, video only
} as const;

With mass 1, damping ratio ζ = damping / (2·√stiffness): press 0.78, snappy 0.83, gentle 0.84, layout 0.84, camera 0.85 — all inside the 0.75–0.90 band (overshoot ≤ ~6 %). Adjust per brand with that formula, and keep this table the single source.

2. Accessibility and SSR

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

export function useSafeMotion() {
  const reduce = useReducedMotion();
  return {
    reduce,
    // reduced motion: drop transforms, keep short opacity changes (≤0.2 s)
    enter: reduce ? { opacity: 1 } : { opacity: 1, y: 0 },
    initial: reduce ? { opacity: 0 } : { opacity: 0, y: 8 },
    transition: reduce ? { duration: 0.2 } : undefined,
  };
}
  • Use initial={false} for elements already visible on first paint to avoid hydration flashes.
  • Animate transform and opacity only. Never animate width, height, top, left, or box-shadow in loops; use layout or scale instead.
  • Low-end devices: shorten durations and skip decorative motion.

3. Patterns and their rules

PatternRule
Button presswhileTap={{ scale: 0.96 }} with springs.press; feedback within 100 ms
Conditional renderwrap in AnimatePresence with a stable key; every initial + animate gets an exit
Page / route transitionAnimatePresence mode="wait": exit completes before enter
List staggerstaggerChildren 0.05–0.10 s; cap staggered items at ~8, the rest appear together
Reorder / resizelayout on small subtrees only (≲5 children); otherwise explicit x/y
Modal / sheetfocus trap, Escape closes, scroll lock, role="dialog", aria-modal="true", return focus
Toastenters from the edge it lives on; auto-dismiss pauses on hover/focus
Number changevertical roll: old value exits up with blur, new enters from below; font-variant-numeric: tabular-nums
Scroll revealwhileInView with viewport={{ once: true }}; never re-animate on scroll-out
Loading → successbutton compresses → spinner → check; keep the button's width stable

4. Rebuilding product UI for video

  • Measure, do not guess. Take tokens from the product source or computed styles: colors, radii, font family/weights/tracking, spacing, icon set and stroke. Sample colors from real screenshots and compare.
  • Hybrid default. Real screenshot as context; rebuild only the elements that animate, pixel-aligned over it.
  • Never redesign without explicit approval. No new colors, fonts, icons, or copy.
  • Capture clean. Logged out or demo account, fictional data, no PII, no third-party brands unless the user owns them.
  • Seekable. In video, drive every animated value from absolute time (value = f(t)), not from motion/react runtime state. Use motion/react for the live web, closed-form springs or GSAP timelines for rendered video.

When these patterns are used on a website rather than a video, run the design-expert verification gate (keyboard, focus, reduced motion, performance) before shipping.

Individual skills in this repo

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

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

相关技能