creative-web-motion
/creative-web-motion
Dodaje animacje przewijania i interakcji w React i Next.js przez GSAP, w 34 wzorcach z wersją dla ograniczonego ruchu.
- Autor
- AfkanOzdemir ↗
- Repozytorium
- creative-web-skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 05.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 3
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 05.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Dodaje animacje przewijania i interakcji w React i Next.js przez GSAP, w 34 wzorcach z wersją dla ograniczonego ruchu.
Wyzwalacze z opisu
Oryginalny opis (EN)
GSAP + React/Next.js scroll and interaction motion — pinned step stories, horizontal tracks, stacking cards, SplitText and ScrambleText reveals, Flip morphs, Draggable carousels, SVG drawing, image-sequence scrub, magnetic buttons and the driver-object bridge to WebGL. 34 patterns, each with a reduced-motion fallback. Use when the user asks to animate a section, add scroll effects, pin or scrub content, make a page "more animated", or connect scroll to a three.js scene. Do NOT use for choosing a 3D scene (use creative-web-webgl) or deciding a widget's content (use creative-web-widgets).
Jak działa
- Critical
- Setup (once per module)
- The driver object (GSAP → WebGL bridge)
- Pinned N-step story (the core recipe)
- Rules of thumb
- Troubleshooting
- Workflow
- Examples
Podgląd SKILL.md
---
name: creative-web-motion
description: GSAP + React/Next.js scroll and interaction motion — pinned step stories, horizontal tracks, stacking cards, SplitText and ScrambleText reveals, Flip morphs, Draggable carousels, SVG drawing, image-sequence scrub, magnetic buttons and the driver-object bridge to WebGL. 34 patterns, each with a reduced-motion fallback. Use when the user asks to animate a section, add scroll effects, pin or scrub content, make a page "more animated", or connect scroll to a three.js scene. Do NOT use for choosing a 3D scene (use creative-web-webgl) or deciding a widget's content (use creative-web-widgets).
license: MIT
compatibility: Works in Claude Code, Codex, Cursor, OpenCode and claude.ai. Requires gsap 3.13+ and @gsap/react in a React 18+ or Next.js project.
metadata:
author: afkanozdemir
version: 1.0.1
suite: creative-web
tags: [frontend, design, motion]
---
# Motion storytelling (GSAP + React)
Builds on the official GSAP skills (`gsap-react`, `gsap-scrolltrigger`, `gsap-plugins`). All GSAP plugins
(SplitText, ScrambleText, MorphSVG, DrawSVG, Inertia…) ship free in the public `gsap` package.
## Critical
- Create every tween inside `useGSAP` + `gsap.matchMedia()` and return cleanup; nothing animates outside a context.
- Always add the `(prefers-reduced-motion: reduce)` branch that sets the final state.
- Animate transform, not opacity, for text that must stay readable mid-animation (contrast audits fail on half-faded text). If fading is unavoidable, floor opacity at 0.45.
- SplitText on non-heading elements uses `aria: 'none'`.
- Maximum one scrubbed or pinned "wow" per screenful.
- `references/patterns.md` — 33 patterns, each with when-to-use, code and reduced-motion fallback.
- `references/easing-and-timing.md` — durations, eases per motion personality, stagger and scrub values.
## Setup (once per module)
```tsx
'use client'
import gsap from 'gsap'
import { ScrollTrigger } from 'gsap/ScrollTrigger'
import { SplitText } from 'gsap/SplitText'
import { useGSAP } from '@gsap/react'
gsap.registerPlugin(ScrollTrigger, SplitText, useGSAP)
export const MOTION = '(prefers-reduced-motion: no-preference)'
```
Skeleton every pattern uses:
```tsx
useGSAP(() => {
const mm = gsap.matchMedia()
mm.add(MOTION, () => { /* tweens, triggers, listeners; return cleanup */ })
mm.add('(prefers-reduced-motion: reduce)', () => { /* set final state */ })
return () => mm.revert()
}, { scope: root })
```
## The driver object (GSAP → WebGL bridge)
A plain mutable object created once, passed to a scene as a prop. GSAP tweens it; the scene's frame loop
eases toward it.
```tsx
const [driver] = useState(() => ({ progress: 0, px: 0, py: 0 }))
tl.to(driver, { progress: i + 1, duration: 0.8, ease: 'power1.inOut' }, at)
// scene: u.value += (driver.progress - u.value) * 0.08
```
- Keep progress in step units (0..N) so shaders do `clamp(uP - k, 0, 1)` per phase.
- `react-hooks/immutability` lint flags mutating state objects in handlers → mutate inside the matchMedia
callback or use `gsap.set(driver, {...})`.
## Pinned N-step story (the core recipe)
```tsx
gsap.set(steps, { autoAlpha: 0, y: 50, filter: 'blur(10px)' })
gsap.set(bars, { scaleX: 0, transformOrigin: 'left center' })
const tl = gsap.timeline({ scrollTrigger: { trigger: root.current, start: 'top top', end: '+=420%', pin: true, scrub: 1 } })
tl.to('[data-intro]', { autoAlpha: 0, y: -40, scale: 0.94, duration: 0.5, ease: 'power2.in' }, 0)
steps.forEach((s, i) => {
const at = 0.5 + i * 1.1
tl.to(driver, { progress: i + 1, duration: 0.8, ease: 'power1.inOut' }, at - 0.2)
.to(s, { autoAlpha: 1, y: 0, filter: 'blur(0px)', duration: 0.35, ease: 'power2.out' }, at)
.to(bars[i], { scaleX: 1, duration: 1, ease: 'none' }, at)
if (i < steps.length - 1) tl.to(s, { autoAlpha: 0, y: -50, filter: 'blur(10px)', duration: 0.3, ease: 'power2.in' }, at + 0.8)
})
tl.to({}, { duration: 0.4 })
```
Steps share one grid cell (`col-start-1 row-start-1`), start `invisible`, are `aria-hidden`; a separate
`sr-only` list becomes visible under `motion-reduce:` so content is never lost.
## Rules of thumb
- One scrubbed "wow" per screenful; follow a pinned section with a static or trigger-once one.
- Animate **transform**, not opacity, for text that must stay legible mid-animation (contrast audits fail
on half-faded text). If you must fade, start at ≥0.45 opacity.
- SplitText on non-heading text: `aria: 'none'` (an `aria-label` on `<p>` is prohibited).
- Masks clip descenders/diacritics → `leading-[1.08] pb-[0.04em]` on masked titles.
- If split text can change, `key={text}` so React remounts before splitting.
- Pin-dependent triggers (e.g. header colour) must be created after the pin and target the pin-spacer.
- Only create tweens inside `useGSAP` / `mm.add` / `contextSafe` so they revert on unmount.
## Troubleshooting
| Symptom | Fix |
|---|---|
| Text flashes then vanishes | `immediateRender: false` on later `fromTo` |
| Header toggle ends early | trigger = pin-spacer, created after pin |
| Split title stale | `key={title}` |
| Descenders cut | leading/padding |
| Horizontal track jumps on resize | `x: () => -dist()`, `end: () => '+=' + dist()`, `invalidateOnRefresh: true` |
| Leaks after route change | everything inside matchMedia + return cleanup |
## Workflow
1. Write the section's micro-story in one sentence ("the step text swaps while the scene advances").
2. Read the dealt world's `## Motion grammar`: its eases, three durations and **signature move** override
the presets. Pick a pattern from `references/patterns.md` that fits that grammar; use
`references/easing-and-timing.md` only where the world is silent. The signature move appears once
per screen at most; everything else is quieter than it.
3. Make the markup the final state; animate *from* earlier states.
4. Wire triggers: scrub for reader-controlled stories, play-once for punctuation, pin only for showpieces (desktop).
5. Add the reduced-motion branch and a static fallback for pinned content.
6. Verify with `creative-web-qa` (pinned sections at 50% and 97%).
## Examples
**User says:** "Explain our four steps with a scroll animation like Apple does."
**Actions:** pinned N-step story (pattern 1) → driver object feeds a scene → segmented progress bar → `sr-only` list for reduced motion.
**Result:** a pinned section where each scroll beat swaps the step and advances the visual; content stays accessible.
**User says:** "These five principle cards are boring."
**Actions:** horizontal track with `containerAnimation` (pattern 2) → numbers rise per card → mobile falls back to a vertical stack with batch reveals.
**Result:** a sideways-scrolling track on desktop, a clean stacked list on mobile.
Pliki w paczce (3)
- SKILL.md 7 KB
- references/easing-and-timing.md 2 KB
- references/patterns.md 18 KB
Wersje
W bazie nie ma innych skilli o nazwie creative-web-motion.
Migawka bazy z 13.11.2026 · wersja paczki 8e72c65eaf37 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 90gsap
Tworzy animacje GSAP do stron: osie czasu, scroll, rozbijanie nagłówków, przejścia i płynne przewijanie w vanilla JS i w frameworkach. - 100gsap-plugins
Obsługuje wtyczki GSAP: rejestrację, ScrollToPlugin, Flip, Draggable, SplitText, animacje SVG i CustomEase. - 100creative-web-widgets
Dostarcza 48 animowanych widżetów produktu do stron marketingowych, na przykład czat AI z cytatami, paletę wyszukiwania i oś czasu. - 100gsap-creative-engineering
Projektuje, audytuje i wdraża animacje GSAP do stron React i Next.js: storytelling przy przewijaniu, sceny przypięte i galerie. - 100scroll-animation
Buduje animacje sterowane przewijaniem w GSAP, ScrollTrigger i Lenis: wejścia, przypinanie, poziome przewijanie i paralaksę. Przydaje się przy stronach z efektami przy przewijaniu. - 100gsap-web
Pomaga budować animacje przewijania w GSAP: ScrollTrigger, przypinanie sekcji, scrub, osie czasu hero, poziome sekcje, SplitText, Flip oraz synchronizację z Lenis i naprawę dryfu znaczników.