मुख्य सामग्री पर जाएँ
Skillpedia
इंटरफ़ेस (UI/UX)280k · #211

motion-advanced

यह क्या करती है

यह टूल React या Next.js से बनी वेबसाइटों के लिए जटिल और इंटरैक्टिव एनिमेशन बनाने देता है। इससे चीज़ें स्क्रीन पर हिल सकती हैं, टच पर प्रतिक्रिया दे सकती हैं, या अपना आकार बदल सकती हैं, जैसे ऐसी ड्रॉइंग जो धीरे-धीरे उभरे या ऐसा टेक्स्ट जो खुद टाइप होता दिखे।

कब इस्तेमाल करें

  • ✓जब आप चाहते हैं कि स्क्रीन पर कोई आइटम खींचा (drag) जा सके।
  • ✓टेक्स्ट को अक्षर-अक्षर या शब्द-शब्द करके दिखाने के लिए।
  • ✓एनिमेटेड SVG ड्रॉइंग या ऐसे बटन बनाने के लिए जो hover करने पर बदल जाएँ।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/motion-advanced/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“एक ऐसा एनिमेशन बनाओ जिसमें कार्ड को बगल में खींचा जा सके, और ज़्यादा दूर खींचने पर वह गायब हो जाए।”

हर हफ़्ते 5 नई skills, 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 वेब लाइब्रेरी इस्तेमाल करते हैं।

क्या मैं असली दुनिया जैसे फिज़िक्स वाले एनिमेशन बना सकता हूँ?

हाँ, यह टूल भौतिकी (physics) के नियमों पर आधारित एनिमेशन बनाने देता है, जिससे हरकत ज़्यादा प्राकृतिक और असली लगती है, खासकर drag and drop जैसे इंटरैक्शन में।

जानकारी

लेखक का मूल विवरण

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
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

accessibility

280k

यह आपके एजेंट को ऐसे इंटरफ़ेस बनाने में मदद करता है जिन्हें हर कोई इस्तेमाल कर सके। यह पक्का करता है कि वेबसाइट और ऐप दिव्यांग लोगों के लिए भी अच्छे से काम करें, जैसे नेत्रहीन या जिन्हें चलने-फिरने में दिक्कत होती है।

डिज़ाइनइंटरफ़ेस (UI/UX)

agent-architecture-audit

280k

यह आपके एजेंट को जाँचने देता है कि सब कुछ सही से चल रहा है। यह AI सिस्टम में समस्याएँ ढूँढकर ठीक करता है, ताकि वे उम्मीद के मुताबिक काम करें।

AI और एजेंटएजेंट

agent-eval

280k

यह आपके एजेंट को अलग-अलग AI coding tools की तुलना करने में मदद करता है। यह मापता है कि किसी खास काम के लिए कौन सा टूल ज़्यादा तेज़, सस्ता और भरोसेमंद है।

AI और एजेंटएजेंट

agent-harness-construction

280k

यह आपके एजेंट को काम कैसे करना है, यह बेहतर समझने में मदद करता है। यह उन tools और instructions को बेहतर बनाता है जिनका एजेंट इस्तेमाल करता है, ताकि उसकी सफलता की संभावना बढ़े।

AI और एजेंटएजेंट

मिलती-जुलती skills