Communitygithub.com

Bewegungsmuster (Motion Patterns)

Produktionsreife Animationsmuster für React / Next.js – Button, Modal, Toast, Staffelung, Seitenübergänge, Exit-Animationen, Scroll und Layout – basierend auf motion-foundations-Tokens und Federn.

Was ist Bewegungsmuster (Motion Patterns)?

Dieses Skill stellt eine umfassende Sammlung von kopierfertigen Animationsmustern für React- und Next.js-Anwendungen bereit. Es deckt die häufigsten UI-Animationen ab: Button-Feedback, modale Dialoge, Toast-Benachrichtigungen, gestaffelte Listeneingänge, Seitenübergänge im Next.js App Router, Scroll-Enthüllungen und Layout-Animationen. Der Fokus liegt auf Barrierefreiheit, SSR-Sicherheit und der ausschließlichen Verwendung von Tokens und Federn aus der `motion-foundations`-Bibliothek – keine direkten Zahlen oder Easing-Kurven. Das Skill ist kompatibel mit den Agenten Claude Code, Cursor und Codex. Es folgt strengen Regeln: Jede bedingte Darstellung muss in `AnimatePresence` mit einem `key` und einer `exit`-Animation eingeschlossen sein; Seitenübergänge verwenden `mode="wait"`; Staffelungsintervalle liegen zwischen 0,05 und 0,10 Sekunden; Module sind barrierefrei mit Fokusfalle, Escape-Taste und `role="dialog"`. Das Skill bietet außerdem Entscheidungshilfen zur Auswahl des richtigen Musters und kennzeichnet Anti-Patterns.

Funktioniert mit~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/Cody-W-Tucker/skills/tree/HEAD/skills/motion-patterns

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht Bewegungsmuster (Motion Patterns)?

Kopierfertige Muster für die häufigsten UI-Animationen. Jedes Muster hier basiert auf motion-foundations-Tokens und Federn. Definiere keine neuen Dauer- oder Easing-Werte – importiere sie.

Wann aktivieren

  • Animieren eines Buttons, einer Karte, eines Modals oder einer Toast-Benachrichtigung
  • Erstellen von Listeneingängen mit Staffelung
  • Einrichten von Seitenübergängen im Next.js App Router
  • Hinzufügen von Ein- oder Ausgangsanimationen zu bedingten Inhalten
  • Implementieren von Scroll-Reveal, scrollgebundenem Fortschritt oder klebrigen Story-Abschnitten
  • Erstellen von expandierenden Karten, Akkordeons oder Shared-Element-Übergängen

Ausgaben

Dieses Skill produziert:

  • Barrierefreie, SSR-sichere Animationen für alle Standard-UI-Komponenten
  • AnimatePresence-umwickelte bedingte Darstellungen mit korrektem Exit-Verhalten
  • Seitenübergangs-Wrapper-Komponente für den Next.js App Router
  • Scroll-Reveal- und scrollgebundene Muster mit useScroll + useTransform
  • Layout-Animationen (layout, layoutId) für expandierende und überblendende Elemente

Prinzipien

  • Jedes Muster importiert aus motion-foundations. Keine rohen Zahlen.
  • Jede bedingte Darstellung wird in AnimatePresence mit einem key umwickelt.
  • Exit-Animationen werden immer zusammen mit Enter-Animationen definiert – nie als nachträglicher Einfall.
  • layout wird nur für kleine, isolierte Verschiebungen verwendet. Große Teilbäume erhalten explizite Transformationen.

Regeln

  1. Umwickle bedingte Darstellungen immer mit AnimatePresence und einem key auf dem direkten Kind. Ohne einen Schlüssel feuern Exit-Animationen nie.
  2. Definiere immer exit, wenn du initial + animate definierst. Eine Animation ohne Exit ist unvollständig.
  3. Verwende mode="wait" bei Seitenübergängen. Enter darf erst beginnen, wenn der Exit abgeschlossen ist.
  4. Verwende niemals layout auf Teilbäumen mit mehr als ~5 Kindern oder tief verschachteltem DOM. Verwende stattdessen explizite x/y-Transformationen.
  5. Das Staffelungsintervall muss zwischen 0.05s und 0.10s liegen. Darunter wirkt es mechanisch; darüber wirkt es träge.
  6. Module müssen immer enthalten: Fokusfalle, Escape-Taste zum Schließen, Scroll-Sperre, role="dialog", aria-modal="true".
  7. Scroll-Reveals verwenden viewport={{ once: true }}. Wiederholen beim Rausscrollen lenkt ab, informiert nicht.
  8. Alle Token-Werte werden aus motion-foundations importiert. Keine Inline-Zahlen.

