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 पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
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.Grouplists - 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
useAnimatewith interrupt-safeasync/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+useTransformcomputes derived values without triggering re-renders.useAnimatesequences are imperative and interrupt-safe — callinganimate()mid-flight cancels the previous animation automatically.- Motion values (
useMotionValue,useSpring) are SSR-safe and do not cause hydration errors.
Rules
- Drag interactions must be tested on touch devices, not just mouse.
dragprop works on both but feel and threshold differ. - Infinite animations must pause when
document.visibilityState === "hidden". Background tabs must not consume GPU/CPU. - Swipe threshold must be explicit. Never infer intent from velocity alone; combine
offset+velocitychecks. useAnimatescope ref must be attached to a mounted DOM element. Callinganimate()before mount throws silently.- Motion values must not be recreated on render.
useMotionValue(0)inside a component body is correct;new MotionValue(0)in a render is not. - All token values are imported from
motion-foundations. No inline numbers. - Custom hooks must handle cleanup. Every
window.addEventListenerneeds a matchingremoveEventListenerin theuseEffectreturn. - 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
कमेंट
- …
इस repository की और skills
accessibility
280kयह आपके एजेंट को ऐसे इंटरफ़ेस बनाने में मदद करता है जिन्हें हर कोई इस्तेमाल कर सके। यह पक्का करता है कि वेबसाइट और ऐप दिव्यांग लोगों के लिए भी अच्छे से काम करें, जैसे नेत्रहीन या जिन्हें चलने-फिरने में दिक्कत होती है।
agent-architecture-audit
280kयह आपके एजेंट को जाँचने देता है कि सब कुछ सही से चल रहा है। यह AI सिस्टम में समस्याएँ ढूँढकर ठीक करता है, ताकि वे उम्मीद के मुताबिक काम करें।
agent-eval
280kयह आपके एजेंट को अलग-अलग AI coding tools की तुलना करने में मदद करता है। यह मापता है कि किसी खास काम के लिए कौन सा टूल ज़्यादा तेज़, सस्ता और भरोसेमंद है।
agent-harness-construction
280kयह आपके एजेंट को काम कैसे करना है, यह बेहतर समझने में मदद करता है। यह उन tools और instructions को बेहतर बनाता है जिनका एजेंट इस्तेमाल करता है, ताकि उसकी सफलता की संभावना बढ़े।
मिलती-जुलती skills
canvas
394kयह आपके एजेंट को जुड़े Mac पैनल पर होस्टेड विज़ुअल विजेट दिखाने, पैनल छिपाने या उसे दूसरे पेज पर ले जाने देती है।
control-ui
394kयह आपके एजेंट को OpenClaw Control UI को व्यवस्थित करने और उसमें आने वाली दिक्कतें सुलझाने में मदद करती है, जिसमें सेशन, डैशबोर्ड और जुड़े Gateway शामिल हैं।
diagram-maker
394kयह आपके एजेंट को प्रक्रियाओं, सिस्टम आर्किटेक्चर और व्हाइटबोर्ड स्केच के लिए SVG, HTML या संपादन योग्य Excalidraw फ़ाइलों में साफ़ डायग्राम बनाने में मदद करती है।