
Woven thread background
Backgrounds, Hover
The background of the holiday page of Thimble & Pine, a made-up cafe and gift shop opening its December season: on a midnight blue that is almost black, a string of fairy lights crosses the top in a soft curve, behind the serif headline «Lights on, December». The bulbs, small drops of glass with their socket, filament and a reflection, light up in a wave along the wire: a flicker, then a warm light rising from ember red to amber and settling, with a soft halo on the night; then they breathe slowly, each on its own. The pointer brushing the wire sways it, the bulbs swing like pendulums and settle, and the one under the pointer burns brighter. The headline catches the light.
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>
<!--
"String lights 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 background of the string lights that light up in waves</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full-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>
<main class="stage" data-stage>
<!-- the holiday page of a made-up cafe and gift shop, Thimble & Pine, opening its December season. A string of
fairy lights crosses the top of the page in a soft curve on a midnight blue: the glass bulbs light up in a wave
along the wire, warming from ember to amber, and each throws a soft halo on the night. The pointer sways the
wire, the bulbs swing like pendulums and settle, and the bulb under the pointer burns brighter -->
<canvas class="sky" data-sky aria-hidden="true"></canvas>
<span class="grain" aria-hidden="true"></span>
<section class="hero" data-hero>
<p class="eyebrow" data-rise>
<svg class="eyebrow__mark" viewBox="0 0 20 20" aria-hidden="true">
<path d="M10 2.2 15.6 11H4.4Z"/>
<path d="M10 7.4 16.8 17H3.2Z"/>
<path d="M10 17v1.6"/>
</svg>
<span>Thimble <em>&</em> Pine</span>
<span class="eyebrow__rule" aria-hidden="true"></span>
<span>Winter season</span>
</p>
<h1 class="title" data-title>
<span class="title__line" data-rise>Lights on,</span>
<span class="title__line title__line--it" data-rise>December</span>
</h1>
<p class="line" data-rise>Open late from the first of the month: spiced cider, ginger loaf and small gifts wrapped by hand.</p>
<a class="pill" href="#menu" data-rise data-pill>
<span class="pill__bg" aria-hidden="true"></span>
<span class="pill__text">See the winter menu</span>
<svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.2M8.6 4.2 12.4 8l-3.8 3.8"/></svg>
</a>
</section>
<svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></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.
30 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 “String lights background” from Animorio and fit it into my siteThe wire is made of 64 points. Each is held to its rest curve (a slightly uneven sine between two anchors off screen) by a soft spring and to its neighbours by a strong one: the difference between the displacement of a point and that of its neighbours pulls it, so a push runs along the wire like a wave and damping puts it out. The physics step is fixed, 1/240 of a second, whatever the refresh rate of the screen.
Each bulb is a damped pendulum hanging from a point of the wire: the acceleration of the wire at that point, divided by the length of the pendulum, pushes it; gravity brings it back down and damping stops it. Each has a slightly different rest lean, so the row does not look stamped out.
The socket is a rounded rectangle with a left to right gradient and two ridges; the glass is a drop made of four Bézier curves, filled first with a dark tint and then with a radial gradient in the colour of the light; the filament is two leads and a curl, the reflection a white curve that is stronger when the bulb is dark.
The brightness of each bulb is a number GSAP takes to 0.42, to 0.08, to 0.3 (the flicker) and then to 1.06 in 0.9 s on sine.out and to 1 (the touch too far and the settle). The colour comes from the brightness on a tungsten scale, from ember red to amber to warm white: so the light also rises in temperature. The bulbs start 0.11 s apart: that is the wave.
Each bulb draws, in lighter mode, a tight halo around the glass and a wide faint crown a little lower, on the night: where two bulbs are close the lights add up. The breath is the sum of two very slow sines with different phases for each bulb. The average of the lights goes into the --lit variable, which warms the colour and the glow of the headline.
The points of the wire near the pointer take its velocity, weighted by the squared distance; the bulb under the pointer rises by 0.55 on a spring and gets a sideways nudge. Left alone, a GSAP timeline brings a drawn pointer across the wire, rests it on a bulb, takes it out and lights the wave again the other way; every 13 s, if someone is using the page, the wave passes again.
| Name | File | Default | What it changes |
|---|---|---|---|
BULBS | script.js | 15 | How many bulbs hang on the wire on a wide screen (fewer on a narrow one). |
ACCENT_EVERY | script.js | 4 | Every how many bulbs one is cranberry instead of amber (0 for none). |
SAG | script.js | 0.2 | How deep the wire hangs, as a share of the height of the page. |
WAVE_GAP | script.js | 0.11 | Seconds between one bulb lighting up and the next. |
WARM_TIME | script.js | 0.9 | Seconds a bulb takes to warm up from ember to full light. |
WAVE_EVERY | script.js | 13 | Seconds between one wave and the next while someone is using the page. |
BREATH | script.js | 0.06 | How much the lit bulbs breathe, very slowly (0 for still). |
HOVER_BOOST | script.js | 0.55 | How much brighter the bulb under the pointer burns. |
GLOW | script.js | 1 | The size of the halos and of the crowns of light on the night. |
SWAY | script.js | 1 | How much the pointer sways the wire. |
SWING | script.js | 1 | How much the bulbs swing on the wire. |
IDLE | script.js | 4.4 | Seconds before the pointer brushes the wire on its own. |
LOOP | script.js | true | Left alone, brush the wire and light the wave again and again. |
For the holiday header of a cafe, a bakery, a restaurant, a shop or a Christmas market, the page of a December event, the landing of a winter collection or an advent calendar. The string alone also works at the top of a newsletter or a greetings page.
The same animation with adapted sizes: the bulbs are measured on the shorter side of the screen and there are fewer (at least seven), the wire hangs at most a third of the width, the headline is measured with min(vw, vh). A finger sliding over the wire sways it, and the bulb under the finger burns brighter.
The wire and the bulbs stay still: no sway and no pendulums. The bulbs light up all together in a fade and, every so often, dim and slowly come back, always together; the words fade in. The bulb under the pointer still burns brighter. No pointer on its own.
GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.4 KB; the libraries: GSAP 28 KB.
Tested on 13 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.