Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问clear审计通过

interaction-physics相互作用物理学

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,273

周安装

52

GitHub Stars

21

下载量

412
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:interaction-physics(相互作用物理学)
来源仓库:https://github.com/sanky369/vibe-building-skills
仓库路径:skills/interaction-physics
安装命令:
npx skills add https://github.com/sanky369/vibe-building-skills --skill interaction-physics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/sanky369/vibe-building-skills --skill interaction-physics

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等代码,整理组件结构或定位布局问题。
  • 需结合项目现有设计系统、路由和构建方式,避免生成孤立片段;涉及页面改动时应配合本地预览检查视觉效果。
  • 安装命令:npx skills add https://github.com/sanky369/vibe-building-skills --skill interaction-physics。
  • 建议确认权限范围和维护状态,避免触发不必要的联网或文件读写操作。

SKILL.md

Interaction Design

Overview

Interactions are the moments when your interface comes alive. They're the transitions between states, the feedback when users take action, the animations that guide attention. When done well, interactions are invisible—they feel natural and right. When done poorly, they distract or confuse.

This skill teaches you to think about interactions systematically: understanding animation principles, designing intentional microinteractions, providing clear feedback, and ensuring performance and accessibility.

Core Methodology: Microinteractions

A microinteraction is a small, contained interaction that accomplishes a specific task. Examples: button hover state, form validation feedback, loading spinner, success notification, menu open/close.

The Anatomy of a Microinteraction

Every microinteraction has four parts:

  1. Trigger — What initiates the interaction? (user action, system event, time-based)
  2. Rules — What happens as a result? (what animates, what changes, how long)
  3. Feedback — What does the user see/hear? (animation, sound, haptic)
  4. Loops & Modes — Does it repeat? Can it be interrupted?

Example: Button Hover State

Trigger: User hovers over button
Rules:
  - Background color changes to darker shade
  - Duration: 200ms
  - Easing: ease-out
Feedback:
  - Visual: background color transition
  - Indicates: button is interactive
Loops & Modes:
  - Repeats on every hover
  - Can be interrupted by click or mouse leave

Designing Intentional Microinteractions

Principle 1: Provide Feedback Every user action should result in visible feedback. Users need to know their action was registered.

Principle 2: Guide Attention Use animation to guide users' attention to important elements.

Principle 3: Communicate State Use animation to communicate state changes (loading, success, error, etc.).

Principle 4: Delight Without Distraction Add personality and delight, but don't distract from the task.

Animation Principles

Principle 1: Timing

Timing is critical. Too fast and the animation feels abrupt. Too slow and it feels sluggish.

General Guidelines:

  • UI Feedback (hover, focus, state change): 150-250ms
  • Transitions (page changes, modal open/close): 300-500ms
  • Attention-Grabbing (alerts, notifications): 500-1000ms
  • Loading (spinners, progress bars): 1-2 seconds or continuous
/* UI Feedback - Fast */
button {
  transition: background-color 200ms ease-out;
}

/* Transitions - Medium */
.modal {
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

/* Loading - Slower */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

Principle 2: Easing

Easing functions control how an animation accelerates and decelerates. Different easing functions convey different meanings.

Common Easing Functions:

EasingMeaningUse Case
linearConstant speedContinuous, mechanical (spinners, progress bars)
ease-inSlow start, fast endExiting, dismissing
ease-outFast start, slow endEntering, appearing, most interactions
ease-in-outSlow start and endSmooth, natural transitions
cubic-bezier(0.34, 1.56, 0.64, 1)Elastic, bouncyPlayful, attention-grabbing
/* UI Feedback - ease-out (most common) */
button {
  transition: background-color 200ms ease-out;
}

/* Entering - ease-out */
.modal {
  animation: slideIn 400ms ease-out;
}

/* Exiting - ease-in */
.modal.closing {
  animation: slideOut 300ms ease-in;
}

/* Continuous - linear */
.spinner {
  animation: spin 1s linear infinite;
}

/* Playful - cubic-bezier */
.bounce {
  animation: bounce 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

Principle 3: Distance

The distance an element moves affects how long the animation should take. Larger distances need longer durations.

/* Small movement - short duration */
button:hover {
  transform: scale(1.05);
  transition: transform 150ms ease-out;
}

/* Medium movement - medium duration */
.modal {
  animation: slideIn 400ms ease-out;
}
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Large movement - longer duration */
.page-transition {
  animation: fadeIn 600ms ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

Common Microinteractions

Microinteraction 1: Button States

/* Default state */
button {
  background-color: var(--color-primary);
  color: white;
  transition: background-color 200ms ease-out;
}

/* Hover state */
button:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
}

/* Active state */
button:active:not(:disabled) {
  background-color: var(--color-primary-darker);
  transform: scale(0.98);
}

/* Focus state */
button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Disabled state */
button:disabled {
  background-color: var(--color-disabled);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Loading state */
button.loading {
  pointer-events: none;
  opacity: 0.8;
}

button.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

Microinteraction 2: Form Validation

/* Input default state */
input {
  border: 1px solid var(--color-border);
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}

/* Input focus state */
input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Input valid state */
input.valid {
  border-color: var(--color-success);
}

input.valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Input error state */
input.error {
  border-color: var(--color-error);
}

input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Error message animation */
.error-message {
  animation: slideDown 300ms ease-out;
  color: var(--color-error);
  font-size: 14px;
  margin-top: 4px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

Microinteraction 3: Loading States

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-skeleton) 0%,
    var(--color-skeleton-light) 50%,
    var(--color-skeleton) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background-color: var(--color-border);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-primary);
  transition: width 300ms ease-out;
}

Microinteraction 4: Notifications

/* Notification container */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 300ms ease-out;
  z-index: 1000;
}

