Communitygithub.com

마이크로 인터랙션 (UI 모션)

사용자가 '호버/프레스 효과 추가', '토글/스위치 애니메이션', '좋아요 버튼 애니메이션', '토스트/스낵바 슬라이드 인', '드로어/모달 애니메이션', '리스트 재정렬/추가/제거 애니메이션', '공유 요소 레이아웃 전환', 'UI 피드백 개선'을 요청할 때 사용합니다. Framer Motion (motion/react)과 최신 CSS로 UI 모션을 구현합니다.

마이크로 인터랙션 (UI 모션)란 무엇인가요?

이 스킬은 마이크로 인터랙션(UI 모션)을 구현하는 방법을 상세히 설명합니다. 호버, 프레스, 포커스, 토글, 토스트, 드로어, 리스트 추가/제거/재정렬, 로딩-성공-실패 상태 전환 등 사용자 인터페이스의 반응성을 높이는 작은 모션에 초점을 맞춥니다. Framer Motion (motion/react)과 순수 CSS 두 가지 접근 방식을 모두 지원하며, 모두 `prefers-reduced-motion`을 존중하고 GPU 가속을 위해 `transform`과 `opacity`만 애니메이션하는 원칙을 따릅니다. 100–250ms의 짧은 지속 시간, 비대칭 진입/퇴장 타이밍, 스프링 기반의 즉각적인 피드백을 강조합니다. 또한, 독립형 HTML 파일로 데모를 제공하고 `?state=` 쿼리 파라미터를 통해 결정론적 상태(예: idle, hover, open)를 고정하여 스크린샷을 찍을 수 있도록 하는 방법을 설명합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/nehakanjamala/personal_website/tree/HEAD/.agents/skills/micro-interaction

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

마이크로 인터랙션 (UI 모션)은(는) 무엇을 하나요?

작지만 기능적인 모션으로 인터페이스를 반응적이고 살아있게 만듭니다: 호버/프레스/포커스 피드백, 토글, 토스트, 드로어, 리스트/레이아웃 애니메이션. 목표는 피드백과 연속성이며, 장식이 아닙니다.

사용 시기

  • 호버/프레스/포커스 피드백; 토글, 체크박스, 좋아요/하트 버튼
  • 토스트/스낵바, 드로어, 모달, 툴팁, 아코디언 (진입/퇴장)
  • 리스트 추가/제거/재정렬; 공유 요소 ("매직 무브") 레이아웃 전환
  • 로딩 → 성공 → 에러 상태 전환

원칙 (모두에 적용)

  • 지속 시간: UI 마이크로 인터랙션은 100–250ms에서 이루어집니다. 400ms 이상이면 클릭 반응이 느리게 느껴집니다.
  • transform과 opacity만 애니메이션합니다. 이들은 GPU 합성되며(레이아웃/페인트 없음) width/height/top/left 애니메이션은 피하고 scale이나 레이아웃 애니메이션을 사용합니다.
  • 프레스 피드백을 즉각적으로 제공: 탭 시 scale: 0.96을 빠른 스프링과 함께 사용합니다.
  • 비대칭 타이밍: 진입은 약간 느리게(ease-out), 퇴장은 더 빠르게(ease-in). 요소는 우아하게 도착하고 신속하게 떠나야 합니다.
  • prefers-reduced-motion 존중: 필수적이지 않은 모션은 차단하고, 불투명도 변화는 유지하며 큰 움직임은 제거합니다.
  • 이징 기본값: 진입 ease-out cubic-bezier(0.16, 1, 0.3, 1); 세련된 오버슈트는 cubic-bezier(0.34, 1.56, 0.64, 1); 표준 이동 cubic-bezier(0.4, 0, 0.2, 1).

Framer Motion (motion/react) 필수 요소

v11부터 패키지는 motion/react로 임포트됩니다(framer-motion이라는 이름도 여전히 동작합니다).

제스처와 스프링

import { motion } from "motion/react";

<motion.button
  whileHover={{ scale: 1.03 }}
  whileTap={{ scale: 0.96 }}
  whileFocus={{ boxShadow: "0 0 0 3px rgba(59,130,246,.5)" }}
  transition={{ type: "spring", stiffness: 400, damping: 30 }}
/>

스프링 직관: stiffness가 높을수록 더 빠름; damping이 높을수록 바운스가 적음. stiffness: 400, damping: 30은 스냅피한 UI 기본값입니다. 눈에 띄는 바운스를 원하면 damping을 낮춥니다(예: damping: 12).