Entscheidungshilfe

Das richtige Muster wählen

SituationMuster
Element erscheint / verschwindetAnimatePresence
Liste von Elementen wird nacheinander geladenStaffelungs-Varianten
Navigation zwischen RoutenSeitenübergangs-Wrapper
Element ändert seine Größe an Ort und Stellelayout-Prop
Gleiches Element bewegt sich über Seitenkontexte hinweglayoutId
Element erscheint, wenn es in den Viewport gescrollt wirdwhileInView
Wert an die Scroll-Position gebundenuseScroll + useTransform

Wann mode="wait" vs mode="sync" verwenden

ModusVerwenden wenn
waitSeitenübergänge, Inhaltswechsel (eines nach dem anderen)
syncGestapelte Benachrichtigungen, Listenelemente (Überlappung ist okay)
popLayoutElemente aus einer umfließenden Liste entfernt werden

Kernkonzepte

AnimatePresence-Vertrag

Drei Dinge müssen immer wahr sein:

  1. AnimatePresence umwickelt das Bedingte
  2. Das direkte Kind hat einen key
  3. Das Kind hat eine exit-Prop

Fehlt eines davon, schlägt die Exit-Animation still fehl.

layout vs layoutId

  • layout – animiert die eigene Größen-/Positionsänderung des Elements an Ort und Stelle
  • layoutId – verknüpft zwei separate Elemente und blendet sie rendernübergreifend über

Verwende layout="position" auf Text innerhalb eines expandierenden Containers, um zu verhindern, dass Textumbrüche animiert werden.

Code-Beispiele

Button-Feedback

"use client"
import { motion } from "motion/react"
import { springs, motionTokens } from "@/lib/motion-tokens"

<motion.button
  whileHover={{ scale: motionTokens.scale.pop }}
  whileTap={{ scale: motionTokens.scale.press }}
  transition={springs.snappy}
/>

Gestaffelte Liste

"use client"
import { motion } from "motion/react"
import { motionTokens, springs } from "@/lib/motion-tokens"

const container = {
  hidden: {},
  visible: {
    transition: {
      staggerChildren: 0.08,   // innerhalb der 0.05–0.10 Regel
      delayChildren: 0.1,
    },
  },
}

const item = {
  hidden:  { opacity: 0, y: motionTokens.distance.md },
  visible: { opacity: 1, y: 0, transition: springs.gentle },
}

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

Modal

"use client"
import { motion, AnimatePresence } from "motion/react"
import { motionTokens, springs } from "@/lib/motion-tokens"

// Am Aufrufort umwickeln:
// <AnimatePresence>{isOpen && <Modal key="modal" />}</AnimatePresence>

export function Modal({ onClose }: { onClose: () => void }) {
  return (
    <>
      {/* Overlay */}
      <motion.div
        className="fixed inset-0 bg-black/50"
        initial={{ opacity: 0 }}
        animate={{ opacity: 1 }}
        exit={{ opacity: 0 }}
        onClick={onClose}
      />

      {/* Panel – Barrierefreiheitsanforderungen: Fokusfalle, Escape zum Schließen,
          Scroll-Sperre, role="dialog", aria-modal="true" */}
      <motion.div
        role="dialog"
        aria-modal="true"
        className="fixed inset-x-4 top-1/2 -translate-y-1/2 rounded-xl bg-white p-6"
        initial={{
          opacity: 0,
          scale: motionTokens.scale.press,
          y: motionTokens.distance.sm,
        }}
        animate={{ opacity: 1, scale: 1, y: 0 }}
        exit={{
          opacity: 0,
          scale: motionTokens.scale.press,
          y: motionTokens.distance.sm,
        }}
        transition={springs.gentle}
      />
    </>
  )
}

Toast-Stapel

"use client"
import { motion, AnimatePresence } from "motion/react"
import { motionTokens, springs } from "@/lib/motion-tokens"

