glassmorphism
iart-ai/web-animation-skills · Agent Skill
此技能應當在使用者要求「新增玻璃化效果」、「霜化玻璃介面」、「Apple 的液態玻璃風格」、「霜化模糊地圖」、「動畫透明玻璃面板」、「製作霜化導航欄」、「建立玻璃模態/對話方塊視窗」、「動畫化玻璃地圖於滑鼠懸停」或「新增折射液態玻璃英雄」時使用。涵蓋霜化透明面板的 backdrop-filter 模糊、邊緣/反光點、SVG 液態玻璃折射、滑鼠懸停/滾動/進入的動畫和無障礙的降低透明度後備方案。
前往安裝 ↓總覽
| 發布者 | |
|---|---|
| 儲存庫 | iart-ai/web-animation-skills ↗ |
| 技能資料夾 | glassmorphism |
| 星 | 58 |
| 分支 | 9 |
| 附帶檔案 | 3 |
| 授權 | MIT |
| 最近更新 | 2026年6月22日 |
| 連結 | 技能原始碼 ↗ · 儲存庫 ↗ |
Mozgi 檢查
我們在技能檔案中發現的內容。詳細資訊需訂閱。
安裝
技能就是一個含 SKILL.md 的資料夾。選擇你的代理,在專案根目錄的終端機(macOS、Linux 或 Windows 的 Git Bash)執行指令。
把提示貼到 Claude、Codex 或其他助理:它會自行檢查並安裝技能。
Install the “glassmorphism” skill from mozgi.io (https://mozgi.io/skills/iart-ai-glassmorphism/) for me. 1. Download the archive: https://mozgi.io/skills/iart-ai-glassmorphism/download If it fails, take the skill folder from the source: https://github.com/iart-ai/web-animation-skills/tree/main/skills/glassmorphism 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 “glassmorphism” 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>/glassmorphism/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.
git clone --depth 1 --branch main https://github.com/iart-ai/web-animation-skills.git /tmp/web-animation-skills mkdir -p .claude/skills cp -r /tmp/web-animation-skills/skills/glassmorphism .claude/skills/glassmorphism
重新啟動 Claude Code — 技能就會出現在清單中,手動呼叫:/glassmorphism。要套用到所有專案,請放在 ~/.claude/skills。
git clone --depth 1 --branch main https://github.com/iart-ai/web-animation-skills.git /tmp/web-animation-skills mkdir -p .agents/skills cp -r /tmp/web-animation-skills/skills/glassmorphism .agents/skills/glassmorphism
Codex 會從目前資料夾往上到儲存庫根目錄,在 .agents/skills 中尋找技能;用 /skills 或 $glassmorphism 呼叫。所有專案:~/.agents/skills。
git clone --depth 1 --branch main https://github.com/iart-ai/web-animation-skills.git /tmp/web-animation-skills mkdir -p .cursor/skills cp -r /tmp/web-animation-skills/skills/glassmorphism .cursor/skills/glassmorphism
Cursor 啟動時會載入技能;在 Agent 聊天輸入「/」呼叫。Cursor 也會讀取 .claude/skills 與 .agents/skills。所有專案:~/.cursor/skills。
git clone --depth 1 --branch main https://github.com/iart-ai/web-animation-skills.git /tmp/web-animation-skills mkdir -p .gemini/skills cp -r /tmp/web-animation-skills/skills/glassmorphism .gemini/skills/glassmorphism
任務符合時,Gemini CLI 會提議啟用技能,由你確認。所有專案:~/.gemini/skills。
安裝前請先檢視 SKILL.md 與相關檔案。點擊檔案即可預覽。
SKILL.md 內容
作者原文 · 唯讀Glassmorphism (Frosted & Liquid Glass)
Translucent, frosted UI: panels you can see through, blurred so the backdrop reads as soft color, rimmed by a bright edge of light, floating on layered shadow. The 2026 "liquid glass" evolution adds refraction — the background visibly bends through the panel — plus moving specular highlights. The goal is depth and material, not just opacity.
When to use
- Frosted cards, nav bars, sidebars, modals/dialogs, and toolbars over busy/photo backgrounds
- Login/hero panels and overlays that should feel layered above the page
- Apple-style "liquid glass" heroes: refracting, slowly churning surfaces with a specular sweep
- Hover/scroll/enter motion on glass — frost deepening, highlight brightening, the panel lifting
- Any place where content needs to read as floating glass while staying legible
The four ingredients of believable glass
Glass is never one property. Every panel needs all four, or it reads as a plain translucent box:
1. Frost — backdrop-filter: blur() plus saturate() to keep backdrop color vivid through the blur.
2. Translucency — a background with alpha (~0.08–0.18), never fully opaque, never fully clear.
3. Edge of glass — a hairline border *brighter* than the fill, ideally a lit top-left → dim bottom-right highlight, so the rim catches light.
4. Depth — layered box-shadow: an ambient drop shadow to float it, plus an inset top highlight and bottom shade to round the surface.
.glass {
background: rgba(255, 255, 255, 0.12);
backdrop-filter: blur(16px) saturate(160%);
-webkit-backdrop-filter: blur(16px) saturate(160%); /* Safari needs the prefix */
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.25);
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.25), /* float */
inset 0 1px 0 rgba(255, 255, 255, 0.35), /* top highlight */
inset 0 -1px 0 rgba(0, 0, 0, 0.12); /* bottom shade */
}
Frost tiers: light UI chrome blur(8–12px) / alpha 0.08–0.14; heavy modal/login blur(24–40px) / alpha 0.10–0.18. Dark glass: fill rgba(0,0,0,0.3), softer top highlight.
backdrop-filter only blurs content that sits behind the element. Over a flat background color it does nothing visible — glass needs a busy backdrop (image, gradient, video) to frost.
Specular edge highlight and anti-banding grain
A flat border is dead. Draw a masked 1px ring with a lit corner via ::before, and dither away gradient banding (stepped contour lines under heavy blur) with a faint feTurbulence noise overlay via ::after at opacity ≤ 0.06. Full masked-border and inline-noise recipes are in references/glass-recipes.md.
Motion: animate the glass, not the geometry
Animate the *qualities* of the glass — frost deepening, highlight brightening, the panel lifting — so it reads as the surface "leaning into the light."
.glass {
transition: backdrop-filter .4s ease, background .4s ease,
box-shadow .4s ease, transform .4s cubic-bezier(.16,1,.3,1);
}
.glass:hover {
backdrop-filter: blur(24px) saturate(180%);
background: rgba(255,255,255,.18);
transform: translateY(-4px);
box-shadow: 0 16px 48px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.5);
}
- Entrance (frost resolving from clear): pair a
[data-enter]transition with@starting-style { backdrop-filter: blur(0); opacity: 0; transform: translateY(16px) }. - Specular sweep: a skewed white gradient animated across the surface on hover or as a slow ambient loop.
- Caveat: animating the blur *radius* is the most expensive thing here — the backdrop is re-blurred every frame. If hover janks, animate
transform/box-shadow/background(cheap) and keep the blur delta small or snap it.
Liquid glass — SVG refraction (the 2026 look)
Bend the background through the panel like a thick lens: drive feDisplacementMap from animated feTurbulence, applied via filter (it distorts the element's own pixels) layered over a backdrop-filter frost.
<svg width="0" height="0" style="position:absolute"><filter id="liquid-glass">
<feTurbulence type="fractalNoise" baseFrequency="0.008 0.012" numOctaves="2" seed="3" result="n">
<animate attributeName="baseFrequency" dur="18s"
values="0.008 0.012;0.012 0.008;0.008 0.012" repeatCount="indefinite"/>
</feTurbulence>
<feDisplacementMap in="SourceGraphic" in2="n" scale="22" xChannelSelector="R" yChannelSelector="G"/>
</filter></svg>
scale = refraction strength (8–14 subtle, 20–30 pronounced, >40 molten). Lower baseFrequency = larger, slower waves (more liquid). Keep the animate dur long (12–20s) so it breathes. These filters are heavy — use on one hero element, not a grid.
Performance — backdrop-filter is expensive
- Each glass element re-samples and blurs everything behind it. Limit the count; a dozen on screen tanks scroll FPS.
- Promote heavy glass to its own layer (
transform: translateZ(0)orwill-change: transform), and removewill-changeafter the animation. - Don't stack
backdrop-filterelements over each other — nested blur re-blurs the blur (quadratic cost). - Big radii (>40px) over large areas are the worst case; cap radius and panel size.
Accessibility — non-negotiable
Glass is decoration; content must stay legible and the effect must be defeatable.
@media (prefers-reduced-transparency: reduce) {
.glass { background: #1a1a2e; backdrop-filter: none; -webkit-backdrop-filter: none; }
.glass::after { display: none; } /* drop grain */
}
@media (prefers-reduced-motion: reduce) {
.glass { transition: none; }
.liquid { filter: none; } /* stop the refraction churn */
}
@supports not (backdrop-filter: blur(1px)) {
.glass { background: rgba(30,30,50,.85); } /* opaque-enough fallback */
}
Contrast over busy backgrounds: translucent panels over photos can drop text below WCAG. Add a semi-opaque scrim or darkening gradient *under* the text, optionally text-shadow: 0 1px 2px rgba(0,0,0,.4), and verify ≥ 4.5:1 body / ≥ 3:1 large against the *brightest* region of the backdrop.
Deliver & verify (standalone HTML)
> Packaged helper (scripts/): scripts/seek-shot.sh anim.html 0 1.5 3 freezes the ?t=N harness and screenshots each moment; scripts/contact-sheet.sh sheet.png frame-*.png tiles them for one-glance review. See scripts/README.md.
For a self-contained glass demo (card, nav, modal, liquid-glass hero) the deliverable is one HTML file that opens directly in a browser — markup, CSS, and (if liquid) one inline SVG filter, no build step. A single file is the right tier for a glass surface; don't reach for a bundler. The panel must overlap a real backdrop (drop in a photo or gradient) or there is nothing to frost and the demo lies.
Output contract:
- One
.htmlfile: a busy backdrop, your glass markup, the CSS (frost + edge highlight + grain + shadows), and any inline SVGfeDisplacementMapfilter. - A way to land on the resolved state *and* a frozen frame of any loop — glass verifies by both state (rest/hover/enter) and time (the sweep/refraction).
- Include the freeze harness below so any moment can be pinned for inspection.
Seek harness — pin a deterministic state + frame. ?state=hover forces the hover look; ?t=N freezes CSS animations and the SVG refraction at N seconds, so a screenshot lands on a still, deterministic frame:
<script>
const p = new URLSearchParams(location.search);
const state = p.get("state");
if (state) document.documentElement.dataset.state = state; // CSS keys off :root[data-state="hover"]
const t = p.get("t");
if (t !== null) {
document.getAnimations().forEach(a => { a.currentTime = parseFloat(t)*1000; a.pause(); }); // freeze CSS sweep
const svg = document.querySelector("svg");
svg?.pauseAnimations?.(); svg?.setCurrentTime?.(parseFloat(t)); // freeze refraction
}
window.__ready = true;
</script>
Verify loop — render → set state/freeze → screenshot → check: open each meaningful state (?state=rest, ?state=hover) and a frozen loop frame (?t=2), screenshot, and confirm the glass reads as glass — blur and edge highlight visibly present, no color banding, text contrast holds over the backdrop — plus check artifacts (flat box because the backdrop is plain color, missing -webkit- prefix in Safari, refraction too strong/molten, jank from animating blur). Then load prefers-reduced-transparency and confirm the solid fallback renders legibly. Any headless tool works:
npx playwright screenshot --wait-for-timeout=500 "file://$PWD/glass.html?state=hover" hover.png
npx playwright screenshot --wait-for-timeout=500 "file://$PWD/glass.html?t=2" loop.png
To check the fallback headlessly, emulate the media feature (e.g. Playwright --color-scheme-style flags, or a ?reduced=1 query that toggles a class mirroring the media query) and screenshot that the panel is solid and readable.
Before you finish:
1. Opens standalone — no console errors; the glass overlaps a real busy backdrop, not a flat color.
2. Reads as glass — blur + bright edge highlight both visible, layered shadow floats it, no banding (grain present).
3. Text contrast holds over the brightest part of the backdrop (≥ 4.5:1 body).
4. ?state= / ?t=N freeze lands a deterministic, settled frame.
5. prefers-reduced-transparency → solid opaque panel; prefers-reduced-motion → refraction/sweep stopped; @supports fallback for no backdrop-filter.
6. Performance sane — glass count limited, blur not animated on a janky path, liquid refraction on one element only.
Quick reference
| Need | Approach |
|------|----------|
| Base frost | backdrop-filter: blur(16px) saturate(160%) + alpha bg |
| Edge of glass | brighter border + masked ::before lit-corner ring |
| Float / depth | box-shadow drop + inset top highlight & bottom shade |
| Kill banding | feTurbulence noise ::after, opacity ≤ .06 |
| Hover motion | transition transform/box-shadow/background, small blur delta |
| Entrance | @starting-style { backdrop-filter: blur(0); opacity:0 } |
| Liquid refraction | feDisplacementMap ← animated feTurbulence, via filter |
| Specular sweep | skewed white gradient animated across surface |
| Safari | always pair -webkit-backdrop-filter |
| Reduced transparency | solid opaque panel, drop grain |
| No backdrop-filter | @supports not (...) opaque-enough fallback |
Reference files
references/glass-recipes.md— full copy-paste recipes: base glass card with tiers, the masked specular edge ring, anti-banding grain, hover/enter/scroll motion, the specular sweep, the SVGfeDisplacementMap/feTurbulenceliquid-glass filter with tuning knobs, performance rules, the reduced-transparency/reduced-motion/@supportsfallbacks, contrast defenses, and the standalone freeze harness.
常見問題
glassmorphism 技能有什麼用途?
此技能應當在使用者要求「新增玻璃化效果」、「霜化玻璃介面」、「Apple 的液態玻璃風格」、「霜化模糊地圖」、「動畫透明玻璃面板」、「製作霜化導航欄」、「建立玻璃模態/對話方塊視窗」、「動畫化玻璃地圖於滑鼠懸停」或「新增折射液態玻璃英雄」時使用。涵蓋霜化透明面板的 backdrop-filter 模糊、邊緣/反光點、SVG 液態玻璃折射、滑鼠懸停/滾動/進入的動畫和無障礙的降低透明度後備方案。
如何安裝 glassmorphism?
打開本頁的「安裝」區塊並選擇你的代理 — Claude Code、Codex、Cursor 或 Gemini CLI:那裡有把技能資料夾複製到正確位置的現成指令。也可以複製「透過助理」分頁中的提示,讓助理自行檢查並安裝技能。
glassmorphism 適用哪些 AI 模型?
技能是純 Markdown 指示(Agent Skills 格式),因此 glassmorphism 適用任何讀取 SKILL.md 的代理:Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等。只有在任務符合技能描述時,模型才會載入指示。
glassmorphism 是免費的嗎?
此技能由 iart-ai 公開發布,採用 MIT 授權。技能本身免費 — 你只需向 AI 供應商支付實際使用的 token 費用。
安裝技能安全嗎?
技能是代理會遵循的指示,安裝前請閱讀 SKILL.md 及相關檔案。技能資料夾中的腳本只有在代理執行時才會運行 — 留意它的動作,不要授予多餘權限。
技能和 MCP 伺服器或外掛有何不同?
MCP 伺服器或外掛為模型提供新工具 — 會執行並回傳結果的程式碼。技能提供的是知識與流程:如何處理任務、要遵循哪些步驟、好的成果長什麼樣子。它不需要伺服器或 API 金鑰。