본문으로 건너뛰기
cccskills
무료GitHub에 공개

animation-best-practices

CSS and UI animation patterns for responsive, polished interfaces. Use when implementing hover effects, tooltips, button feedback, transitions, or fixing animation issues like flicker and shakiness.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Practical Animation Tips

Detailed reference guide for common animation scenarios. Use this as a checklist when implementing animations.

Recording & Debugging

Record Your Animations

When something feels off but you can't identify why, record the animation and play it back frame by frame. This reveals details invisible at normal speed.

Fix Shaky Animations

Elements may shift by 1px at the start/end of CSS transform animations due to GPU/CPU rendering handoff.

Fix:

.element {
  will-change: transform;
}

This tells the browser to keep the element on the GPU throughout the animation.

Take Breaks

Don't code and ship animations in one sitting. Step away, return with fresh eyes. The best animations are reviewed and refined over days, not hours.

Button & Click Feedback

Scale Buttons on Press

Make interfaces feel responsive by adding subtle scale feedback:

button:active {
  transform: scale(0.97);
}

This gives instant visual feedback that the interface is listening.

Don't Animate from scale(0)

Starting from scale(0) makes elements appear from nowhere—it feels unnatural.

Bad:

.element {
  transform: scale(0);
}
.element.visible {
  transform: scale(1);
}

Good:

.element {
  transform: scale(0.95);
  opacity: 0;
}
.element.visible {
  transform: scale(1);
  opacity: 1;
}

Elements should always have some visible shape, like a deflated balloon.

Tooltips & Popovers

Skip Animation on Subsequent Tooltips

First tooltip: delay + animation. Subsequent tooltips (while one is open): instant, no delay.

.tooltip {
  transition:
    transform 125ms ease-out,
    opacity 125ms ease-out;
  transform-origin: var(--transform-origin);
}

.tooltip[data-starting-style],
.tooltip[data-ending-style] {
  opacity: 0;
  transform: scale(0.97);
}

/* Skip animation for subsequent tooltips */
.tooltip[data-instant] {
  transition-duration: 0ms;
}

Radix UI and Base UI support this pattern with data-instant attribute.

Make Animations Origin-Aware

Popovers should scale from their trigger, not from center.

/* Default (wrong for most cases) */
.popover {
  transform-origin: center;
}

/* Correct - scale from trigger */
.popover {
  transform-origin: var(--transform-origin);
}

Radix UI:

.popover {
  transform-origin: var(--radix-dropdown-menu-content-transform-origin);
}

Base UI:

.popover {
  transform-origin: var(--transform-origin);
}

Speed & Timing

Keep Animations Fast

A faster-spinning spinner makes apps feel faster even with identical load times. A 180ms select animation feels more responsive than 400ms.

Rule: UI animations should stay under 300ms.

Don't Animate Keyboard Interactions

Arrow key navigation, keyboard shortcuts—these are repeated hundreds of times daily. Animation makes them feel slow and disconnected.

Never animate:

  • List navigation with arrow keys
  • Keyboard shortcut responses
  • Tab/focus movements

Be Careful with Frequently-Used Elements

A hover effect is nice, but if triggered multiple times a day, it may benefit from no animation at all.

Guideline: Use your own product daily. You'll discover which animations become annoying through repeated use.

Hover States

Fix Hover Flicker

When hover animation changes element position, the cursor may leave the element, causing flicker.

Problem:

.box:hover {
  transform: translateY(-20%);
}

Solution: Animate a child element instead:

<div class="box">
  <div class="box-inner"></div>
</div>
.box:hover .box-inner {
  transform: translateY(-20%);
}

.box-inner {
  transition: transform 200ms ease;
}

The parent's hover area stays stable while the child moves.

Disable Hover on Touch Devices

Touch devices don't have true hover. Accidental finger movement triggers unwanted hover states.

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: scale(1.05);
  }
}

Note: Tailwind v4's hover: class automatically applies only when the device supports hover.

Touch & Accessibility

Ensure Appropriate Target Areas

Small buttons are hard to tap. Use a pseudo-element to create larger hit areas without changing layout.

Minimum target: 44px (Apple and WCAG recommendation)

@utility touch-hitbox {
  position: relative;
}

@utility touch-hitbox::before {
  content: "";
  position: absolute;
  display: block;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  min-height: 44px;
  min-width: 44px;
  z-index: 9999;
}

Usage:

<button className="touch-hitbox">
  <BellIcon />
</button>

Easing Selection

Use ease-out for Enter/Exit

Elements entering or exiting should use ease-out. The fast start creates responsiveness.

.dropdown {
  transition:
    transform 200ms ease-out,
    opacity 200ms ease-out;
}

ease-in starts slow—wrong for UI. Same duration feels slower because the movement is back-loaded.

Use ease-in-out for On-Screen Movement

Elements already visible that need to move should use ease-in-out. Mimics natural acceleration/deceleration like a car.

.slider-handle {
  transition: transform 250ms ease-in-out;
}

Use Custom Easing Curves

Built-in CSS curves are usually too weak. Custom curves create more intentional motion.

Resources:

Visual Tricks

Use Blur as a Fallback

When easing and timing adjustments don't solve the problem, add subtle blur to mask imperfections.

.button-transition {
  transition:
    transform 150ms ease-out,
    filter 150ms ease-out;
}

.button-transition:active {
  transform: scale(0.97);
  filter: blur(2px);
}

Blur bridges visual gaps between states, tricking the eye into seeing smoother transitions. The two states blend instead of appearing as distinct objects.

Performance note: Keep blur under 20px, especially on Safari.

Why Details Matter

"All those unseen details combine to produce something that's just stunning, like a thousand barely audible voices all singing in tune." — Paul Graham, Hackers and Painters

Details that go unnoticed are good—users complete tasks without friction. Great interfaces enable users to achieve goals with ease, not to admire animations.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when working with the 1Password CLI (`op` command) for secrets management, retrieving API keys, injecting secrets into development environments, or any task involving 1Password vault operations. Triggers on: "1password", "op command", "secrets management", "api keys from vault", "op run", "op read", "service account token".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

thedaviddias/agent-forge32026년 5월 18일 업데이트

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

thedaviddias/agent-forge32026년 5월 18일 업데이트

Create and manage teams of specialized AI agents that work together on tasks. Use when setting up multi-agent workflows, agent squads for content/marketing/research pipelines, configuring heartbeat-based agent coordination, or managing agent personalities via SOUL.md files. Enables orchestration of multiple OpenClaw sessions as a coordinated team with shared task systems (Linear, Trello, etc.).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

thedaviddias/agent-forge32026년 5월 18일 업데이트

Create algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use when users request generative art, algorithmic art, flow fields, or particle systems. Create original works rather than copying existing artists.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

thedaviddias/agent-forge32026년 5월 18일 업데이트

Use when starting creative work (features, components, functionality, or behavior changes) to clarify user intent, requirements, and design before implementation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

thedaviddias/agent-forge32026년 5월 18일 업데이트

Applies Anthropic brand colors and typography to artifacts that need a consistent look-and-feel. Use when brand colors, style guidelines, visual formatting, or company design standards apply.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

thedaviddias/agent-forge32026년 5월 18일 업데이트

thedaviddias의 스킬 모두 보기

이 스킬의 문제 신고