Communitygithub.com

インタラクションデザイン

マイクロインタラクション、モーションデザイン、トランジション、ユーザーフィードバックパターンの設計と実装。UI操作の洗練、ローディング状態の実装、魅力的なユーザー体験の作成に使用します。

インタラクションデザイン とは?

このスキルは、モーション、フィードバック、そして思慮深い状態遷移を通じて、使いやすさを向上させ、ユーザーを魅了する直感的なインタラクションを作成するためのものです。開発者は、フレーマーモーション(Framer Motion)やCSSアニメーションを使用して、ボタンのホバーやタップ、トグルスイッチ、ページ遷移、リップルエフェクト、スワイプ操作など、さまざまなインタラクションパターンを実装する方法を学べます。また、パフォーマンスを最適化し、`prefers-reduced-motion`メディアクエリを使用してアクセシビリティを確保するためのベストプラクティスも提供します。このスキルは、特にReactベースのプロジェクト(Framer Motion対応)と、あらゆるCSSアニメーションワークフローにおいて有用で、一貫性のある自然なユーザー体験を実現します。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/ulasalyesil/personal-website-v2/tree/HEAD/.agent/skills/interaction-design

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

インタラクションデザイン は何をしますか?

モーション、フィードバック、そして思慮深い状態遷移を通じて、使いやすさを向上させ、ユーザーを魅了する、魅力的で直感的なインタラクションを生み出します。

このスキルを使うタイミング

  • ユーザーフィードバックを強化するためのマイクロインタラクションの追加
  • スムーズなページ遷移やコンポーネント遷移の実装
  • ローディング状態やスケルトンスクリーンの設計
  • ジェスチャーベースのインタラクションの作成
  • 通知やトーストシステムの構築
  • ドラッグ&ドロップインターフェースの実装
  • スクロールトリガーアニメーションの追加
  • ホバー状態とフォーカス状態の設計

基本原則

1. 目的のあるモーション

モーションは、装飾ではなく、伝達のためにあるべきです:

  • フィードバック: ユーザーのアクションが発生したことを確認する
  • 方向性: 要素がどこから来たか、どこへ行くかを示す
  • 集中: 重要な変更に注意を向けさせる
  • 継続性: 遷移中にコンテキストを維持する

2. タイミングガイドライン

時間使用例
100-150msマイクロフィードバック(ホバー、クリック)
200-300ms小さな遷移(トグル、ドロップダウン)
300-500ms中程度の遷移(モーダル、ページ変更)
500ms以上複雑で高度に演出されたアニメーション

3. イージング関数

/* 共通のイージング */
--ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* 減速 - 進入 */
--ease-in: cubic-bezier(0.55, 0, 1, 0.45); /* 加速 - 退出 */
--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* 両方 - 移動 */
--spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* オーバーシュート - 遊び心 */

クイックスタート: ボタンのマイクロインタラクション

import { motion } from "framer-motion";

export function InteractiveButton({ children, onClick }) {
  return (
    <motion.button
      onClick={onClick}
      whileHover={{ scale: 1.02 }}
      whileTap={{ scale: 0.98 }}
      transition={{ type: "spring", stiffness: 400, damping: 17 }}
      className="px-4 py-2 bg-blue-600 text-white rounded-lg"
    >
      {children}
    </motion.button>
  );
}

インタラクションパターン

1. ローディング状態

スケルトンスクリーン: ローディング中にレイアウトを維持する

function CardSkeleton() {
  return (
    <div className="animate-pulse">
      <div className="h-48 bg-gray-200 rounded-lg" />
      <div className="mt-4 h-4 bg-gray-200 rounded w-3/4" />
      <div className="mt-2 h-4 bg-gray-200 rounded w-1/2" />
    </div>
  );
}

進行状況インジケーター: 確定した進行状況を表示する

function ProgressBar({ progress }: { progress: number }) {
  return (
    <div className="h-2 bg-gray-200 rounded-full overflow-hidden">
      <motion.div
        className="h-full bg-blue-600"
        initial={{ width: 0 }}
        animate={{ width: `${progress}%` }}
        transition={{ ease: "easeOut" }}
      />
    </div>
  );
}

2. 状態遷移

スムーズな遷移を伴うトグル:

function Toggle({ checked, onChange }) {
  return (
    <button
      role="switch"
      aria-checked={checked}
      onClick={() => onChange(!checked)}
      className={`
        relative w-12 h-6 rounded-full transition-colors duration-200
        ${checked ? "bg-blue-600" : "bg-gray-300"}
      `}
    >
      <motion.span
        className="absolute top-1 left-1 w-4 h-4 bg-white rounded-full shadow"
        animate={{ x: checked ? 24 : 0 }}
        transition={{ type: "spring", stiffness: 500, damping: 30 }}
      />
    </button>
  );
}

3. ページ遷移

フレーマーモーションのレイアウトアニメーション:

import { AnimatePresence, motion } from "framer-motion";

function PageTransition({ children, key }) {
  return (
    <AnimatePresence mode="wait">
      <motion.div
        key={key}
        initial={{ opacity: 0, y: 20 }}
        animate={{ opacity: 1, y: 0 }}
        exit={{ opacity: 0, y: -20 }}
        transition={{ duration: 0.3 }}
      >
        {children}
      </motion.div>
    </AnimatePresence>
  );
}

4. フィードバックパターン

