# Fogged Glass

> WebGL window fogged with condensation over out-of-focus lights: a garden by day, a rainy city at night. Beads speckle the glass, each a tiny lens showing the world flipped and sharp; drops run down in fits and starts and leave clear trails. The pointer wipes the glass like a fingertip, and the fog creeps back over the stroke.

- Slug: `fogged-glass`
- Category: [Backgrounds](https://www.assembli.design/category/backgrounds.md)
- Type: block
- Tags: webgl, shader, glass, rain, bokeh, pointer, calm
- npm dependencies: motion
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/fogged-glass
- Page: https://www.assembli.design/components/fogged-glass

![Fogged Glass preview](https://www.assembli.design/thumbnails/fogged-glass-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `scene` | `FoggedScene` | `"garden"` | Scene in light mode. |
| `darkScene` | `FoggedScene` | `"city"` | Scene in dark mode. |
| `mode` | `"auto" \| "light" \| "dark"` | `"auto"` | Follow the page theme, or force one. |
| `fog` | `number` | `0.85` | How thick the condensation is, 0 (a light mist) to 1 (opaque). |
| `refog` | `number` | `6` | Seconds a wiped stroke takes to fog back over. |
| `drips` | `number` | `6` | How many drops run down the glass, 0 to 10. |
| `speed` | `number` | `1` | Time scale. 0 holds the drops still. |
| `interactive` | `boolean` | `true` | Dragging or moving the pointer wipes the glass clear. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/fogged-glass/fogged-glass.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/fogged-glass
```

Registry item JSON: https://www.assembli.design/r/fogged-glass.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
