본문으로 건너뛰기
Skillpedia
인터페이스 (UI/UX)280k · #211

motion-advanced

하는 일

이 도구는 React나 Next.js로 만든 웹사이트에 복잡하고 상호작용하는 애니메이션을 만들 수 있게 합니다. 요소가 움직이고, 터치에 반응하고, 모양을 바꾸도록 도와줍니다. 예를 들어 그림이 나타나거나 글자가 스스로 입력되는 효과를 만들 수 있습니다.

사용하는 경우

  • ✓화면에서 항목을 드래그할 수 있게 만들고 싶을 때.
  • ✓글자나 단어가 하나씩 나타나도록 만들고 싶을 때.
  • ✓애니메이션 SVG 그림이나 마우스를 올렸을 때 바뀌는 버튼을 만들 때.

스킬 링크

https://github.com/affaan-m/ECC/blob/main/pi/core/skills/motion-advanced/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/motion-advanced/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“카드를 좌우로 드래그할 수 있고, 너무 멀리 끌면 사라지는 애니메이션을 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

내부적으로는 화면에서 요소의 움직임을 제어하는 고급 기법을 사용합니다. 애니메이션을 연속으로 또는 순서대로 만들 수 있으며, 터치 기기에서도 매끄럽고 끊김 없이 작동하도록 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Motion Advanced

Complex, interactive, and physics-based animation patterns. Requires motion-foundations to be set up first. Use these when motion-patterns is not enough.

When to Activate

  • Building drag-to-dismiss sheets, swipe gestures, or reorderable lists
  • Animating text word-by-word, character-by-character, or as a live counter
  • Drawing SVG paths, morphing icons, or animating circular progress
  • Writing a custom animation hook (useScrollReveal, magnetic button, cursor follower)
  • Sequencing multi-step animations imperatively with useAnimate
  • Building spinners, shimmer skeletons, pulse indicators, or loading button states

Outputs

This skill produces:

  • Drag interactions: draggable cards, drag-to-dismiss sheets, Reorder.Group lists
  • Gesture hooks: swipe detection, long press, pinch outline
  • Text animation components: word reveal, character typewriter, number counter
  • SVG animation: path draw-on, icon morph, stroke progress ring
  • Custom hooks: useScrollReveal, useHoverScale, useNavigationDirection, useInViewOnce
  • Imperative sequences via useAnimate with interrupt-safe async/await
  • Loader components: spinner, shimmer, pulse dot, progress bar, button loading state

Principles

  • Physics-based motion (useSpring, springs.*) always feels more natural than duration-based for direct manipulation.
  • useMotionValue + useTransform computes derived values without triggering re-renders.
  • useAnimate sequences are imperative and interrupt-safe — calling animate() mid-flight cancels the previous animation automatically.
  • Motion values (useMotionValue, useSpring) are SSR-safe and do not cause hydration errors.

Rules

  1. Drag interactions must be tested on touch devices, not just mouse. drag prop works on both but feel and threshold differ.
  2. Infinite animations must pause when document.visibilityState === "hidden". Background tabs must not consume GPU/CPU.
  3. Swipe threshold must be explicit. Never infer intent from velocity alone; combine offset + velocity checks.
  4. useAnimate scope ref must be attached to a mounted DOM element. Calling animate() before mount throws silently.
  5. Motion values must not be recreated on render. useMotionValue(0) inside a component body is correct; new MotionValue(0) in a render is not.
  6. All token values are imported from motion-foundations. No inline numbers.
  7. Custom hooks must handle cleanup. Every window.addEventListener needs a matching removeEventListener in the useEffect return.
  8. SVG morphing requires equal path command counts. Paths with different command structures snap instead of interpolating.

Decision Guidance

Choosing the right advanced API

Scenario API
Drag with physics on release drag + dragTransition: springs.release
Ordered drag-to-reorder list Reorder.Group + Reorder.Item
Dismiss on drag offset drag="y" + onDragEnd offset check
Swipe left/right drag="x" + onDragEnd offset check
Long press useLongPress hook
Value smoothed over time useSpring
Value derived from another useTransform
Multi-step sequence useAnimate with async/await
One-shot imperative animation animate() from motion
Text entering word by word Stagger on inline-block spans
SVG drawing on pathLength 0 → 1
SVG morph d attribute tween (equal commands)
Circular progress strokeDashoffset tween

When to use useSpring vs a spring transition

useSpring transition: springs.*
Use for Cursor follower, pointer-tracked values Discrete state changes
Updates Continuous, on every frame Triggered by state change
Interrupt Smooth — physics picks up from velocity Restarts from current value

Core Concepts

useMotionValue + useTransform

Reactive computation without re-renders:

const x = useMotionValue(0)
const opacity = useTransform(x, [-200, 0, 200], [0, 1, 0])
// opacity updates every frame as x changes — no setState, no re-render

useAnimate

Returns [scope, animate]. The scope ref must be attached to a DOM element. animate() calls are interrupt-safe — calling mid-flight cancels the previous run.

const [scope, animate] = useAnimate()


…
자주 묻는 질문

이것을 사용하려면 전문 프로그래머여야 하나요?

전문가일 필요는 없지만, React나 Next.js에 대한 기본 지식이 있으면 좋습니다. 이 도구는 해당 환경을 위한 추가 기능이기 때문입니다.

모든 웹사이트에서 작동하나요?

이 도구는 React나 Next.js 웹 개발 라이브러리를 사용하는 프로젝트에 특화되어 있습니다.

현실 세계처럼 물리적인 느낌의 애니메이션도 만들 수 있나요?

네. 이 도구는 물리 원리에 기반한 애니메이션을 만들 수 있어, 특히 드래그 앤 드롭 같은 상호작용에서 더 자연스럽고 사실적인 움직임을 만듭니다.

상세 정보

작성자의 원본 설명

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. Use when building drag and drop, gestures, text or SVG animation, or imperative animation sequences in React or Next.js.

repo: affaan-m/ECC

인기도

GitHub 스타
280k
순위
#211
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