Agent Skills › dylantarre/animation-principles › attention-grabbers

attention-grabbers

GitHub

提供吸引用户注意力的动画设计原则与实现方案,涵盖脉冲、抖动等效果及CSS/JS代码示例,用于通知徽章、错误提示等场景。

skills/05-by-animation-type/attention-grabbers/SKILL.md dylantarre/animation-principles

触发场景

需要添加通知徽章或错误提示的视觉强调 设计新功能高亮或促销横幅动画 优化UI元素的注意力引导交互

安装

npx skills add dylantarre/animation-principles --skill attention-grabbers -g -y
更多选项

非标准路径

npx skills add https://github.com/dylantarre/animation-principles/tree/main/skills/05-by-animation-type/attention-grabbers -g -y

不安装直接使用

npx skills use dylantarre/animation-principles@attention-grabbers

指定 Agent (Claude Code)

npx skills add dylantarre/animation-principles --skill attention-grabbers -a claude-code -g -y

安装 repo 全部 skill

npx skills add dylantarre/animation-principles --all -g -y

预览 repo 内 skill

npx skills add dylantarre/animation-principles --list

SKILL.md

Frontmatter
{
    "name": "attention-grabbers",
    "description": "Use when drawing user focus - notification badges, new feature highlights, error callouts, promotional banners, or any animation meant to attract attention."
}

Attention-Grabbing Animations

Apply Disney's 12 principles to focus-drawing motion.

Principle Application

Squash & Stretch: Pulsing scale draws attention. 1.0 → 1.1 → 1.0 cycle catches peripheral vision.

Anticipation: Brief pause before attention animation. Let it build then release.

Staging: Position attention elements where users will see them. Corner badges, inline highlights.

Straight Ahead vs Pose-to-Pose: Design attention states: rest, active/pulsing, acknowledged.

Follow Through & Overlapping: Badge pulses, then count updates. Stagger the attention signals.

Slow In/Slow Out: Ease in/out on pulses. Smooth oscillation is less jarring than sharp bounces.

Arcs: Shake animations follow arc patterns. Left-right with slight vertical oscillation.

Secondary Action: Pulse + glow + color shift for maximum attention (use sparingly).

Timing:

  • Single attention grab: 300-500ms
  • Repeating pulse: 2000-3000ms cycle
  • Urgent pulse: 1000-1500ms cycle
  • Decay: Stop after 3-5 cycles or 10 seconds

Exaggeration: This is where exaggeration shines. Scale to 1.2, bright colors, bold motion.

Solid Drawing: Attention elements must still feel part of the UI, not floating or detached.

Appeal: Attention should feel like helpful notification, not aggressive demand.

Timing Recommendations

Attention Type Duration Cycles Decay
Badge Pulse 300ms 2-3 Stop after animation
Notification Dot 2000ms 3 6 seconds total
New Feature 500ms 2 Stay subtle
Error Shake 400ms 1 None
Urgent Alert 1000ms infinite Until dismissed
Promotional 3000ms 2 6 seconds

Implementation Patterns

/* Pulse attention */
.badge-pulse {
  animation: pulse 2000ms ease-in-out 3;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Subtle glow */
.glow-attention {
  animation: glow 2000ms ease-in-out 3;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.3); }
}

/* Error shake */
.shake {
  animation: shake 400ms ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Ring animation (notification) */
.ring {
  animation: ring 2500ms ease-in-out 2;
}

@keyframes ring {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(10deg); }
  20%, 40% { transform: rotate(-10deg); }
  50%, 100% { transform: rotate(0); }
}

Attention Budget

// Auto-stop attention after timeout
const attention = element.animate([
  { transform: 'scale(1)' },
  { transform: 'scale(1.15)' },
  { transform: 'scale(1)' }
], {
  duration: 2000,
  iterations: 3
});

// Or with CSS
setTimeout(() => {
  element.classList.remove('attention');
}, 6000);

Key Rules

  1. Maximum 1 attention animation visible at a time
  2. Auto-stop after 3-5 cycles (10 seconds max)
  3. Provide way to permanently dismiss
  4. Never use for non-essential content
  5. prefers-reduced-motion: static indicator only, no animation
  6. Urgent animations must have audio/haptic alternative for accessibility

版本历史

  • 8359713 当前 2026-12-03 14:20

同 Skill 集合

skills/01-by-domain/3d-spatial/SKILL.md
skills/01-by-domain/accessible-motion/SKILL.md
skills/01-by-domain/brand-marketing/SKILL.md
skills/01-by-domain/data-visualization/SKILL.md
skills/01-by-domain/game-development/SKILL.md
skills/01-by-domain/micro-interactions/SKILL.md
skills/01-by-domain/mobile-touch/SKILL.md
skills/01-by-domain/page-transitions/SKILL.md
skills/01-by-domain/presentations/SKILL.md
skills/01-by-domain/universal-fallback/SKILL.md
skills/01-by-domain/video-motion-graphics/SKILL.md
skills/01-by-domain/web-motion-design/SKILL.md
skills/02-by-thinking-style/anticipation-payoff/SKILL.md
skills/02-by-thinking-style/attention-direction/SKILL.md
skills/02-by-thinking-style/character-appeal/SKILL.md
skills/02-by-thinking-style/emotional-narrative/SKILL.md
skills/02-by-thinking-style/exaggerated-clarity/SKILL.md
skills/02-by-thinking-style/naturalistic-motion/SKILL.md
skills/02-by-thinking-style/physics-intuition/SKILL.md
skills/02-by-thinking-style/problem-diagnosis/SKILL.md
skills/02-by-thinking-style/rhythm-pacing/SKILL.md
skills/02-by-thinking-style/spatial-thinking/SKILL.md
skills/02-by-thinking-style/timing-mastery/SKILL.md
skills/02-by-thinking-style/universal-mindset/SKILL.md
skills/03-by-role-persona/accessibility-advocate/SKILL.md
skills/03-by-role-persona/animator-traditional/SKILL.md
skills/03-by-role-persona/brand-strategist/SKILL.md
skills/03-by-role-persona/creative-director/SKILL.md
skills/03-by-role-persona/educator-teacher/SKILL.md
skills/03-by-role-persona/filmmaker/SKILL.md
skills/03-by-role-persona/frontend-developer/SKILL.md
skills/03-by-role-persona/game-designer/SKILL.md
skills/03-by-role-persona/motion-designer/SKILL.md
skills/03-by-role-persona/product-manager/SKILL.md
skills/03-by-role-persona/universal-practitioner/SKILL.md
skills/03-by-role-persona/ux-researcher/SKILL.md
skills/04-by-skill-level/absolute-beginner/SKILL.md
skills/04-by-skill-level/advanced/SKILL.md
skills/04-by-skill-level/deep-dive/SKILL.md
skills/04-by-skill-level/expert/SKILL.md
skills/04-by-skill-level/intermediate/SKILL.md
skills/04-by-skill-level/master/SKILL.md
skills/04-by-skill-level/novice/SKILL.md
skills/04-by-skill-level/quick-start/SKILL.md
skills/04-by-skill-level/refresher/SKILL.md
skills/04-by-skill-level/teaching-others/SKILL.md
skills/04-by-skill-level/troubleshooting/SKILL.md
skills/04-by-skill-level/universal-reference/SKILL.md
skills/05-by-animation-type/continuous-loops/SKILL.md

元信息

文件数
0
版本
8359713
Hash
ff686002
收录时间
2026-12-03 14:20

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-12-03 14:35
浙ICP备14020137号-1