一键导入
animations
Create performant web animations with proper accessibility and timing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create performant web animations with proper accessibility and timing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Operates Breeze x402 payment-gated endpoints for balance checks, deposits, and withdrawals on Solana. Use when the user asks to manage Breeze positions or execute paid x402 API calls.
Crossmint provides custodial wallet-as-a-service, NFT minting, virtual debit cards, crypto-to-fiat payouts, and **transaction signing** on Solana. Perfect for AI agents managing DeFi operations without needing a local keypair.
Complete DFlow trading protocol SDK - the single source of truth for integrating DFlow on Solana. Covers spot trading, prediction markets, Swap API, Metadata API, WebSocket streaming, and all DFlow tools.
Complete Drift Protocol SDK for building perpetual futures, spot trading, and DeFi applications on Solana. Use when building trading bots, integrating Drift markets, managing positions, or working with vaults.
Solana vault management via GLAM Protocol. Triggers: glam, glam-cli, glam-sdk, vault create/manage, tokenized vault, share class, DeFi vault, treasury, asset management, access control, delegate permissions, Jupiter swap, Drift perpetuals/spot/vaults, Kamino lending/borrow/vaults/farms, staking (Marinade/native/SPL/Sanctum/LST), cross-chain USDC (CCTP), timelock, subscription/redemption, NAV pricing, token transfer. Supports CLI and TypeScript SDK.
Comprehensive guide for Helius - Solana's leading RPC and API infrastructure provider. Covers RPC nodes, DAS (Digital Asset Standard) API, Enhanced Transactions, Priority Fees, Webhooks, ZK Compression, LaserStream gRPC, and the Helius SDK for building high-performance Solana applications
| name | Animations |
| description | Create performant web animations with proper accessibility and timing. |
| metadata | {"clawdbot":{"emoji":"✨","requires":{},"os":["linux","darwin","win32"]}} |
Only these properties animate on the compositor thread (60fps):
| Property | Use |
|---|---|
transform | Move, rotate, scale (translateX, rotate, scale) |
opacity | Fade in/out |
Everything else triggers layout or paint. Avoid animating:
width, height, margin, padding (layout thrashing)top, left, right, bottom (use transform instead)border-width, font-size (expensive reflows)/* ❌ Triggers layout every frame */
.slide { left: 100px; transition: left 0.3s; }
/* ✅ GPU accelerated */
.slide { transform: translateX(100px); transition: transform 0.3s; }
~5% of users experience vestibular disorders (dizziness, nausea from motion).
/* Only animate if user hasn't requested reduced motion */
@media (prefers-reduced-motion: no-preference) {
.animated { animation: slide-in 0.5s ease-out; }
}
/* Or disable for those who requested it */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
Keep subtle fades and color changes even with reduced motion. Remove parallax, bouncing, infinite loops.
| Easing | Use case |
|---|---|
ease-out | Elements entering view (appears responsive) |
ease-in | Elements exiting view (accelerates away) |
ease-in-out | Elements moving within view |
linear | Only for spinners, progress bars, color cycling |
/* Custom bounce */
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
/* Material Design standard */
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
| Type | Duration |
|---|---|
| Micro-interactions (hover, focus) | 100-200ms |
| Transitions (modals, dropdowns) | 200-300ms |
| Page transitions | 300-500ms |
| Complex choreography | 500-1000ms max |
Anything over 500ms feels sluggish. Shorter is usually better.
Transitions: A to B state changes
.button { transform: scale(1); transition: transform 0.2s ease-out; }
.button:hover { transform: scale(1.05); }
Animations: Multi-step, auto-play, looping
@keyframes fadeSlideIn {
0% { opacity: 0; transform: translateY(20px); }
100% { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeSlideIn 0.5s ease-out forwards; }
Use transitions for hover/focus states. Use animations for on-load effects and sequences.
Only use as optimization when you have specific performance problems:
/* ✅ Apply before animation starts, remove after */
.card:hover { will-change: transform; }
.card { will-change: auto; }
/* ❌ Never apply globally */
* { will-change: transform, opacity; } /* Wastes GPU memory */
/* ❌ Animates everything including unintended properties */
.card { transition: all 0.3s; }
/* ✅ Only animates what you need */
.card { transition: transform 0.3s, box-shadow 0.3s; }
all can cause unexpected animations on color, background, border changes.
Exit animations require AnimatePresence:
/* ❌ Exit animation never plays */
{isVisible && <motion.div exit={{ opacity: 0 }} />}
/* ✅ Wrap conditional rendering */
<AnimatePresence>
{isVisible && <motion.div exit={{ opacity: 0 }} />}
</AnimatePresence>
Stable keys for list animations:
/* ❌ Index keys cause erratic animations */
{items.map((item, i) => <li key={i}>{item}</li>)}
/* ✅ Stable IDs */
{items.map(item => <li key={item.id}>{item.text}</li>)}
AutoAnimate parent must be unconditional:
/* ❌ Ref can't attach to conditional element */
{showList && <ul ref={parent}>...</ul>}
/* ✅ Parent always renders, children are conditional */
<ul ref={parent}>{showList && items.map(...)}</ul>
| Library | Size | Best for |
|---|---|---|
| CSS only | 0kb | Hover states, simple transitions |
| AutoAnimate | 3kb | Lists, accordions, toasts (90% of UI animations) |
| Motion | 22kb | Gestures, physics, scroll animations, complex choreography |
| GSAP | 60kb | Timelines, creative animation, scroll-triggered sequences |
Start with CSS. Add AutoAnimate for list animations. Only add Motion/GSAP for complex needs.
width/height instead of scale—causes layout thrashingtransition: all catching unintended properties