Community画像github.com

モーションとホバーのポリッシュレシピ

インターフェースに統一されたテンポを与え、ホバーや状態変化のマイクロインタラクションを定義するためのスキルです。CSSとMotionの期間階層(tap/pop/hover/card/layout)、スワップハンドオフ、行のハイライト成長、後続矢印、シェブロンナッジ、カードリフト(translate不使用)、スクロール端フェード、コピー&トグルボタンのアイコン/ラベルスワップなどを提供します。アニメーションに一貫性がなく、継続時間がバラバラ、ホバーが色しか変わらない、製品が平坦に感じられる場合に使用します。

モーションとホバーのポリッシュレシピ とは?

このスキルは、UIアニメーションとホバー状態のマイクロインタラクションを体系化し、統一されたテンポと一貫した動きの語彙を提供するものです。14以上のプロトタイプアプリで実証された2つの核となるアイデアに基づいています。第一に、継続時間はコンポーネントごとにバラバラに設定するのではなく、規模として捉え、小さい要素ほど速く動かすことで製品全体に統一感をもたらします。第二に、ホバーは幾何学的な動きを伴うべきで、色だけの変化はスイッチのように読まれてしまいます。 スキルは、Tailwind v4のCSSトークンとユーティリティ、Framer Motion用の同じ期間階層、React用のIconSwap/LabelSwapコンポーネントを提供します。tap(100ms), pop(150ms), hover(200ms), card(300ms), layout(500ms)の5段階の期間階層を定義し、既存の任意の継続時間を最も近い階層にマッピングする移行ガイドも含みます。具体的なレシピとして、hover-grow(行のハイライトが成長する)、trail(後続グリフの出現)、nudge(シェブロンの2px移動)、lift(カードの浮き上がり、translate不使用)、scroll-fade(スクロール端のマスクフェード)、およびアイコン/ラベルスワップを提供します。また、scroll-fadeとアニメーションする要素の共存や、Tailwind v4のカスタムdurationユーティリティに関する注意点など、実践的なトラップについても説明しています。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/Adamparishspok/skills/tree/HEAD/skills/motion-and-hover-polish

Installed? Explore more 画像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

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

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

ドキュメント

モーション階層とホバーレシピ

14以上のプロトタイプアプリで実証された2つのアイデア:

  1. 継続時間はコンポーネントごとの数値ではなく、規模である。 目は共通のテンポを一つの製品として読み取る。小さいものほど速く動く。
  2. ホバーは幾何学を、穏やかに動かす。 行の中に成長するハイライト、到着する矢印、行き先へ傾くシェブロン、次の状態へ転がるラベル。色だけのホバーはスイッチを切り替えたようにしか読まれない。

ファイル

  • references/recipes.css: Tailwind v4 @themeトークンと@utilityレシピ。
  • references/timing.ts: MotionとWAAPI向けの同じ階層。
  • references/swap.tsx: IconSwapとLabelSwap(React)。

階層

階層ms用途
tap100アイコンの切り替え、プレス
pop150メニュー、ポップオーバー、ツールチップの開く
hover200ポインターに応答する行やコントロール
card300カードの浮き上がり、リストの整列、ページの切り替え
layout500パネルの折りたたみ、ページのリフロー
  • 出現はイーズアウト(cubic-bezier(0.22,1,0.36,1))。退出はイーズインで、1階層短く実行する。
  • 2つのものが場所を入れ替える場合、退出するものは即座に去り、入ってくるものは delay-handoff(50ms)後に開始する。
  • 値のトゥイーン(カウンター、バーの充填、チャート線の描画)はより長く実行してもよい: 目はデータを追っている。
  • 意図的なスプリングは維持すること。

移行: すべてのアドホックな継続時間を最も近い階層にマップする。

アドホック値階層
0.12tap
0.15–0.18pop
0.2–0.24hover
0.28–0.35card
0.4–0.5layout

画面のタイミングはほとんどの場合20ms未満しか変化しないと予想される。

レシピ(要素ごとに一つ)

  • hover-grow (ナビゲーション行、リンク行):
    • ハイライトは、最初はインセット(3px×6px)で透明、その後行全体に膨らみながらフェードインする ::before。
    • :focus-visible、data-state=open、aria-current=page でも表示される。
    • スクエアまたはブルータリストのデザイン(Carbon風)では、代わりにフラットなハイライトを維持すること。
  • trail (リンク行、「プランを見る」):
    • 親の .group がホバーまたはフォーカスされるまでは半透明かつ半分のスケールの後続グリフが、そのリーディングエッジから成長する。
    • trail-out (左下から成長) と arrow-up-right を組み合わせて、アプリを離れるリンクを示す。
  • nudge / nudge-back (シェブロン、「すべて表示」、戻るリンク): 目的地に向かって2px傾く。
  • lift (クリック可能なカード):
    • card 階層にわたって、表面は一段明るく、影は一段深く。
    • 決してtranslateを使わない: カーソルの下でカードが跳ねると、照準対象が動いてしまう。
  • scroll-fade (スクロールするペイン):
    • マスクベースの端フェード。スクロール可能な側にのみ適用。コンテナ自身のスクロールタイムラインで駆動され、背景色は不要。
    • 非対応ブラウザでは単にフェードが表示されない。
  • IconSwap (メニューを閉じる、コピーからチェック、太陽から月):
    • 出ていくグリフは縮小し、−22°傾き、イーズインでフェードアウトする。
    • 入ってくるグリフはハンドオフ遅延の後に続く。
    • 両方ともマウントされたままなので、途中で逆転してもきれいに戻る。
  • LabelSwap (「リンクをコピー」から「コピー済み」、「折りたたむ」から「展開する」):
    • 両方のラベルが一つのグリッドセルに配置されるため、幅のジャンプが発生しない。
    • 隠れたラベルは transition-discrete により invisible になり、支援技術は現在のラベルのみを読み上げる。

トラップ

  • 自身をアニメーションさせる要素でのscroll-fade (Radixメニュー、ポップオーバー、セレクトコンテンツ) は、その要素の退出アニメーションを置き換える。Radixは終了しない終了を待ち、メニューが開いたままになる。フェードは内部のスクロールする子要素に配置すること。
  • scroll-fadeは境界線と影もマスクする。 境界線のあるカードに配置せず、内部のスクローラーに配置すること。
  • Tailwind v4のカスタムduration-*ユーティリティは、--tw-durationも設定する必要がある。そうしないと、同じ要素のtransition-[…]ユーティリティがソート順に応じて優先される。
  • ライン高を伴う名前付きタイプステップ (--text-meta--line-height) は、親のリーディングを継承していた任意のサイズを置き換える際、変換された各行を1ピクセルずらす。中間ステップには独自のライン高を持たせないこと。
  • ホバーは@media (hover: hover)の背後にゲートすること。 :focus-visibleで同じ状態を表示し、prefers-reduced-motionを尊重すること(Motion: <MotionConfig reducedMotion="user">)。

Individual skills in this repo

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

Adamparishspok/skills

Make a website, web app or online store ready for AI agents. Scan it with Cloudflare's Agent Readiness checks, decide which checks apply to this kind of site, ship the discovery files and headers in priority order, and add the AI-first basics the scanner does not score (server-rendered content, JSON-LD, llms.txt). Covers robots.txt AI rules, Content Signals, sitemap, Markdown for Agents (Accept text/markdown), Link headers, API catalog, OAuth discovery, auth.md, MCP server card, A2A agent card, agent skills index, WebMCP, and commerce protocols (ACP, UCP, AP2, MPP, x402). Use when making a site AI-ready, agent-ready or AI-first, or fixing an isitagentready.com or Cloudflare Agent Readiness report. Triggers on: AI ready, agent ready, AI-first, agent readiness, isitagentready, AI Crawl Control, Markdown for Agents, text/markdown, llms.txt, GPTBot, ClaudeBot, AI crawlers, Content-Signal, ai-train, api-catalog, .well-known, oauth-protected-resource, auth.md, MCP server card, agent card, agent skills, WebMCP, a...

Adamparishspok/skills

Install a complete, lean favicon set on any website or web app — the five files modern browsers, iOS and Android actually use, one block of head markup added once in the root layout, and a check that every file resolves. Covers finding the public folder per framework, generating the set from one SVG (or from a RealFaviconGenerator package), dark-mode SVG icons, maskable manifest icons, cache busting and verification. Use when adding, replacing or auditing a favicon, app icon, apple-touch-icon or web manifest. Triggers on: favicon, favicon.ico, favicon.svg, apple-touch-icon, site.webmanifest, manifest.json, app icon, PWA icon, maskable icon, tab icon, RealFaviconGenerator.

Adamparishspok/skills

Consolidate several apps or prototypes onto one shared component library without flattening their looks. Covers finding duplicated local components (buttons, selects, fields, modals, pagers, toasts), making shared components token-sized so each suite or app sets its own measurements, mapping variant names, deciding what stays app-specific, and the tailwind-merge traps that silently break custom tokens. Use when several apps each grew their own Btn/Select/Modal, when a design system's components "don't fit" a second product, or when retheming a family of apps. Triggers on: shared component library, design system consolidation, duplicate components, retheme, suite of apps, shadcn retokened, token-driven components, cn tailwind-merge custom tokens, variant mapping.

Adamparishspok/skills

Build or migrate a UI's neutral palette (grounds, surfaces, lines, ink/text) as an OKLCH formula driven by a few inputs instead of dozens of hand-picked hex values, with light and dark themes, per-step ladder overrides, a fit script that reproduces existing colours, and a browser contrast audit. Use when creating a theme, adding dark mode, retinting a product, auditing text contrast, or consolidating several apps' palettes. Triggers on: palette, neutrals, grey ramp, dark mode, theme tokens, oklch, retint, hue, contrast audit, design tokens, Tailwind @theme colours.

関連スキル