Skip to content
Back to skills

Charles Liquid Glass

ASecurity

Puts a draggable liquid-glass tile on a web page's hero that bends the real photo and headline under it, in four looks (prism warp, deep dome, clear crystal, frost veil), and picks the right one. Use when someone asks for liquid glass, Apple or iOS-style glass, a glass lens, refraction or glassmorphism on a landing page or hero. Not for native SwiftUI glass.

  • 375 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 2, 2026
developmenttypescriptgoswiftreactvuenextjsnodeaws

Works with

  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 14 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add LemonFace0309/charles-skills --skill charles-liquid-glass --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Charles Liquid Glass?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Charles Liquid Glass
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lemonface0309-charles-liquid-glass/badge)](https://www.skillsdirectory.com/skills/lemonface0309-charles-liquid-glass)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: charles-liquid-glass
description: "Puts a draggable liquid-glass tile on a web page's hero that bends the real photo and headline under it, in four looks (prism warp, deep dome, clear crystal, frost veil), and picks the right one. Use when someone asks for liquid glass, Apple or iOS-style glass, a glass lens, refraction or glassmorphism on a landing page or hero. Not for native SwiftUI glass."
compatibility: "The bending looks need WebGL 2 in the visitor's browser (others get a frosted CSS tile). scripts/shot.mjs needs Node 18+, Google Chrome and playwright-core (npm install --prefix scripts)."
---

# Goal

A glass tile on the user's own hero that bends their photo and headline exactly the way one of four looks does,
moves like real glass under a finger (press, lift, tilt, landing squash), reads at phone size, and falls back to a
frosted tile wherever it can't show the page truthfully. The engine is `kit/liquid-glass.js`. Its numbers were
measured frame by frame from the reference clips: never re-tune a look by eye, or it stops being that look.

# The four looks

Lengths are shares of the tile's side.

| Look | What it does to the page under it | Pick it when |
| --- | --- | --- |
| `prism` (prism warp) | The middle third is true. The outer third on each side bends toward the centre, red most and blue least, so edges fan into a rainbow at the rim | The glass is the showpiece over big type with hard light/dark edges |
| `dome` (deep dome) | Clear crystal's bent rim plus a heavy blur (9.6 %). It does not magnify: letters only look bigger because they are that blurred | A thick, soft object over a photo, nothing under it needs reading, and the headline's upright strokes are at least 11 % of the tile |
| `crystal` (clear crystal) | The middle 62 % is exactly true. The outer 19 % squeezes the page, and its outermost 8 % shows the band just inside it again, mirrored, so letters bend hard at the rim | People must read what is under the glass |
| `frost` (frost veil) | An even blur (4.1 %) and no bend at all | Text or buttons sit on the glass, or the glass goes over live UI |

```
What is the glass for?
├── Text or controls sit ON it ─────────────────────────────────→ frost
├── Something must stay readable THROUGH it ────────────────────→ crystal
├── Decoration over big type
│   ├── the type sits on flat or dark ground ───────────────────→ prism
│   ├── the type's upright strokes are at least 11 % of the tile
│   │   (a black weight, set very large) ───────────────────────→ dome
│   └── anything else ─────────────────────────────────────────→ frost
└── The user can't say → frost (the most useful), or prism if the page exists to impress
```

Why: the looks differ in what survives. Frost keeps what is on it legible by removing the detail behind it; crystal
keeps what is under it legible by bending only the rim; prism and dome trade legibility for spectacle. The dome's
blur is 9.6 % of the tile, and strokes much narrower than that melt into it: the reel's dome headline (Bodoni Moda
800, set very large) is 12 % and reads as soft shapes; Inter 700 at the default tile size is 8 % and turns into a flat
block. Most headlines come out 7 to 11 %. `shot.mjs` measures it and fails a dome under 11 %.

To show the user all four first, serve the skill's `kit/` folder over http and open `demo/prism.html`, `dome.html`,
`crystal.html` and `frost.html`.

# Steps

## 1. Choose the route

```
What does the glass move over?
├── A hero: a photo or gradient, scrims, headline text ──→ the WebGL route, steps 2 to 4 (all four looks)
├── Live UI: forms, buttons people press, scrolling lists,
│   video, maps, iframes ─────────────────────────────────→ frost veil in CSS, step 5. Never promise prism,
│                                                            dome or crystal over live UI
└── Both on one page ─────────────────────────────────────→ WebGL on the hero, CSS frost on the live UI
```

Why: a browser never hands a script the page's pixels, so WebGL can only bend what the kit redraws into its canvas.
CSS `backdrop-filter` blurs live content, which is frost veil. Bending live content in CSS needs an SVG filter that
this skill doesn't ship, because it wasn't tested across browsers.