<AnimatePresence mode="sync">
  {toasts.map((t) => (
    <motion.div
      key={t.id}
      layout
      initial={{
        opacity: 0,
        x: motionTokens.distance.xl,
        scale: motionTokens.scale.subtle,
      }}
      animate={{ opacity: 1, x: 0, scale: 1 }}
      exit={{
        opacity: 0,
        x: motionTokens.distance.xl,
        scale: motionTokens.scale.subtle,
      }}
      transition={springs.snappy}
    />
  ))}
</AnimatePresence>

Seitenübergang (Next.js App Router)

// components/page-transition.tsx
"use client"
import { motion, AnimatePresence } from "motion/react"
import { usePathname } from "next/navigation"
import { motionTokens } from "@/lib/motion-tokens"

const variants = {
  initial: { opacity: 0, y: motionTokens.distance.sm },
  enter:   { opacity: 1, y: 0 },
  exit:    { opacity: 0, y: -motionTokens.distance.sm },
}

export function PageTransition({ children }: { children: React.ReactNode }) {
  const pathname = usePathname()
  return (
    <AnimatePresence mode="wait">
      <motion.div
        key={pathname}
        variants={variants}
        initial="initial"
        animate="enter"
        exit="exit"
        transition={{
          duration: motionTokens.duration.normal,
          ease: motionTokens.easing.smooth,
        }}
      >
        {children}
      </motion.div>
    </AnimatePresence>
  )
}

Scroll-Reveal

"use client"
import { motion } from "motion/react"
import { motionTokens, springs } from "@/lib/motion-tokens"

<motion.div
  initial={{ opacity: 0, y: motionTokens.distance.lg }}
  whileInView={{ opacity: 1, y: 0 }}
  viewport={{ once: true, margin: "-80px" }}   // once: true – Regel 7
  transition={{ duration: motionTokens.duration.slow, ease: motionTokens.easing.smooth }}
/>

Scroll-Fortschrittsbalken

"use client"
import { motion, useScroll } from "motion/react"

export function ScrollProgress() {
  const { scrollYProgress } = useScroll()
  return (
    <motion.div
      className="fixed top-0 left-0 h-1 bg-indigo-500 origin-left w-full"
      style={{ scaleX: scrollYProgress }}
    />
  )
}

Expandierende Karte

"use client"
import { useState } from "react"
import { motion, AnimatePresence } from "motion/react"
import { springs, motionTokens } from "@/lib/motion-tokens"

export function ExpandingCard({ title, body }: { title: string; body: string }) {
  const [expanded, setExpanded] = useState(false)

  return (
    <motion.div layout onClick={() => setExpanded(!expanded)} className="cursor-pointer">
      {/* layout="position" verhindert, dass Textumbrüche animieren */}
      <motion.h2 layout="position" className="font-semibold">
        {title}
      </motion.h2>

      <AnimatePresence>
        {expanded && (
          <motion.p
            key="body"
            initial={{ opacity: 0 }}
            animate={{ opacity: 1 }}
            exit={{ opacity: 0 }}
            transition={{ duration: motionTokens.duration.fast }}
          >
            {body}
          </motion.p>
        )}
      </AnimatePresence>
    </motion.div>
  )
}

Shared-Element-Überblendung

// Quellkontext
<motion.img layoutId="hero-image" src={src} className="w-16 h-16 rounded" />

// Zielkontext (gleiche layoutId – motion übernimmt den Übergang)
<motion.img layoutId="hero-image" src={src} className="w-full rounded-xl" />

Akkordeon

<motion.div
  initial={false}
  animate={{ opacity: open ? 1 : 0, scaleY: open ? 1 : 0 }}
  style={{ transformOrigin: "top", overflow: "hidden" }}
  transition={{
    duration: motionTokens.duration.normal,
    ease: motionTokens.easing.smooth,
  }}
>
  {children}
</motion.div>

End-to-End-Beispiel

Eine gestaffelte Liste, die beim Mounten erscheint, bedingte Anwesenheit behandelt und reduzierte Bewegung respektiert – kombiniert Tokens, Federn, AnimatePresence und den Accessibility-Hook aus motion-foundations:

"use client"
import { useState } from "react"
import { motion, AnimatePresence } from "motion/react"
import { motionTokens, springs } from "@/lib/motion-tokens"
import { useSafeMotion } from "@/hooks/use-reduced-motion"

const containerVariants = {
  hidden: {},
  visible: {
    transition: { staggerChildren: 0.08, delayChildren: 0.1 },
  },
}