AnimatePresence로 진입 / 퇴장

퇴장 애니메이션에는 조건부로 렌더링되는 각 자식에 고유한 key가 있는 AnimatePresence 래핑이 필요합니다.

import { AnimatePresence, motion } from "motion/react";

<AnimatePresence>
  {open && (
    <motion.div
      key="panel"
      initial={{ opacity: 0, y: 8 }}
      animate={{ opacity: 1, y: 0 }}
      exit={{ opacity: 0, y: 8 }}
      transition={{ duration: 0.2, ease: [0.16, 1, 0.3, 1] }}
    />
  )}
</AnimatePresence>

토스트/리스트의 경우 mode="popLayout"을 사용하여 제거된 항목이 퇴장하는 동안 공간을 차지하지 않도록 합니다.

레이아웃 애니메이션 (특급 기술)

layout은 모든 레이아웃 변경(위치/크기)을 자동으로 트랜스폼을 사용해 애니메이션합니다 — 재정렬, 확장 카드, 그리드<->리스트에 적합합니다.

<motion.li layout transition={{ type: "spring", stiffness: 500, damping: 40 }} />

컴포넌트 간 공유 요소 전환: 두 요소에 동일한 layoutId를 부여하면 Framer Motion이 하나가 마운트되고 다른 하나가 언마운트될 때 그 사이를 애니메이션합니다.

{!open && <motion.div layoutId="card" onClick={() => setOpen(true)} />}
<AnimatePresence>
  {open && <motion.div layoutId="card" />} {/* 소스에서 "매직 무브" */}
</AnimatePresence>

주의: 일반 layout 요소는 스케일 중 border-radius와 텍스트를 왜곡합니다. 역스케일해야 하는 직접 자식에 layout을 추가하고, borderRadius/boxShadow를 모션 값으로 사용하거나, 위치만 애니메이션하려면 layout="position"을 사용합니다.

순수 CSS 방식 (JS 없음, 이산 속성 포함)

최신 CSS는 라이브러리 없이도 진입/퇴장 및 display 토글까지 애니메이션할 수 있습니다.

.toast {
  transition: opacity 0.2s ease, transform 0.2s ease;
  /* display:none으로/으로부터의 애니메이션 및 초기 렌더링 허용 */
  transition-behavior: allow-discrete;
}
.toast[hidden] { display: none; }

/* 첫 렌더링 / 진입 시 이 값들로부터 애니메이션 */
@starting-style {
  .toast { opacity: 0; transform: translateY(8px); }
}

@starting-style은 요소가 처음 나타날 때 애니메이션으로 진입할 수 있도록 "열기 전" 값을 정의합니다. transition-behavior: allow-discrete는 display(팝오버/다이얼로그의 경우 overlay)가 참여하도록 하여 요소가 제거되기 전에 퇴장 애니메이션이 실행되도록 합니다. Chrome/Edge/Safari에서 기본 지원; 구형 브라우저를 위한 비애니메이션 폴백을 제공합니다.

항상 reduced-motion 가드를 포함합니다:

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

상태, 단순한 장식이 아님

로딩 → 성공 → 에러는 하나의 연속적인 모션이어야 합니다(예: 버튼이 스피너 → 체크마크로 변형). 점프 컷이 아닙니다. 요소를 마운트된 상태로 유지하고 상태 간 애니메이션하여 시선이 동일한 객체를 추적하도록 합니다.

제공 및 확인 (독립형 HTML)

패키지화된 도우미 (scripts/): scripts/seek-shot.sh anim.html 0 1.5 3는 ?t=N 하네스를 고정하고 각 순간을 스크린샷합니다; scripts/contact-sheet.sh sheet.png frame-*.png는 한눈에 검토할 수 있도록 타일링합니다. scripts/README.md를 참조하세요.

자체 포함된 인터랙션 데모(토글, 좋아요 버튼, 토스트, 드로어)의 경우 결과물은 브라우저에서 직접 열리는 하나의 HTML 파일입니다. 순수 CSS 인터랙션은 그대로 제공; Framer Motion 데모의 경우 CDN(esm.sh)에서 React + motion을 하나의 인라인 모듈로 로드합니다 — 빌드 단계 없음. 하나의 파일이 적절한 수준입니다; 번들러를 사용하지 마세요.

