
The coloured fog background
Backgrounds, WebGL
A WebGL animated background for the hero of a small linen house, on a dusky pink plaster wall at sunset: the low sun comes in through a window behind two sheer linen curtains and lays a long slanted patch of light on the wall. The folds of the fabric make soft bands of light and shade that sway in the breeze, the weave and the slubs of the linen show inside the light, between the two curtains the full sun comes through with the shadow of the window bars and below the hem runs a strip of bare sun. In the air, faint beams and fine dust that glints only where the light catches it; the sun sinks slowly and turns rosier. The pointer is a breath of air: it pushes the curtain aside where it passes. Pressing Order free swatches parts the curtains, the light floods in for a moment and the four swatches lift one after the other.
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>
<!--
"Linen curtains 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>Lindra</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.2.10/opsz.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.2.10/opsz-italic.css">
<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 a small linen house on a plaster wall at sunset. A WebGL shader draws the low sun coming through a
window behind two sheer linen curtains: the folds throw soft bands of light and shade that sway in the breeze,
the weave of the linen shows in the light, the curtains part in the middle where the direct sun comes through
with the shadow of the window bars, and below the hem a strip of bare sun. Fine dust glints in the beams.
The pointer is a breath of air: it pushes the curtain aside a little where it passes -->
<section class="stage" data-stage>
<canvas class="wall" aria-hidden="true" data-canvas></canvas>
<canvas class="dust" aria-hidden="true" data-dust></canvas>
<div class="patch" aria-hidden="true"></div>
<header class="bar" data-in>
<span class="brand">
<svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
<path d="M5 4.5h14"/><path d="M7 4.5c-.6 5 .6 10.4-1 15h4.6c1-4.6-.4-10 .6-15"/><path d="M17 4.5c.6 5-.6 10.4 1 15h-4.6c-1-4.6.4-10-.6-15"/>
</svg>
Lindra
</span>
<nav class="nav">
<a class="nav__link nav__link--wide" href="#">Curtains</a>
<a class="nav__link nav__link--wide" href="#">Bedding</a>
<a class="nav__link nav__link--pill" href="#">Our mill</a>
</nav>
</header>
<div class="hero">
<a class="chip" href="#" data-in>
<span class="chip__new">New</span>
<span class="chip__words">The Ochre colourway</span>
<svg class="chip__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 4l4 4-4 4"/></svg>
</a>
<h1 class="title" data-title><span class="title__line">Linen that lets</span> <span class="title__line">the evening in.</span></h1>
<p class="lede" data-in>Stonewashed linen curtains, woven slowly on old looms and hemmed by hand in Flanders.</p>
<div class="actions" data-in>
<button class="btn" type="button" data-btn data-autoclic>
<span class="btn__face" data-face>
<span class="btn__shine" aria-hidden="true"></span>
<span class="btn__words" data-words>Order free swatches</span>
<svg class="btn__icon" viewBox="0 0 16 16" aria-hidden="true">
<path class="btn__arrow" data-arrow d="M3 8h9M8.5 4.2L12.3 8 8.5 11.8"/>
<path class="btn__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
</svg>
</span>
</button>
<a class="ghost" href="#">Shop curtains</a>
</div>
<p class="note" data-in>
<span class="swatches" aria-hidden="true" data-swatches><span></span><span></span><span></span><span></span></span>
<span data-note>Four colours, sent in two days</span>
</p>
</div>
<p class="hint" data-in>Move the pointer to stir the curtains</p>
<p class="sr" aria-live="polite" data-live></p>
</section>
<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.
35 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 “Linen curtains background” from Animorio and fit it into my siteThe whole background is a WebGL shader on a single triangle covering the canvas, full page under the words: the plaster in half shade, the patch of sun with the window, the curtains, the weave, the beams in the air and the grain. On top, a second 2D canvas carries the dust. Without WebGL a banded CSS patch of light remains.
The patch is a signed-distance rectangle, slanted with a horizontal shear and a little wider at the bottom, like a low sun, with edges fading through a pink fringe. The mullion and the transom are two sharp strips of shadow, because they sit close to the glass.
The two curtains hang from a rod above the window: each point of the wall looks at the fabric moved by the breeze, more the lower it is. The folds are two warped sines, with a depth that changes from fold to fold and a brighter thread where the cloth faces the sun; the light that comes through takes the colour of the linen. Hem and edges, folded double, let less light through; between the curtains and below the hem the sun arrives in full.
Linen is known by its slubs: two stretched noises, one along the warp and one along the weft, make the uneven lines; a fine grid is added only on dense screens, where it makes no moiré. Everything is multiplied by the light: in the shade the weave does not show.
The breeze is the sum of three slow sines, plus the gusts (GSAP tweens) and what the pointer adds with its speed. The sway and the opening between the curtains are springs; the pointer's breath moves the fabric inside a Gaussian circle. The dust rises slowly, follows the wind and lights up only inside the beams, worked out in JavaScript with the same formula as the shader.
| Name | File | Default | What it changes |
|---|---|---|---|
BREEZE | script.js | 1 | How strong the steady breeze is (0 = still air). |
GUST | script.js | 1 | How strong the gusts are, on their own and when the button is pressed. |
FOLDS | script.js | 1 | How wide the folds of the linen are (higher = wider, fewer folds). |
SHEER | script.js | 1 | How much light the linen lets through (higher = thinner fabric). |
WEAVE | script.js | 1 | How much the weave and the slubs of the linen show in the light. |
PUFF | script.js | 1 | How far the pointer pushes the curtain. |
DUST | script.js | 1 | How much dust glints in the beams (0 = none). |
HAZE | script.js | 1 | How visible the beams in the air are. |
SUNSET | script.js | 1 | How far the sun sinks and turns rosy over a loop. |
GRAIN | script.js | 0.03 | How strong the grain is. |
SPEED | script.js | 1 | 2 = the loop on its own twice as fast, 0.5 = half. |
LOOP | script.js | true | Repeats the loop of the breeze and the button. |
As the background of the first screen of a shop for fabrics, curtains and home linen, a hotel or holiday home, an interior studio, a restaurant that opens in the evening or a meditation app: wherever a slow warm end-of-day light is wanted instead of a gradient. The colours are --shade, --sun, --dusk, --linen and --clay in the CSS.
The same animations at adapted sizes: on narrow screens the window of light takes more of the wall and passes behind the words, the folds are measured on the width of the light, the heading on width and height; the Curtains and Bedding links go, and on short screens the note and the line at the bottom too. With a finger the breath follows the gesture.
Curtains, sun and dust stay still: the light fades in; pressing the button the curtains part without swaying, the light warms slightly and the label, the checkmark and the note change without motion.
GSAP 3.15.0, Newsreader (font variabile) 5.2.10, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 13 KB; the libraries: GSAP 28 KB.
Tested on 4 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.