function ListItem({ label, onRemove }: { label: string; onRemove: () => void }) {
  const safe = useSafeMotion(motionTokens.distance.sm)
  return (
    <motion.li
      variants={{
        hidden:  safe.initial,
        visible: safe.animate,
      }}
      exit={safe.exit}
      transition={springs.gentle}
      className="flex items-center justify-between p-3 rounded-lg bg-white shadow-sm"
    >
      <span>{label}</span>
      <button onClick={onRemove}>Entfernen</button>
    </motion.li>
  )
}

export function AnimatedList({ items, onRemove }: {
  items: { id: string; label: string }[]
  onRemove: (id: string) => void
}) {
  return (
    <motion.ul
      variants={containerVariants}
      initial="hidden"
      animate="visible"
      className="space-y-2"
    >
      <AnimatePresence mode="popLayout">
        {items.map((item) => (
          <ListItem
            key={item.id}
            label={item.label}
            onRemove={() => onRemove(item.id)}
          />
        ))}
      </AnimatePresence>
    </motion.ul>
  )
}

Einschränkungen / Nicht-Ziele

Dieses Skill deckt nicht ab:

  • Token- und Federdefinitionen → siehe motion-foundations
  • Drag-Interaktionen, Wischgesten, neu anordenbare Listen → siehe motion-advanced
  • Textanimationen (Wort-/Zeichen-Enthüllung, Zähler) → siehe motion-advanced
  • SVG-Pfadzeichnung oder -Morphing → siehe motion-advanced
  • Benutzerdefinierte Animations-Hooks → siehe motion-advanced
  • CSS-only-Transitionen ohne Verwendung von motion/react

Anti-Patterns

Anti-PatternVerstoß gegen RegelBehebung
AnimatePresence-Kind ohne keyRegel 1Stabilen key zum direkten Kind hinzufügen
initial + animate ohne exitRegel 2Immer alle drei zusammen definieren
Seitenübergang ohne mode="wait"Regel 3mode="wait" zu AnimatePresence hinzufügen
layout auf einer Liste mit 50 ElementenRegel 4mode="popLayout" oder explizite Transformationen verwenden
staggerChildren: 0.2 auf einer Liste mit 10 ElementenRegel 5Auf 0.08–0.10 begrenzen
Modal ohne FokusfalleRegel 6focus-trap-react oder Radix Dialog hinzufügen
whileInView ohne viewport={{ once: true }}Regel 7Wiederholte Eingänge lenken ab, informieren nicht
transition={{ duration: 0.3 }} inlineRegel 8motionTokens.duration.normal verwenden

Verwandte Skills

  • motion-foundations – definiert alle Tokens, Federn, den useSafeMotion-Hook und SSR-Guards, die jedes Muster hier importiert. Muss zuerst eingerichtet werden.
  • motion-advanced – erweitert diese Muster um Drag, Gesten, SVG, Text, benutzerdefinierte Hooks und imperative Sequenzen. Definiert keine Muster aus diesem Skill neu.

Individual skills in this repo

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

Cody-W-Tucker/skills

Landing page quality assessment for paid advertising campaigns. Evaluates message match, page speed, mobile experience, trust signals, form optimization, and conversion rate potential. Use when user says landing page, post-click experience, landing page audit, conversion rate, or landing page optimization.

Cody-W-Tucker/skills

TikTok Ads deep analysis covering creative quality, tracking, bidding, campaign structure, and TikTok Shop. Evaluates 28 checks with emphasis on creative-first strategy, safe zone compliance, and Smart+ campaigns. Use when user says TikTok Ads, TikTok marketing, TikTok Shop, Spark Ads, Smart+, or TikTok campaign.

Cody-W-Tucker/skills

YouTube Ads specific analysis covering campaign types, creative quality, audience targeting, and measurement. Evaluates video ad performance across skippable, non-skippable, bumper, Shorts, Demand Gen, and Connected TV formats. Covers VAC→Demand Gen migration, Shorts creative requirements, and CTV shoppable ads. Use when user says YouTube Ads, video ads, pre-roll, bumper ads, YouTube campaign, Shorts ads, or CTV ads.

Cody-W-Tucker/skills

Craft the story that makes investors say \"I want in.\" Master the narrative structure that Reid Hoffman, Sequoia, and top founders use to raise capital. Use when: **Preparing to fundraise** to develop your story before the deck; **Investor meetings** to structure conversations that convert; **Pitch practice** to refine your narrative arc; **Cold outreach** to write compelling investor emails; **Pivoting** to reframe your story after a change