출력 규약:

  • 하나의 .html 파일: 마크업과 CSS 전환/@starting-style 또는 CDN에서 motion을 임포트하는 인라인 <script type="module">.
  • 스크린샷을 위한 해결된 최종 상태에 도달하는 방법 — 인터랙션은 시간 기반이 아닌 상태 기반이므로, 시계가 아닌 상태를 고정합니다.

시크 하네스 — 결정론적 상태 고정. 마이크로 인터랙션의 "프레임"은 상태(대기 / 호버 / 눌림 / 열림)입니다. ?state=open은 로드 시 대상 상태를 적용하여 스크린샷이 안정된 상태를 캡처하도록 합니다:

<script>
  const s = new URLSearchParams(location.search).get("state");
  if (s) document.documentElement.dataset.state = s;   // CSS는 [data-state="open"]을 사용
  // Framer Motion: `s`에서 제어 prop 설정 (예: const [open]=useState(s==="open"))
  // CSS @keyframes 루프를 고정하려면: el.style.animationDelay=(-N)+"s"; el.style.animationPlayState="paused";
  window.__ready = true;
</script>

검증 루프 — 렌더링 → 상태 설정 → 스크린샷 → 확인: 각 의미 있는 상태(?state=idle, ?state=hover, ?state=open)를 열고, 스크린샷을 찍고, 충실도(프레스 피드백이 즉각적으로 읽히는지, 퇴장이 언마운트 전에 실행되는지)와 아티팩트(layout이 border-radius/텍스트를 왜곡하는지, 토스트가 퇴장 후 공간을 차지하는지, FOUC, 잽)를 확인합니다. 모든 헤드리스 도구가 작동합니다:

npx playwright screenshot --wait-for-timeout=400 "file://$PWD/demo.html?state=open" open.png

완료 전 확인 사항:

  1. 독립 실행형으로 열림 — 콘솔 오류 없음, CDN React/motion(사용된 경우)이 정상 해결됨.
  2. ?state= (또는 제어 prop) 고정이 결정론적이고 안정된 상태를 캡처함.
  3. 모든 상태(대기 / 활성 / 열림)에서 스크린샷이 요구 사항과 일치하고 아티팩트가 없음.
  4. prefers-reduced-motion 준수 — 큰 움직임 제거, 불투명도/피드백 유지.
  5. 이징이 의도적임 — 진입 ease-out, 퇴장 ease-in, 지속 시간 100–250ms 범위.

빠른 참조

필요접근 방식
프레스 피드백whileTap={{ scale: 0.96 }} 스프링 400/30
진입/퇴장AnimatePresence + initial/animate/exit
재정렬 / 크기 변경layout prop (스프링)
매직 무브공유 layoutId
토스트 스택AnimatePresence mode="popLayout"
JS 없는 진입@starting-style + 전환
display:none 애니메이션transition-behavior: allow-discrete
접근성prefers-reduced-motion 가드 항상 포함

참조 파일

  • references/framer-motion-recipes.md — 변형 + 스태거, AnimatePresence 모드, layout/layoutId 매직 무브, Reorder 드래그-투-정렬, 드래그 제약, 제스처 구성, useReducedMotion.
  • references/css-recipes.md — @starting-style, transition-behavior: allow-discrete, 팝오버/다이얼로그 퇴장 애니메이션, 키프레임 스피너/토글, @property로 애니메이션 가능한 사용자 정의 속성, prefers-reduced-motion 패턴.

Individual skills in this repo

This repo contains 13 individual skills — each has its own dedicated page.

nehakanjamala/personal_website

This skill should be used when the user asks to "fix janky CSS animation", "make animation 60fps", "stop layout thrashing", "animate width/height/top/left smoothly", "convert animation to transform", "animate box-shadow performantly", "animate height auto", "FLIP animation", or "why is my scroll/hover animation choppy".

nehakanjamala/personal_website

This skill should be used when the user asks to "respect prefers-reduced-motion", "honor reduced motion", "make my animations accessible", "fix vestibular / motion-sickness issues", "add a useReducedMotion hook", "gate GSAP / Framer Motion / Lenis for reduced motion", or "meet WCAG 2.3.3 / C39". Provides tiered (not all-or-nothing) reduced-motion patterns in CSS and JS.

nehakanjamala/personal_website