## 2. Copy the engine and mark the hero

1. Plain HTML: copy `kit/liquid-glass.js` next to the page, put `data-glass="<look>"` on the hero element and load the
   script at the end of `<body>`. It attaches itself. Options go in attributes: `data-glass-mode`, `data-glass-size`,
   `data-glass-at="x,y"`.
2. React, Next.js, Vue or Svelte: copy `kit/liquid-glass.js` and `kit/liquid-glass.d.ts` next to the component that
   uses them (not `public/`: the component imports the file). No `data-glass` attribute, or it attaches twice.
   Attach on mount and destroy on unmount. In Next.js (App Router) the file holding this component starts with
   `'use client'`. Tested under React 19.3's StrictMode in a development build, unmounted before the engine loaded,
   and with `tsc --strict` (TypeScript 5.9 and 7.0):

   ```tsx
   import { useEffect, useRef } from 'react';
   import type { Glass } from './liquid-glass.js';

   export function GlassHero() {
     const ref = useRef<HTMLElement>(null);
     useEffect(() => {
       let glass: Glass | undefined;
       let gone = false;
       import('./liquid-glass.js')      // sets window.LiquidGlass
         .then(() => (gone || !ref.current ? undefined : window.LiquidGlass.attach(ref.current, { look: 'crystal' })))
         .then((g) => { if (g && gone) g.destroy(); else glass = g; })
         .catch((err) => console.error(err));
       return () => { gone = true; glass?.destroy(); };
     }, []);
     return <section ref={ref}>{/* the photo and headline, marked */}</section>;
   }
   ```

3. Put `data-glass-layer` on the photo (an `<img>`, or the element that carries the CSS background), on every scrim
   or overlay over it, and on each text block the glass should bend. The page's and the hero's own backgrounds are
   always drawn.
4. Leave nav, buttons and inputs unmarked. They stay above the glass and keep their clicks; the tile slides under
   them. Marked text can't be selected (links inside it still work).
5. When marked text, images or styles change later (a rotating word, a carousel, a dark-mode switch), call
   `glass.refresh()` after each change, or leave that element unmarked. Why: the marked element is invisible, so
   without a refresh the page keeps showing the old one. A resize or a font load redraws by itself.

The engine sets `isolation: isolate` on the hero (and `position: relative` if it was static) and puts its canvas
behind the hero's content at `z-index: -1`. In the frosted fallback the tile floats over everything in the hero,
unmarked content included, and clicks pass through it.

The redraw covers backgrounds (colours, `url()` pictures, linear and radial gradients, sized, positioned and
repeated, on the page, the hero and marked elements), `<img>`, text with its shadows and strokes, gradient-clipped
text, one uniform solid border, outer box shadows, opacity, blend modes and filters. Safari's canvas has no filters,
so there the glass redoes brightness, contrast, saturate, grayscale, sepia, invert, opacity and hue-rotate by hand,
and `blur()` or `drop-shadow()` make Safari fall back. Anything else in a marked element makes the page keep its own
DOM and show the frosted tile, with the reason in the console. Fix it from this table:

| The page has | Do |
| --- | --- |
| A `blur()` or `drop-shadow()` filter on a marked element | Bake it into the picture, or use a marked overlay (a `div` with a semi-transparent background): Safari can't redo either |
| A cross-origin photo | Host it on the same origin, or add `crossorigin="anonymous"` and serve it with `Access-Control-Allow-Origin` |
| Something behind the hero that isn't the hero's or an ancestor's background (a fixed layer, a canvas, a video) | Move it into the hero as a marked element; the glass can't see it |
| A `::before` or `::after` overlay on the hero | Make it a real element and mark it. Left as is, it paints over the glass |
| An underline, SVG icon, pseudo-element, mask, rotation, inset shadow or uneven border inside a marked element | Move that part out of the marked element; unmarked, it sits above the glass |
| `font-feature-settings` or `font-variation-settings` on the headline | Set them to `normal` on the marked text |
| A headline font with a width axis (`font-stretch` other than 100 %) | Load only the width the headline uses. Safari's canvas can't pick a width and stretches the normal one |
| A video or animated background under the glass | Keep the glass off it: the redraw is a still |
| The page opened from `file://` | Serve it over http; Chrome treats the photo as cross-origin |

## 3. Size and place it

- Leave the tile's size at its default: the smaller of 28.17 % of the hero's shorter side and 2.6 times the cap height
  of the headline (the marked text in the largest type), clamped to 96 to 360 px. Why: each look shows only through
  what it bends at the rim, 19 % (crystal, dome) or 32 % (prism) of the side deep, so the letters must fill at least
  38 % of the tile. With 48 to 84 px headlines the tile comes out 96 to 150 px; for a bigger glass, enlarge the
  headline, never the tile alone.