Cody-W-Tucker/skills

Identify the best GTM motions and tools across 7 motion types: Inbound, Outbound, Paid Digital, Community, Partners, ABM, and PLG. Use when selecting marketing channels, choosing between inbound and outbound strategy, or planning cross-channel campaigns.

Cody-W-Tucker/skills

Produce a print-grade single-page kami (紙 / 纸) document — warm parchment canvas, ink-blue accent, serif at one weight, no italic, no cool grays. The output reads like a professional white paper or studio one-pager, not an app UI. Multilingual by design (EN · zh-CN · ja). One self-contained HTML file, zero dependencies.

Cody-W-Tucker/skills

Optimize landing pages for maximum conversions using proven frameworks from Unbounce and Oli Gardner—apply the \"one goal, one message, one action\" principle with data-driven design, copy, and CTA best practices. Use when: **Create a new landing page** for a campaign; **Optimize an existing landing page** that isn't converting; **Review landing page design** before launch; **Improve form conversion rates** on lead gen pages; **A/B test landing page elements** systematically

Cody-W-Tucker/skills

Advanced motion patterns for React / Next.js — drag & drop, gestures, text animations, SVG path drawing, custom hooks, imperative sequences (useAnimate), loaders, and the full API decision tree. Requires motion-foundations.

Cody-W-Tucker/skills

Motion tokens, spring presets, performance rules, device adaptation, accessibility enforcement, and SSR safety for React / Next.js using motion/react. Foundation layer — all other motion skills depend on this.

Cody-W-Tucker/skills

A single-frame motion-design composition with looping CSS animations — rotating type ring, animated globe, ticking timer, parallax labels. Renders as a hero video poster you can hand straight to HyperFrames or any keyframe-based exporter. Use when the brief asks for "motion design", "animated hero", "loop", "video poster", "title card", or pairs Open Claude Design with HyperFrames for a kinetic export.

Cody-W-Tucker/skills

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

Cody-W-Tucker/skills

Produce a single-file slide deck in the Atelier Zero visual language (warm-paper background, italic-serif emphasis spans, coral terminating dots, surreal collage plates) — Open Design's brand deck recipe. The deck uses **horizontal magazine-style swipe pagination** (←/→, wheel, swipe), a per-slide chrome strip with brand mark and slide counter, an ESC overview grid, a coral progress bar, and inherits the canonical stylesheet + 16-slot image library from the sister `open-design-landing` skill.

Cody-W-Tucker/skills

Produce a world-class single-page editorial landing site in the Atelier Zero visual language (Monocle / Apartamento / Études editorial collage) — the same aesthetic Open Design uses for its own marketing surface. The agent fills a typed `inputs.json` from a brand brief, optionally generates 16 collage assets via gpt-image-2, then runs a pure-function composer that emits a self-contained HTML file; a separate path can mirror the Astro marketing site in `apps/landing-page/`. Drop-in scroll-reveal motion and a Headroom-style sticky nav are wired automatically.

Cody-W-Tucker/skills

Best practices for Remotion - Video creation in React. 29 domain-specific rules covering 3D, animations, audio, captions, charts, transitions, and more.

Cody-W-Tucker/skills

Single-page SaaS landing with hero, features, social proof, pricing, and CTA. Respects the active DESIGN.md color/typography/layout tokens. Trigger keywords: "saas landing", "marketing page", "product landing".

Cody-W-Tucker/skills

Single-page SaaS landing with hero, features, social proof, pricing, and CTA. Respects the active DESIGN.md color/typography/layout tokens. Trigger keywords: "saas landing", "marketing page", "product landing".

Cody-W-Tucker/skills

Master April Dunford's 8-step sales narrative from \"Sales Pitch\" (2023). Transform your positioning into a compelling story that wins enterprise deals. Use when: Structuring B2B sales presentations and demos; Creating pitch decks for complex products; Training sales teams on narrative-driven selling; Converting positioning strategy into sales conversations; Winning against entrenched competitors

Cody-W-Tucker/skills

Swiss-style user-research narrative template in warm-paper editorial aesthetics. Use when users ask for a premium research deck or story-first live artifact with minimalist typography, high-clarity layout, subtle motion, donut breakdowns, and keyboard/click navigation across slides in a single HTML file.

Cody-W-Tucker/skills

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

Cody-W-Tucker/skills

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.

Verwandte Skills