Create, modify, debug, and deploy Apify Actors, and write their input and output schemas. Use when building an Actor from scratch, changing or troubleshooting Actor code, generating or updating .actor schema files, or pushing an Actor to the Apify platform. To wrap an existing non-Actor project, use apify-actorization instead.

nehakanjamala/personal_website

Convert existing projects into Apify Actors - serverless cloud programs. Actorize JavaScript/TypeScript (SDK with Actor.init/exit), Python (async context manager), or any language (CLI wrapper). Use when migrating code to Apify, wrapping CLI tools as Actors, or adding Actor SDK to existing projects.

nehakanjamala/personal_website

Deprecated. Output schema generation moved to the apify-actor-development skill; prefer that skill whenever it is available.

nehakanjamala/personal_website

Design and build an official Apify integration for a company's product - workflow-automation apps (Zapier/n8n-style), AI agent plugins (coding-agent skills+MCP bundles or OpenClaw/Hermes-style harnesses), AI framework packages (LangChain/LlamaIndex-style), or direct application clients via apify-client. Use when planning, creating, or reviewing an integration that exposes Apify Actors, runs, datasets, or key-value stores inside another product.

nehakanjamala/personal_website

Universal AI-powered web scraper for any platform. Scrape data from Instagram, Facebook, TikTok, YouTube, LinkedIn, X/Twitter, Google Maps, Google Search, Google Trends, Reddit, Airbnb, Yelp, and 15+ more platforms. Use for lead generation, brand monitoring, competitor analysis, influencer discovery, trend research, content analytics, audience analysis, review analysis, SEO intelligence, recruitment, or any data extraction task.

nehakanjamala/personal_website

This skill should be used when the user asks to "add a glassmorphism effect", "frosted glass UI", "Apple liquid glass style", "frosted blur card", "translucent glass panel animation", "make a frosted nav bar", "build a glass modal/dialog", "animate a glass card on hover", or "add a refracting liquid-glass hero". Covers frosted translucent panels with backdrop-filter blur, edge/specular highlights, SVG liquid-glass refraction, motion on hover/scroll/enter, and accessible reduced-transparency fallbacks.

nehakanjamala/personal_website

This skill should be used when the user asks to "build a scroll animation", "add ScrollTrigger", "pin a section while scrolling", "scrub an animation to scroll", "create a hero timeline", "do a horizontal scroll section", "split text and animate words", "animate a layout change with GSAP Flip", "sync ScrollTrigger with Lenis", "Lenis smooth scroll jittery", "ScrollTrigger markers drift", "ScrollTrigger pins break with Lenis/Locomotive", or "set up smooth scroll with GSAP pinning". Covers GSAP timelines, ScrollTrigger, SplitText, Flip, and Lenis/Locomotive smooth-scroll sync for code-driven web motion.

nehakanjamala/personal_website

This skill should be used when the user asks to "add a Lottie animation", "play a .lottie or .json animation", "integrate a Bodymovin/After Effects animation on web or mobile", "control Lottie playback / segments", "make a scroll-driven Lottie", "recolor a Lottie at runtime", or "export an AE animation to Lottie". Covers dotLottie/lottie-web integration, playback control, interactivity, theming, and the AE export checklist.

nehakanjamala/personal_website

This skill should be used when the user asks to "animate page or route transitions", "add a page transition or crossfade between views", "animate route changes in Next.js App Router", "use the View Transitions API", "AnimatePresence exit doesn't fire on navigation", or "Framer Motion exit animation not working / exit animation before unmount in Next.js". Covers enter/exit page-transition animation with the View Transitions API and Framer Motion, for Next.js App Router and general SPA routing.

nehakanjamala/personal_website

Scrape web pages using Scrapling with anti-bot bypass (like Cloudflare Turnstile), stealth headless browsing, spiders framework, adaptive scraping, and JavaScript rendering. Use when asked to scrape, crawl, or extract data from websites; web_fetch fails; the site has anti-bot protections; write Python code to scrape/crawl; or write spiders.

nehakanjamala/personal_website

This skill should be used when the user asks to "animate an SVG", "make a line draw itself on", "do a stroke draw-on / signature animation", "morph one shape into another", "move an element along a path", "animate an icon/logo", or "animate an SVG gradient or filter". Covers stroke-dashoffset draw-on, path morphing, motion-along-path, and animated icons/gradients/filters via CSS, SMIL, and GSAP.

관련 스킬