
Ridge line background
Backgrounds, WebGL, Hover
An animated background for an AI app’s hero, at night: behind the headline a window pane fogged with breath, and behind the glass the lights of a city out of focus. The pointer wipes the condensation like a hand: the lights come through sharp, the edge of the wiped trail catches the light, a few drops run down in spurts and slowly the glass fogs up again in patches. The button clears the whole pane with one wave. A hand-written WebGL shader, in the Libraries.dev style.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Fogged glass" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The fogged glass background you wipe clear with the pointer</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- the hero of an invented AI assistant, Clearly, at night: behind the words a window pane fogged with breath, and
behind the glass the lights of a city out of focus; the pointer wipes the fog away like a hand, the lights come
through sharp, a few drops run down the clear trail, and slowly the fog comes back -->
<main class="stage" data-stage>
<canvas class="glass" data-glass aria-hidden="true"></canvas>
<canvas class="fog-flat" data-fog-flat aria-hidden="true"></canvas>
<span class="grain" aria-hidden="true"></span>
<section class="hero" aria-labelledby="hero-title">
<p class="pill" data-in>
<span class="pill__tag">New</span>
<span class="pill__text">Clearly 2 sorts your week in one pass</span>
<svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5"></path></svg>
</p>
<h1 class="title" id="hero-title" data-in data-title>See through<br>the noise</h1>
<p class="lede" data-in>Mail, meetings and notes, cleared into one calm plan. Ask Clearly what matters today.</p>
<div class="actions" data-in>
<button class="cta" type="button" data-cta>
<span class="cta__label">Try it free</span>
<svg class="cta__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4 12.5 8l-4 4"></path></svg>
</button>
<span class="hint" data-hint>
<svg class="hint__hand" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 10.5c2.2-1.6 4-1.6 6 0s3.8 1.6 6 0"></path><path d="M3 14.5c2.2-1.6 4-1.6 6 0s3.8 1.6 6 0"></path></svg>
<span>Wipe the glass</span>
</span>
</div>
</section>
<svg class="ghost" data-ghost viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.3 2.3-1-2.4-5.2 4.8-.2z"></path></svg>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
23 values to change
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “Fogged glass” from Animorio and fit it into my siteThe WebGL canvas draws a single triangle bigger than the screen, and all the work is in the fragment shader: for each pixel it works out the city seen through clear glass and the city seen through the condensation, and mixes them by how much fog there is at that point.
Eighteen fixed lights, picked with a seeded generator, most of them low like streets and windows. Through clear glass each one is a disc with a brighter rim; through the fog it becomes a bell BLUR times wider, washed towards grey, and the black rises to a glassy grey.
The condensation lives in a 2D canvas a quarter the size of the page, white with alpha: the hand punches it with soft destination-out stamps, close together along the stroke. Every frame the canvas becomes the shader’s texture.
Every frame a patchy white drawing is laid over the canvas, very transparent: the fog comes back faster in some places, so the glass fogs up again in blotches, in FOG_BACK seconds.
The shader measures how much the fog changes around the pixel: where it changes a lot is the edge of the wiped trail, and there it adds a thread of light and a darker line. The drops are a JavaScript list: they run down in spurts, clear a thin streak and in the shader they are small lenses showing the city upside down.
When pressed, the button starts a wave: a ring of stamps growing from the button to the corners in 1.5 seconds. The headline reads how much glass is clear and widens a little. After a few seconds without a pointer a looping timeline with a drawn pointer starts; the first real movement stops it.
| Name | File | Default | What it changes |
|---|---|---|---|
FOG_BACK | script.js | 8 | How many seconds the wiped glass takes to fog up again. |
WIPE | script.js | 44 | Radius of the wiping hand, in pixels. |
DRIPS | script.js | 1 | How many drops run down from the wiped area (0 none). |
LIGHTS | script.js | 1 | How strong the lights behind the glass are. |
BLUR | script.js | 1 | How much the condensation spreads and blurs the lights. |
AUTO_PILOT | script.js | 3 | After how many seconds without a pointer the drawn one starts wiping (0 never). |
For the hero of an AI app, a service that tidies things up, a hotel or a bar at night: when you need a dark background that invites a touch and still leaves the headline in front.
Same animations: the finger wipes the glass (the page doesn’t scroll over the demo), the lights are sized on the short side of the screen and the text fits inside the box.
With reduced motion the glass is already fogged with one clear band behind the headline, still: no drops, no trembling lights, no fogging up again; you can still wipe with the pointer, and the words only fade in.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.
Tested on 30 October 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.