/* Notification variants */
.notification.success {
  border-left: 4px solid var(--color-success);
}

.notification.error {
  border-left: 4px solid var(--color-error);
}

.notification.warning {
  border-left: 4px solid var(--color-warning);
}

/* Notification exit animation */
.notification.exiting {
  animation: slideOut 300ms ease-in forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(400px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

Microinteraction 5: Transitions Between Pages

/* Page fade transition */
.page {
  animation: fadeIn 400ms ease-out;
}

.page.exiting {
  animation: fadeOut 300ms ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Page slide transition */
.page {
  animation: slideIn 400ms ease-out;
}

.page.exiting {
  animation: slideOut 300ms ease-in forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

Performance Considerations

Use GPU-Accelerated Properties

Animate properties that are GPU-accelerated for smooth performance:

Good (GPU-accelerated):

  • transform (translate, rotate, scale)
  • opacity

Avoid (CPU-intensive):

  • left, top, width, height
  • background-color (unless necessary)
  • box-shadow
/* Good - GPU-accelerated */
button:hover {
  transform: scale(1.05);
  transition: transform 200ms ease-out;
}

/* Avoid - CPU-intensive */
button:hover {
  width: 110px;
  height: 110px;
  transition: width 200ms ease-out, height 200ms ease-out;
}

Reduce Motion for Users Who Prefer It

Respect the prefers-reduced-motion media query:

/* Default animations */
button {
  transition: background-color 200ms ease-out;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
}

Accessibility Considerations

1. Provide Non-Animation Feedback

Don't rely on animation alone for feedback. Combine with color, text, or icons.

/* Bad - only animation */
button:hover {
  transform: scale(1.1);
}

/* Good - animation + color change */
button:hover {
  background-color: var(--color-primary-dark);
  transform: scale(1.05);
}

2. Ensure Keyboard Navigation

Interactions should work with keyboard navigation:

/* Hover state for mouse users */
button:hover {
  background-color: var(--color-primary-dark);
}

/* Focus state for keyboard users */
button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  background-color: var(--color-primary-dark);
}

3. Avoid Motion Sickness

Avoid rapid, flashing, or disorienting animations:

/* Bad - rapid flashing */
.alert {
  animation: flash 100ms infinite;
}

/* Good - subtle, slow animation */
.alert {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

How to Use This Skill with Claude Code

Audit Your Interactions

"I'm using the interaction-design skill. Can you audit my interactions?
- Identify microinteractions that are missing
- Check animation timing and easing
- Identify performance issues (CPU-intensive animations)
- Check accessibility (reduced motion, keyboard navigation)
- Suggest improvements"

Design Microinteractions

"Can you help me design microinteractions for:
- Button states (hover, active, disabled, loading)
- Form validation feedback
- Loading states
- Success/error notifications
- Page transitions"

Implement Animations

"Can you implement animations for:
- Button hover and active states
- Modal open/close
- Page transitions
- Loading spinner
- Notification entrance/exit
Include timing, easing, and accessibility considerations"

Optimize Animation Performance

"Can you optimize my animations for performance?
- Identify CPU-intensive animations
- Suggest GPU-accelerated alternatives
- Check for unnecessary animations
- Ensure smooth 60fps performance"

Design Critique: Evaluating Your Interactions

Claude Code can critique your interactions:

"Can you evaluate my interactions?
- Are my animations intentional and purposeful?
- Is my timing appropriate?
- Are my easing functions right?
- Are my interactions accessible?
- What's one thing I could improve immediately?"

Integration with Other Skills

  • design-foundation — Animation tokens and timing
  • component-architecture — Interactions in components
  • accessibility-excellence — Accessible interactions
  • layout-system — Transitions between layouts

Key Principles

1. Animation Should Have Purpose Every animation should serve a purpose: provide feedback, guide attention, or communicate state.

2. Timing Matters Appropriate timing makes animations feel natural. Too fast or too slow feels wrong.

3. Easing Conveys Meaning Different easing functions convey different meanings (ease-out for entering, ease-in for exiting).

4. Performance is Critical Smooth animations require GPU-accelerated properties and careful performance optimization.

5. Accessibility is Essential Respect user preferences for reduced motion and provide non-animation feedback.

Checklist: Is Your Interaction Design Ready?

  • All user actions provide visible feedback
  • Animation timing is appropriate (150-250ms for UI feedback)
  • Easing functions are intentional (ease-out for entering, ease-in for exiting)
  • Animations use GPU-accelerated properties (transform, opacity)
  • Reduced motion preferences are respected
  • Keyboard navigation works well
  • Non-animation feedback is provided (color, text, icons)
  • Loading states are clear and communicative
  • Error states are clear and helpful
  • Success states are clear and satisfying
  • Page transitions are smooth and intentional

Intentional, delightful interactions transform a functional product into one that feels loved.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.97%
按下载量换算128

Codex

25%
按下载量换算103

Gemini CLI

17.8%
按下载量换算73

OpenCode

12.75%
按下载量换算53

Antigravity

7.02%
按下载量换算29

trae

3.8%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills