transitions-dev

Jakubantalik/transitions-dev · Agent Skill

為網頁應用程式提供的CSS過渡效果的預製模板,包含了卡片、模態視窗、下拉式選單、面板和頁面過渡等的程式碼片段。

前往安裝 ↓

總覽

發布者Jakubantalik社群
儲存庫Jakubantalik/transitions-dev ↗
技能資料夾transitions-dev
星46
分支6
附帶檔案14
授權MIT
最近更新2026年5月20日
連結技能原始碼 ↗ · 儲存庫 ↗

Mozgi 檢查

我們在技能檔案中發現的內容。詳細資訊需訂閱。

安全性
低風險 · 未發現明顯風險 — 完整報告會顯示細節
相容性
僅含說明 — 適用於多數代理
相似技能
找到 58 個相似技能
訂閱另含

安裝

技能就是一個含 SKILL.md 的資料夾。選擇你的代理,在專案根目錄的終端機(macOS、Linux 或 Windows 的 Git Bash)執行指令。

把提示貼到 Claude、Codex 或其他助理:它會自行檢查並安裝技能。

Install the “transitions-dev” skill from mozgi.io (https://mozgi.io/skills/jakubantalik-transitions-dev/) for me.

1. Download the archive: https://mozgi.io/skills/jakubantalik-transitions-dev/download
   If it fails, take the skill folder from the source: https://github.com/Jakubantalik/transitions-dev/tree/main/skills/transitions-dev
2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me.
3. Put the “transitions-dev” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.).
4. Make sure <skills folder>/transitions-dev/SKILL.md exists.
5. Briefly tell me what this skill does and offer to try it on my task.

If you cannot do a step yourself, tell me what to click or type.

技能檔案

14 個檔案 下載 ZIP

安裝前請先檢視 SKILL.md 與相關檔案。點擊檔案即可預覽。

SKILL.md 內容

作者原文 · 唯讀

Transitions.dev

Twelve portable CSS transitions, each namespaced under t-* selectors with semantic CSS custom properties. Drop-in: paste the snippet, wire the documented HTML hooks, done. No framework dependencies, no demo-specific markup, and every snippet ships a prefers-reduced-motion guard.

Quick reference

| Transition | When to use | Reference |

| --- | --- | --- |

| Card resize | Tween a container's width or height when its layout state changes. | 01-card-resize.md ↗ |

| Number pop-in | Re-enter each digit with a blurred slide when a number updates. | 02-number-pop-in.md ↗ |

| Notification badge | Slide a small badge onto a trigger and pop the dot. | 03-notification-badge.md ↗ |

| Text states swap | Swap text in place with a blurred up-and-down transition. | 04-text-states-swap.md ↗ |

| Menu dropdown | Open an origin-aware dropdown that grows from its trigger. | 05-menu-dropdown.md ↗ |

| Modal open / close | Scale-up modal dialog with a softer scale-down on close. | 06-modal.md ↗ |

| Panel reveal | Slide a panel into a region with a cross-blur. | 07-panel-reveal.md ↗ |

| Page side-by-side | Slide between two side-by-side pages (list ↔ detail, step 1 ↔ step 2). | 08-page-side-by-side.md ↗ |

| Icon swap | Cross-fade two icons in the same slot with blur and scale. | 09-icon-swap.md ↗ |

| Success check | Compose fade + rotate + Y-bob + path stroke-draw to celebrate a completed action. | 10-success-check.md ↗ |

| Avatar group hover | Distance-falloff lift on a row of items with a bouncy spring on return. | 11-avatar-group-hover.md ↗ |

| Error state shake | Per-segment cubic-bezier shake with auto-reverting border + message. | 12-error-state-shake.md ↗ |

Decision rules

When the user asks for a transition, match against the visible UI element first, then the verb:

  • Trigger + small dot floating on top → notification badge.
  • Trigger + surface that grows from it → dropdown (anchored, origin-aware) or modal (centered, no anchor).
  • Surface that slides into a region of the page → panel reveal.
  • Two screens, list ↔ detail or step 1 ↔ step 2 → page side-by-side.
  • Element changes width or height → card resize.
  • Element's text content changes in place → text states swap.
  • Two icons in the same slot → icon swap.
  • A number updates → number pop-in.
  • Confirmation / success / "done" moment (checkmark, payment processed, file uploaded) → success check.
  • Hovering an item in a horizontal stack (avatars, chips, segmented buttons, tag pills) → avatar group hover.
  • Form validation error / "this is wrong" feedback (invalid field, wrong PIN, duplicate name) → error state shake.

If two transitions could fit, prefer the lower-overhead one (card resize over panel reveal, dropdown over modal, success check over a full modal celebration) unless the design clearly calls for the heavier surface. The success check is animation-only — if you also need to swap from a spinner to the check, pair it with icon swap.

Universal install

Drop this :root block into your project once. Every transition snippet reads from these semantic names — there are no per-component values to chase down later.

/* transitions-dev — copy this :root block into your project once.
   Every transition snippet reads from these semantic names. */
:root {
  /* Card resize */
  --resize-dur: 300ms;
  --resize-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Number pop-in */
  --digit-dur: 500ms;
  --digit-distance: 8px;
  --digit-stagger: 70ms;
  --digit-blur: 2px;
  --digit-ease: cubic-bezier(0.34, 1.45, 0.64, 1);
  --digit-dir-x: 0;
  --digit-dir-y: 1;
  /* Notification badge */
  --badge-slide-dur: 260ms;
  --badge-pop-dur: 500ms;
  --badge-pop-close-dur: 180ms;
  --badge-fade-dur: 400ms;
  --badge-fade-close-dur: 180ms;
  --badge-blur: 2px;
  --badge-offset-x: -8.2px;
  --badge-offset-y: 12.4px;
  --badge-slide-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --badge-pop-ease: cubic-bezier(0.34, 1.36, 0.64, 1);
  --badge-close-ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* Text states swap */
  --text-swap-dur: 200ms;
  --text-swap-translate-y: 8px;
  --text-swap-blur: 2px;
  --text-swap-ease: ease-out;
  /* Menu dropdown */
  --dropdown-open-dur: 250ms;
  --dropdown-close-dur: 150ms;
  --dropdown-pre-scale: 0.97;
  --dropdown-closing-scale: 0.99;
  --dropdown-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Modal open / close */
  --modal-open-dur: 250ms;
  --modal-close-dur: 150ms;
  --modal-scale: 0.96;
  --modal-scale-close: 0.96;
  --modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Panel reveal */
  --panel-open-dur: 400ms;
  --panel-close-dur: 350ms;
  --panel-translate-y: 100px;
  --panel-blur: 2px;
  --panel-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Page side-by-side */
  --page-slide-dur: 200ms;
  --page-fade-dur: 200ms;
  --page-slide-distance: 8px;
  --page-blur: 3px;
  --page-stagger: 0ms;
  --page-exit-enabled: 1;
  --page-slide-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --page-fade-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Icon swap */
  --icon-swap-dur: 200ms;
  --icon-swap-blur: 2px;
  --icon-swap-start-scale: 0.25;
  --icon-swap-ease: ease-in-out;
  /* Success check */
  --check-opacity-dur: 550ms;
  --check-rotate-dur: 550ms;
  --check-rotate-from: 80deg;
  --check-bob-dur: 450ms;
  --check-y-amount: 40px;
  --check-blur-dur: 500ms;
  --check-blur-from: 10px;
  --check-path-dur: 550ms;
  --check-path-delay: 80ms;
  --check-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-bob: cubic-bezier(0.34, 1.35, 0.64, 1);
  --check-ease-path: cubic-bezier(0.22, 1, 0.36, 1);
  /* Avatar group hover */
  --avatar-lift: -4px;
  --avatar-dur: 320ms;
  --avatar-scale: 1.05;
  --avatar-falloff: 0.45;
  --avatar-ease-in: cubic-bezier(0.22, 1, 0.36, 1);
  --avatar-ease-out: cubic-bezier(0.34, 3.85, 0.64, 1);
  /* Error state shake */
  --shake-distance: 6px;
  --shake-overshoot: 4px;
  --shake-dur-a: 80ms;
  --shake-dur-b: 60ms;
  --shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --revert-hold: 3000ms;
  --revert-dur: 280ms;
}

The --pX-* source tokens used by the live demo at transitions.dev ↗ are intentionally not exported here. Tunable values are renamed to semantic names (--badge-*, --dropdown-*, --modal-*, …) so the user owns the design vocabulary.

Output format

When inserting a transition into the user's project:

1. Add the :root block above to the user's global stylesheet, but only if it isn't already there. If the user already imported the universal install block once, do not duplicate it.

2. Paste the chosen transition's CSS verbatim from the relevant reference file. Do not rewrite selectors, do not collapse the transition into shorthand, do not strip will-change. The snippets are tuned and tested.

3. Wire the documented HTML hooks — class names (.t-dropdown, .t-modal, .t-success-check, .t-avatar, .t-input, …) and state attributes (data-open, data-state, data-page, .is-open, .is-closing, .is-exit, .is-enter-start, .is-animating, .is-error, .is-shaking).

4. Preserve the @media (prefers-reduced-motion: reduce) block. Every snippet ships one. Removing it makes the component fail accessibility audits.

