interaction-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInteraction Design
交互设计
Overview
概述
Interaction design focuses on how users engage with systems, creating intuitive and delightful experiences through feedback and responsiveness.
交互设计专注于用户与系统的互动方式,通过反馈和响应性打造直观且愉悦的体验。
When to Use
适用场景
- Designing user flows and touchpoints
- Creating animations and transitions
- Defining error and loading states
- Building microinteractions
- Improving usability and feedback
- Mobile interaction patterns
- 设计用户流程和接触点
- 创建动画与转场效果
- 定义错误和加载状态
- 构建微交互
- 提升可用性与反馈体验
- 移动端交互模式
Instructions
操作指南
1. Interaction Patterns
1. 交互模式
yaml
Common Interaction Patterns:
Swipe:
Use: Mobile lists, carousels
Feedback: Visual sliding, momentum
Accessibility: Keyboard alternative (arrows)
Tap & Hold:
Use: Context menus, drag prep
Feedback: Visual feedback after delay
Duration: ~500ms before trigger
Pinch & Zoom:
Use: Image viewing, maps
Feedback: Smooth zoom animation
Boundaries: Set min/max zoom levels
Drag & Drop:
Use: Reordering, moving items
Feedback: Visual during drag, drop confirmation
Fallback: Alternative method (buttons)
Double Tap:
Use: Zoom, favorite, select
Feedback: Immediate visual response
Conflict: Avoid 300ms delay confusion
---yaml
Common Interaction Patterns:
Swipe:
Use: 移动端列表、轮播组件
Feedback: 视觉滑动效果、惯性反馈
Accessibility: 键盘替代方案(方向键)
Tap & Hold:
Use: 上下文菜单、拖拽准备
Feedback: 延迟后显示视觉反馈
Duration: 触发前约500ms
Pinch & Zoom:
Use: 图片查看、地图操作
Feedback: 平滑缩放动画
Boundaries: 设置最小/最大缩放级别
Drag & Drop:
Use: 重新排序、移动项目
Feedback: 拖拽过程中显示视觉反馈,放置时确认
Fallback: 替代方法(按钮)
Double Tap:
Use: 缩放、收藏、选择
Feedback: 即时视觉响应
Conflict: 避免300ms延迟混淆
---Microinteractions
微交互
Loading States:
- Show immediately for >0.5s waits
- Animate progress bar for long waits
- Show percentage for determinate progress
- Skeleton screens for content
Empty States:
- Show friendly illustration
- Explain what's empty
- Provide action to fill (CTA)
- Consider helpful suggestions
Error States:
- Clear error message (what, why, how to fix)
- Highlight error field
- Provide recovery action
- Don't repeat error on retry
Success Feedback:
- Confirmation message (1-2 seconds)
- Subtle animation or sound
- Clear next step or action
Pull-to-Refresh:
- Familiar mobile pattern
- Clear visual feedback during pull
- Confirmation when complete
- Alternative: Manual refresh button
undefinedLoading States:
- 等待时间>0.5s时立即显示
- 长时间等待时使用进度条动画
- 确定进度时显示百分比
- 使用骨架屏展示内容占位
Empty States:
- 显示友好插图
- 说明内容为空的原因
- 提供填充内容的操作按钮(CTA)
- 可提供实用建议
Error States:
- 清晰的错误提示(问题、原因、解决方法)
- 高亮错误字段
- 提供恢复操作
- 重试时不再重复显示错误
Success Feedback:
- 确认提示(1-2秒)
- 微妙的动画或音效
- 清晰的下一步操作
Pull-to-Refresh:
- 常见的移动端模式
- 下拉过程中显示清晰的视觉反馈
- 完成时显示确认提示
- 替代方案:手动刷新按钮
undefined2. Animation & Transition Design
2. 动画与转场设计
python
undefinedpython
undefinedDefine animations and transitions
定义动画与转场效果
class InteractionDesign:
def define_animation(self, interaction):
"""Specify animation properties"""
return {
'trigger': interaction.trigger, # Click, hover, load
'element': interaction.element,
'animation': {
'type': interaction.animation_type, # Fade, slide, scale
'duration': interaction.duration, # 200-400ms typical
'easing': interaction.easing_fn, # Ease-in-out
'delay': interaction.delay_ms
},
'purpose': interaction.purpose, # Feedback, guidance, delight
'platform': ['Desktop', 'Mobile'], # Platform-specific
'accessibility': {
'respects_prefers_reduced_motion': True,
'non_distract': 'Critical interactions only'
}
}
def define_transitions(self):
"""Page/screen transitions"""
return {
'navigation_forward': {
'animation': 'Slide right',
'duration': '300ms',
'easing': 'ease-out'
},
'navigation_back': {
'animation': 'Slide left',
'duration': '300ms',
'easing': 'ease-out'
},
'modal_open': {
'animation': 'Fade + Scale up',
'duration': '200ms',
'easing': 'ease-out'
},
'modal_close': {
'animation': 'Fade + Scale down',
'duration': '150ms',
'easing': 'ease-in'
}
}
def animation_guidelines(self):
"""Best practices for animation"""
return {
'duration': {
'micro_interactions': '100-200ms',
'transitions': '200-400ms',
'entrance_animations': '300-500ms',
'avoid': '>500ms (feels sluggish)'
},
'easing': {
'entrance': 'Ease out (fast start, slow end)',
'exit': 'Ease in (slow start, fast end)',
'focus': 'Ease-in-out for smooth feel'
},
'purpose': [
'Provide feedback',
'Guide user attention',
'Communicate state change',
'Delight users',
'Avoid: Distraction, slowness'
]
}undefinedclass InteractionDesign:
def define_animation(self, interaction):
"""定义动画属性"""
return {
'trigger': interaction.trigger, # 点击、悬停、加载
'element': interaction.element,
'animation': {
'type': interaction.animation_type, # 淡入淡出、滑动、缩放
'duration': interaction.duration, # 典型时长200-400ms
'easing': interaction.easing_fn, # 缓入缓出
'delay': interaction.delay_ms
},
'purpose': interaction.purpose, # 反馈、引导、愉悦体验
'platform': ['Desktop', 'Mobile'], # 特定平台
'accessibility': {
'respects_prefers_reduced_motion': True,
'non_distract': '仅针对关键交互'
}
}
def define_transitions(self):
"""页面/屏幕转场"""
return {
'navigation_forward': {
'animation': 'Slide right',
'duration': '300ms',
'easing': 'ease-out'
},
'navigation_back': {
'animation': 'Slide left',
'duration': '300ms',
'easing': 'ease-out'
},
'modal_open': {
'animation': 'Fade + Scale up',
'duration': '200ms',
'easing': 'ease-out'
},
'modal_close': {
'animation': 'Fade + Scale down',
'duration': '150ms',
'easing': 'ease-in'
}
}
def animation_guidelines(self):
"""动画最佳实践"""
return {
'duration': {
'micro_interactions': '100-200ms',
'transitions': '200-400ms',
'entrance_animations': '300-500ms',
'avoid': '>500ms (会显得迟缓)'
},
'easing': {
'entrance': 'Ease out (快启动,慢结束)',
'exit': 'Ease in (慢启动,快结束)',
'focus': 'Ease-in-out 实现平滑感受'
},
'purpose': [
'提供反馈',
'引导用户注意力',
'传达状态变化',
'提升用户愉悦感',
'避免:分散注意力、延迟感'
]
}undefined3. Error Handling & Feedback
3. 错误处理与反馈
yaml
Error State Design:
Primary Error Message:
"Payment declined" (clear, non-technical)
Secondary Explanation:
"Your card was declined by the bank. This might be due to
insufficient funds, security concerns, or an expired card."
Recovery Action:
[ Retry Payment ] [ Use Different Card ] [ Contact Support ]
Form Field Errors:
- Highlight field with error color (red)
- Show error icon
- Place error message near field
- Show error on blur, not on keystroke
Form Validation:
- Real-time validation for good UX
- Server-side validation for security
- Show success state after valid input
- Clear error when corrected
---
Success States:
Confirmation Message:
"Payment successful!"
Duration: 2-3 seconds
Action: Auto-dismiss or click to close
Next Step:
- Order confirmation email sent
- What happens next?
- Related actions
Visual Feedback:
- Check mark animation
- Subtle celebration animation
- Sound (optional, if enabled)yaml
Error State Design:
Primary Error Message:
"支付失败" (清晰、非技术化表述)
Secondary Explanation:
"您的银行卡被银行拒绝,可能是由于余额不足、安全验证问题或卡片过期。"
Recovery Action:
[ 重试支付 ] [ 使用其他卡片 ] [ 联系客服 ]
Form Field Errors:
- 用错误颜色(红色)高亮字段
- 显示错误图标
- 在字段附近显示错误提示
- 失去焦点时显示错误,而非输入过程中
Form Validation:
- 实时验证以提升UX
- 服务端验证保障安全性
- 输入有效后显示成功状态
- 修正后清除错误提示
---
Success States:
Confirmation Message:
"支付成功!"
Duration: 2-3秒
Action: 自动消失或点击关闭
Next Step:
- 已发送订单确认邮件
- 后续流程说明
- 相关操作入口
Visual Feedback:
- 对勾动画
- 微妙的庆祝动画
- 音效(可选,需用户开启)4. Accessibility in Interactions
4. 交互无障碍设计
javascript
// Ensure interactions are accessible
class AccessibleInteractions {
ensureKeyboardAccess() {
return {
tab_order: 'Logical, top-to-bottom',
focus_visible: 'Clear focus indicator (not removed)',
enter_key: 'Activates buttons and links',
space_key: 'Activates buttons',
escape_key: 'Closes modals and menus',
arrow_keys: 'Navigate lists, menus, carousels'
};
}
respectMotionPreferences() {
return {
prefers_reduced_motion: {
media_query: '@media (prefers-reduced-motion: reduce)',
actions: [
'Disable animations',
'Reduce animation duration',
'Remove parallax effects',
'Disable autoplay'
]
}
};
}
screenReaderConsiderations() {
return {
announcements: 'Use ARIA live regions for updates',
feedback: 'Provide screen reader feedback for interactions',
labels: 'Clear, descriptive button labels',
states: 'Announce state changes (expanded, selected)'
};
}
}javascript
// 确保交互具备无障碍性
class AccessibleInteractions {
ensureKeyboardAccess() {
return {
tab_order: '符合逻辑,从上到下',
focus_visible: '清晰的焦点指示器(不可移除)',
enter_key: '激活按钮与链接',
space_key: '激活按钮',
escape_key: '关闭弹窗与菜单',
arrow_keys: '导航列表、菜单、轮播组件'
};
}
respectMotionPreferences() {
return {
prefers_reduced_motion: {
media_query: '@media (prefers-reduced-motion: reduce)',
actions: [
'禁用动画',
'缩短动画时长',
'移除视差效果',
'禁用自动播放'
]
}
};
}
screenReaderConsiderations() {
return {
announcements: '使用ARIA实时区域播报更新内容',
feedback: '为交互提供屏幕阅读器反馈',
labels: '清晰、描述性的按钮标签',
states: '播报状态变化(展开、选中)'
};
}
}Best Practices
最佳实践
✅ DO
✅ 建议
- Keep animations under 400ms
- Provide clear visual feedback
- Use animations to guide attention
- Respect motion preferences
- Make interactions reversible
- Test with keyboard and screen readers
- Provide multiple interaction methods
- Design for touch and mouse
- Use appropriate easing curves
- Document interaction behavior
- 动画时长控制在400ms以内
- 提供清晰的视觉反馈
- 用动画引导用户注意力
- 尊重用户的动效偏好
- 让交互可撤销
- 通过键盘和屏幕阅读器测试
- 提供多种交互方式
- 为触摸和鼠标操作设计适配方案
- 使用合适的缓动曲线
- 记录交互行为规范
❌ DON'T
❌ 避免
- Animate for decoration only
- Use animations longer than 500ms
- Ignore motion-sensitive users
- Remove focus indicators
- Trap users in modals
- Use confusing animations
- Animate everything
- Ignore loading states
- Forget error states
- Skip accessibility testing
- 仅为装饰添加动画
- 使用时长超过500ms的动画
- 忽略对动敏感的用户
- 移除焦点指示器
- 将用户困在弹窗中
- 使用易混淆的动画
- 给所有元素添加动画
- 忽略加载状态
- 忘记设计错误状态
- 跳过无障碍测试
Interaction Design Tips
交互设计小贴士
- Animation should feel instant (<200ms) or natural (300-500ms)
- Use consistent easing across experience
- Pair animations with haptic feedback on mobile
- Test animations on actual devices
- 动画应感觉即时(<200ms)或自然(300-500ms)
- 在整个体验中使用统一的缓动效果
- 在移动端将动画与触觉反馈结合
- 在真实设备上测试动画效果