- The tile rests on the upper right of the headline, half over the type. Move it with `at` (`data-glass-at="x,y"`,
  fractions of the hero) only to keep it off a face or a product, or onto ground its look needs:
  - `crystal`: dark ground behind light type (or light behind dark) wherever the tile travels. On flat pale paper it
    shows only by its thin rim and disappears at phone size.
  - `dome`: letters in strong contrast with the ground behind them (light on dark or dark on light), besides the 11 %
    strokes: the reel's dome set cream Bodoni Moda 800 on dark water.
  - `frost`: a busy photo behind it. Never frost over frost, fog or noise: there is nothing to stand out against.
  - `prism`: hard light/dark edges under the rim. A soft photo gives muddy fringes.

## 4. Choose how it moves

| `mode` | Use it for |
| --- | --- |
| `drag` (default) | Landing pages: press the tile and drag it |
| `follow` | A lens that follows the mouse on desktop and glides home when it leaves; touch still drags |
| `demo` | A showcase: one lap round the headline every 4.6 s until someone grabs it. Shows the touch dot. Stays still under reduced motion |

Never change the motion numbers (press to 0.945, lift to 1.044, landing squash to 0.965, tilt 0.142° per unit of
sideways speed, at most 3.25°). They are measured; the feel is the point.

## 5. Frost veil over live UI (CSS)

Copy `kit/frost.css`, add `class="liquid-frost"` to the element (a card, a bar), set `--side` to its shorter side in
px, and remove the element's own background, border, border-radius and box-shadow (or load `frost.css` after the
page's CSS). Why: the element's own values win over the class's, and any one of them covers the veil. It frosts
whatever is painted behind it, and its content stays live. `shot.mjs` checks a page with only CSS frost too: it writes
`<size>-frost.png` and must print `nothing covers it`. Tested in Chrome. Playwright's Firefox and WebKit builds don't
paint `backdrop-filter` in screenshots on any page, so say that the blur is unchecked in Safari and Firefox unless the
user looks.

## 6. Check it before handing it over

1. `npm install --prefix <skill>/scripts` once, then `node <skill>/scripts/shot.mjs <page.html or url> <out-folder>`.
   For a file, run it from a folder that holds the page and everything it loads (or pass `--root`).
2. It must print, for desktop and phone, `WebGL glass` and `redraw matches the page`, and for desktop
   `drag: lifts, follows and lands` and `Safari: same redraw`. Each failure names its fix:
   - `FELL BACK` or `SAFARI WILL FALL BACK`: the reason it prints, fixed from step 2's table.
   - `REDRAW DIFFERS`: visitors would see a different page under the glass; the red in `<size>-redraw-diff.png` shows
     where.
   - `DOME TOO THIN`: use frost or prism (the look tree).
   Run it again until every line is clean.
3. Open all four frames at full size and check each one:
   - Inside the tile, letters bend at the rim (prism, dome, crystal) or blur evenly (frost). Under a dome they must
     still show as soft shapes; a flat gradient block means the letters are too close in tone to the ground (step 3).
   - In `phone-rest.png` (390 px wide) the tile's rim stands out from the page. If it doesn't, change the ground under
     it (step 3), never the look's numbers.

# Deliver

- The files changed, and where `liquid-glass.js` (and `liquid-glass.d.ts`, `frost.css`) went.
- The look, with its one-line reason from the table.
- The frames from `shot.mjs` (four for the glass, two for CSS frost) and the lines it printed.
- Which browsers it was checked in: Chrome by `shot.mjs`; its Safari line is a dry run of Safari's canvas, not
  Safari. Name another browser only if it was really opened.

Files in this skill

  • README.md4.3 KB
  • SKILL.md13.3 KB
  • evals/README.md908 B
  • evals/no-trigger-swiftui/graders/not-fired.md114 B
  • evals/no-trigger-swiftui/prompt.md156 B
  • evals/outcome-signup-card/case.yaml84 B
  • evals/outcome-signup-card/fixtures/index.html1.4 KB
  • evals/outcome-signup-card/graders/answer.md46 B
  • evals/outcome-signup-card/graders/judgment.md1.4 KB
  • evals/outcome-signup-card/prompt.md309 B
  • evals/trigger-hero-lens/graders/fired.md100 B
  • evals/trigger-hero-lens/prompt.md241 B
  • evals/trigger-rainbow-edge/graders/fired.md100 B
  • evals/trigger-rainbow-edge/prompt.md203 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.