跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
其他技能

motion

Applies house motion for what animates, easing, durations, springs, gestures, exits, motion blur and reduced motion.

raphaelsalaja · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add raphaelsalaja/skills --skill motion

技能说明


name: motion description: Applies house motion for what animates, easing, durations, springs, gestures, exits, motion blur and reduced motion.

Motion

This skill holds how things move on every screen. It covers what animates, the curve and duration, gestures, exits, motion blur and reduced motion.

Durations and curves are exact

Use the project's motion tokens wherever they exist. Where none exists, the durations, curves and scales here are exact. Motion the user starts that runs past 300ms is a finding in any style.

Motion blur draws with @web-kits/motion-blur, whose defaults are exact: a 180° shutter, Echo at one copy per 1.5px up to 16 copies and a 1.05 smear limit.

Whether an animation should exist at all belongs to restraint. Taking an existing animation apart belongs to deconstruct. Whether it holds its frame rate belongs to frames. Surfaces, loading, hover styles and sound belong to defaults.

App chrome fades

Page switches, panels and loading states fade with opacity and do not slide or scale. That is motion-opacity-for-chrome. Animate only the axis that changes. Animating width when only height changes is motion-changing-axis-only.

Entrances do not replay

Switching pages does not replay entrances. Set initial={false} on the route-level AnimatePresence, and on any that wraps a state swap. That is motion-no-replay-on-entry. A cached view renders at once, with no fade or skeleton flash. That is motion-no-flash-on-return. See recipes.md.

Name the properties you animate

A transition lists the properties it animates, usually opacity and transform. transition: all is motion-name-the-properties.

Toggled state transitions, keyframes run once

Interactive state changes use transitions or springs, which retarget when the user reverses. A keyframe animation on a toggled class is motion-transitions-for-state. Keep keyframes for sequences that run once.

Motion starts where it comes from

A dropdown or popover scales from its trigger, with transform-origin set to that edge. A menu growing from its own centre is motion-origin-from-trigger. Modals stay centred, because no trigger anchors them.

Nothing grows from zero

An entrance starts from scale(0.95) or higher, together with opacity: 0. scale(0) is motion-no-scale-from-zero.

Gestures use springs

Drag, swipe and any motion the user can reverse mid-flight use a spring. On release, pass the pointer velocity into it. A drag release on a fixed ease-out is motion-spring-for-gestures. See recipes.md.

Flicks dismiss, edges resist

A swipe dismisses on distance or on speed, so past about 0.11 px per millisecond a short flick is enough. A sheet that ignores a fast flick is motion-flick-dismisses.

Dragging past a boundary meets growing friction rather than a wall. A drawer that stops dead at the top is motion-friction-at-edges. Capture the pointer once a drag starts and ignore extra touches. See recipes.md.

Every gesture has a button

Each drag, swipe or pinch also works with a click and with the keyboard. A list that reorders only by dragging is motion-gesture-alternative.

Easing fits the change

System changes such as a toast use easing, not a spring. Entrances and exits ease out, and a change of view eases in and out. Linear is for progress bars and clocks only. A modal entering on ease-in is motion-ease-by-direction.

The built-in ease-out keyword is too weak. Use cubic-bezier(0.23, 1, 0.32, 1) to enter and exit, and cubic-bezier(0.77, 0, 0.175, 1) for movement on screen. A bare ease-out is motion-strong-ease-out.

Closes are faster than opens

A close runs shorter than its open. Nothing delays a close or a hover-out. A modal that takes as long to leave as it took to arrive is motion-close-faster.

Motion stays under 300ms

Hover colour changes are instant, with no transition. A button fading its background over 200ms on hover is motion-instant-hover-color.

Press and hover movement take 120–180ms. Small state changes take 180–260ms. Nothing the user starts runs longer than 300ms, except a full panel or drawer at up to 400ms. A 500ms dropdown is motion-under-300ms.

Under mode="wait" the exit and the entrance play in series, so halve each. When motion feels slow, shorten it before changing the curve. Samples are in recipes.md.

Frequent actions do not animate

Typing, keyboard shortcuts, keyboard navigation and fast toggles do not animate. A command palette opened from the keyboard appears at once. A context menu appears at once and may fade out. A scale pulse on every keystroke is motion-no-motion-on-repeat.

Tooltips wait once

The first tooltip in a group opens after a delay. Its neighbours open at once and without animation while one is showing, and every tooltip closes instantly. A toolbar where each tooltip waits the full delay is motion-tooltip-delay.

Icons cross-fade when they swap

An icon that swaps in place, such as copy to copied, cross-fades. Scale runs 0.25 to 1, opacity 0 to 1 and blur 4px to 0. A hard swap is motion-icon-crossfade. See recipes.md.

Two icons in the morph form from icons morph instead, animating each path's d as a small state change on the movement curve. Under reduced motion they cross-fade. A cross-fade between two morph-form icons is motion-icon-morph. See recipes.md.

Blur bridges a cross-fade

When a cross-fade between two states still reads as two objects, add filter: blur(2px) while it runs. Keep blur under 20px, which gets expensive in Safari. Two labels visibly overlapping mid-swap is motion-blur-the-crossfade.

Motion blur only where the eye cannot follow

A screen already smears what the eye tracks, so added blur turns text into grey bars while some

阅读完整来源 ↗