5. For transitions that need JS (dropdown, modal, text swap, number pop-in, page slide, success check, avatar group hover, error state shake), copy the small orchestration snippet from the reference file and adapt the selectors to the user's DOM. Keep the timing reads (getComputedStyle(...)getPropertyValue("--…")) so durations stay in sync with the :root values.

Keep the diff small: only edit the files needed to introduce the transition. Don't rename the user's existing variables, don't reformat unrelated CSS, don't pull in a motion library.

Common mistakes to avoid

  • Stripping the close-state class cleanup on dropdown/modal — without the setTimeout that removes .is-closing, the next open jumps from the closing scale instead of the resting pre-open scale.
  • Forgetting the reflow in the text swap, number pop-in, success check replay, and error state shake — void el.offsetWidth (or offsetHeight) between class/attribute removal and re-addition is what guarantees the animation replays.
  • Animating a single container instead of the inner pieces — for the badge, animate the dot, not the trigger; for page slide, animate the page sections, not the container.
  • Replacing transition: … with transition: all — every snippet enumerates exact properties on purpose so unrelated style changes don't ride in for free.
  • Hardcoding the success check's stroke-dasharray — the snippet ships 20 as a placeholder. Replace it with path.getTotalLength() rounded up by 1 for *your* path, otherwise the stroke pre-reveals or over-draws.
  • Setting transition-timing-function in CSS for the avatar group hover — it has to be set inline in JS *before* the --shift / --scale-active writes so the bouncy ease-out only applies on mouseleave.
  • Mixing .is-error and .is-shaking into one class for the error state shake — keeping them orthogonal is what allows the shake to replay (remove → reflow → re-add) without flickering the whole error treatment.

Reference files

常見問題

transitions-dev 技能有什麼用途?

為網頁應用程式提供的CSS過渡效果的預製模板,包含了卡片、模態視窗、下拉式選單、面板和頁面過渡等的程式碼片段。

如何安裝 transitions-dev?

打開本頁的「安裝」區塊並選擇你的代理 — Claude Code、Codex、Cursor 或 Gemini CLI:那裡有把技能資料夾複製到正確位置的現成指令。也可以複製「透過助理」分頁中的提示,讓助理自行檢查並安裝技能。

transitions-dev 適用哪些 AI 模型?

技能是純 Markdown 指示(Agent Skills 格式),因此 transitions-dev 適用任何讀取 SKILL.md 的代理:Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等。只有在任務符合技能描述時,模型才會載入指示。

transitions-dev 是免費的嗎?

此技能由 Jakubantalik 公開發布,採用 MIT 授權。技能本身免費 — 你只需向 AI 供應商支付實際使用的 token 費用。

安裝技能安全嗎?

技能是代理會遵循的指示,安裝前請閱讀 SKILL.md 及相關檔案。技能資料夾中的腳本只有在代理執行時才會運行 — 留意它的動作,不要授予多餘權限。

技能和 MCP 伺服器或外掛有何不同?

MCP 伺服器或外掛為模型提供新工具 — 會執行並回傳結果的程式碼。技能提供的是知識與流程:如何處理任務、要遵循哪些步驟、好的成果長什麼樣子。它不需要伺服器或 API 金鑰。

相關技能

所有技能 →
review-animations 檢查動畫的品質、時間和運動的連貫性,從批判性的生產角度來看。 emilkowalski49.9k improve-animations 作為高階動作顧問,審查動畫程式碼庫和動作程式碼,然後建立優先順序的審計和自成體系的實施計劃。僅供閱讀原始程式碼 - 它計劃改進,但不會實施它們。使用時,當使用者請求改進動畫,進行動作審計,讓應用程式更好或想要動畫修復的路線圖,而不是審查單個差異。 emilkowalski49.9k find-animation-opportunities 尋找令人信服的動態介面機會,同時拒絕增加雜亂或減慢使用者速度的動畫。 emilkowalski49.9k animate 從頭開始建立動畫,按照正確的順序做出決定 — 它是否應該被動畫化,目的是什麼,使用什麼工具,哪些屬性,哪種曲線和持續時間,它如何中斷,它如何退出。 寫下實現。 當被要求動畫化某些東西,新增動作,使元件活起來或構建過渡時使用。 對於現有動作的批評,使用review-animations;對於整個程式碼的審核,使用improve-animations。 emilkowalski49.9k animation-vocabulary 精簡動畫語言,以使選擇動畫看起來故意且一致。 emilkowalski49.9k apple-design Apple 對於介面設計和順暢的物理動畫的方法,為網頁設計師提供了一種新的思路,讓他們在建構或測試手勢介面、彈簧動畫、拖拽、滑動、捲動等互動動作、動量和可中斷的轉場、半透明材質和深度、字型(光學尺寸、追蹤、間距)以及減少動作或基本設計原則(回應、空間順序、剋制)等方面,打造出類似 Apple 風格的介面。 emilkowalski49.9k