クリック時のリップルエフェクト:

function RippleButton({ children, onClick }) {
  const [ripples, setRipples] = useState([]);

  const handleClick = (e) => {
    const rect = e.currentTarget.getBoundingClientRect();
    const ripple = {
      x: e.clientX - rect.left,
      y: e.clientY - rect.top,
      id: Date.now(),
    };
    setRipples((prev) => [...prev, ripple]);
    setTimeout(() => {
      setRipples((prev) => prev.filter((r) => r.id !== ripple.id));
    }, 600);
    onClick?.(e);
  };

  return (
    <button onClick={handleClick} className="relative overflow-hidden">
      {children}
      {ripples.map((ripple) => (
        <span
          key={ripple.id}
          className="absolute bg-white/30 rounded-full animate-ripple"
          style={{ left: ripple.x, top: ripple.y }}
        />
      ))}
    </button>
  );
}

5. ジェスチャーインタラクション

スワイプで閉じる:

function SwipeCard({ children, onDismiss }) {
  return (
    <motion.div
      drag="x"
      dragConstraints={{ left: 0, right: 0 }}
      onDragEnd={(_, info) => {
        if (Math.abs(info.offset.x) > 100) {
          onDismiss();
        }
      }}
      className="cursor-grab active:cursor-grabbing"
    >
      {children}
    </motion.div>
  );
}

CSS アニメーションパターン

キーフレームアニメーション

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}
.animate-spin {
  animation: spin 1s linear infinite;
}

CSS 遷移

.card {
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

アクセシビリティの考慮事項

/* ユーザーの動作設定を尊重 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
function AnimatedComponent() {
  const prefersReducedMotion = window.matchMedia(
    "(prefers-reduced-motion: reduce)",
  ).matches;

  return (
    <motion.div
      animate={{ opacity: 1 }}
      transition={{ duration: prefersReducedMotion ? 0 : 0.3 }}
    />
  );
}

ベストプラクティス

  1. パフォーマンス最優先: スムーズな60fpsを実現するためにtransformとopacityを使用する
  2. 動作軽減のサポート: 常にprefers-reduced-motionを尊重する
  3. 一貫したタイミング: アプリ全体でタイミングスケールを使用する
  4. 自然な物理: 線形アニメーションよりもスプリングアニメーションを優先する
  5. 中断可能: ユーザーが長いアニメーションをキャンセルできるようにする
  6. プログレッシブエンハンスメント: JavaScriptアニメーションなしでも動作するようにする
  7. 実機でテスト: パフォーマンスはデバイスによって大きく異なる

よくある問題

  • カクつくアニメーション: width、height、top、leftのアニメーションは避ける
  • 過剰なアニメーション: 動きが多すぎると疲労を引き起こす
  • ブロッキングインタラクション: アニメーション中にユーザー入力を妨げない
  • メモリリーク: アンマウント時にアニメーションリスナーをクリーンアップする
  • コンテンツのフラッシュ: 最適化のためにwill-changeは控えめに使用する

参考資料

Individual skills in this repo

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

ulasalyesil/personal-website-v2

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

ulasalyesil/personal-website-v2

Conduct design interviews, generate five distinct UI variations in a temporary design lab, collect feedback, and produce implementation plans. Use when the user wants to explore UI design options, redesign existing components, or create new UI with multiple approaches to compare.

ulasalyesil/personal-website-v2

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

ulasalyesil/personal-website-v2

This skill is for interface design — dashboards, admin panels, apps, tools, and interactive products. NOT for marketing design (landing pages, marketing sites, campaigns).

ulasalyesil/personal-website-v2

Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.

ulasalyesil/personal-website-v2

UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.

ulasalyesil/personal-website-v2

Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.

ulasalyesil/personal-website-v2

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

ulasalyesil/personal-website-v2

Enforces an opinionated UI baseline to prevent AI-generated interface slop.

ulasalyesil/personal-website-v2

Build modern, composable, and accessible React UI components following the components.build specification. Use when creating, reviewing, or refactoring component libraries, design systems, or any reusable UI components. Triggers on tasks involving component APIs, composition patterns, accessibility, styling systems, or TypeScript props.

ulasalyesil/personal-website-v2

Ship correct, complete metadata.

ulasalyesil/personal-website-v2

Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.

ulasalyesil/personal-website-v2

Defines the product's objects, relationships, states, and vocabulary independently of any interface — the most load-bearing layer

ulasalyesil/personal-website-v2

Maps domain concepts, terminology conflicts, and bounded contexts — produces a noun harvest for the conceptual model layer

ulasalyesil/personal-website-v2

Maps interaction structure and flow — produces breadboard notation with edge cases, failure paths, and open decisions

ulasalyesil/personal-website-v2

Framework orientation for Layers of Product Design — load this first; provides the context all other skills depend on

ulasalyesil/personal-website-v2

User research planning and synthesis at the observed behaviour layer — produces candidate job stories with confidence ratings

ulasalyesil/personal-website-v2

Diagnostic audit across all seven layers — identifies the bottleneck layer and recommends where to focus

ulasalyesil/personal-website-v2

Connects user opportunities to business outcomes and solution bets — produces a strategy tree and prioritised experiments

ulasalyesil/personal-website-v2

Audits existing surface against lower-layer decisions and produces a surface decision inventory — vocabulary, object consistency, completeness, feedback, hierarchy, accessibility

関連スキル