
Ridge line background
Backgrounds, WebGL, Hover
An animated background for the opening of an AI app, Nacre: behind the headline and the prompt field a soap film is stretched over the dark page, and a soft light reflected in it shows its colours, which come from the thickness of the film as in a real bubble. The film drains slowly and breathes by itself; where the pointer passes the soap swirls into eddies and thins; sending the prompt sends a ring out from the field that runs every colour through to the edges. A hand-written WebGL shader.
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>
<!--
"Soap film background" 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 iridescent soap film background the pointer swirls behind the prompt</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 opening screen of an invented AI app, Nacre, over a soap film stretched across the dark page: a soft light
reflected in it shows the colours of the film, which drain slowly downwards and swirl where the pointer passes;
sending the prompt sends a thinning ring through the film, so the colours ripple out from the field -->
<main class="stage" data-stage>
<canvas class="film" data-film 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">Nacre 2</span>
<span class="pill__text">Now with live canvas</span>
</p>
<h1 class="title" id="hero-title" data-in>What shall we<br><em>make today?</em></h1>
<form class="prompt" data-prompt data-in autocomplete="off">
<span class="prompt__rim" aria-hidden="true"></span>
<label class="sr" for="ask">Ask Nacre</label>
<input class="prompt__input" id="ask" data-input type="text" placeholder="Ask Nacre to draft, plan or design" spellcheck="false">
<div class="prompt__bar">
<button class="tool" type="button" aria-label="Attach a file">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10.6 4.6 5.4 9.8a1.6 1.6 0 0 0 2.3 2.3l5.4-5.4a3 3 0 0 0-4.2-4.2L3.5 7.9a4.3 4.3 0 0 0 6.1 6.1l4.1-4.1"></path></svg>
</button>
<span class="model">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.8c.5 3.2 2 4.7 6.2 6.2-4.2 1.5-5.7 3-6.2 6.2C7.5 11 6 9.5 1.8 8 6 6.5 7.5 5 8 1.8z"></path></svg>
<span>Nacre 2</span>
</span>
<span class="status" data-status aria-live="polite"></span>
<button class="send" type="submit" data-send aria-label="Send">
<span class="send__ring" aria-hidden="true"></span>
<svg class="send__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 12.8V3.6M4.2 7.2 8 3.4l3.8 3.8"></path></svg>
<svg class="send__tick" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.8 8.4 6.7 11.2 12.3 5"></path></svg>
</button>
</div>
</form>
<div class="chips" data-in>
<button class="chip" type="button" data-chip="Draft a launch note for our spring drop">Write</button>
<button class="chip" type="button" data-chip="Plan a three-day trip to Lisbon">Plan</button>
<button class="chip" type="button" data-chip="Design a calm onboarding for a sleep app">Design</button>
</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.
25 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 “Soap film background” from Animorio and fit it into my siteThe WebGL canvas draws a single triangle bigger than the screen, at a little under one pixel per CSS pixel; the shader works out the whole film, pixel by pixel.
For every pixel a thickness in nanometres: thinner at the top and thicker at the bottom, like a draining film, plus a fractal noise warped by another noise that flows with time, so the film marbles by itself. THICKNESS multiplies it.
Light bounces off the two faces of the film and the two waves meet out of phase by 4π·n·d/λ: for seven wavelengths between 430 and 670 nm the shader adds sin² of half the phase, weighted with its colour. Where the film is thick the colours wash out to a pearly white, where it is very thin it goes towards gold and black.
The film only shows where a light falls on it: a soft elliptical window above the headline, LIGHT_SIZE big, which breathes and wanders on a spring, plus a veil of light everywhere and a light thread on the window's edge. Behind the headline the light dims so the words read.
The pointer leaves a trail of 16 points, each with its moment and its direction (which way the path turns). Every point rotates the film's coordinates around itself with a Gaussian: the angle grows and then fades in SETTLE seconds, so the eddy winds up and relaxes. SWIRL multiplies it.
Sending the prompt sends a ring from the field out to the edges, thinning the film as it passes, so every colour runs through it; the button goes from the arrow to the turning ring of colours and to the tick, and the label from «Thinking» to «Draft ready». After AUTO_PILOT seconds without a pointer, a drawn one does it all again.
| Name | File | Default | What it changes |
|---|---|---|---|
THICKNESS | script.js | 1 | How thick the film is (lower: brighter colours, down to black). |
SWIRL | script.js | 1 | How much the pointer swirls the soap (0 no eddies). |
SETTLE | script.js | 4.2 | How many seconds the eddies take to relax. |
DRAIN | script.js | 1 | How fast the film drains and moves by itself. |
LIGHT_SIZE | script.js | 1 | How big the light reflected in the film is. |
SHEEN | script.js | 1 | How bright the film is. |
AUTO_PILOT | script.js | 4 | After how many seconds without a pointer the drawn one starts moving (0 never). |
For the opening of an AI app, an assistant, a creative tool or a product landing page on a dark background: when you need a background that feels like a real material, light and liquid together, reacts to the pointer and to sending the prompt, and leaves the headline and the field in front.
Same animations: the film is sized on the short side of the screen, the finger swirls it like the pointer, headline, field and pills fit inside the box and the status label is short.
With reduced motion the film is still, with its colours and light in place and no eddies; the words only fade in and sending shows the tick and «Draft ready» straight away.
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 15 November 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.