
Woven thread background
Backgrounds, Hover
A night background to put behind a headline: on near black blue a bone white full moon rises slowly from below, goes one pixel past its place and stops behind the words, and its light catches only the top edge of the letters. With the pointer the moon moves by a few pixels, late, and the thread of light on the letters follows it.
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>
<!--
"Full moon 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 full moon rising behind the headline</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>
<!-- a near black blue night with a big headline in the middle: behind it a full moon rises slowly from below and
stops behind the words, and its light catches only the top edge of the letters; the moon follows the pointer by a
few pixels, late, and the light on the letters follows the moon -->
<main class="stage" data-stage>
<span class="halo" data-halo aria-hidden="true"></span>
<div class="moon" data-moon aria-hidden="true">
<span class="moon__face" data-face>
<i class="moon__mare moon__mare--a"></i>
<i class="moon__mare moon__mare--b"></i>
<i class="moon__mare moon__mare--c"></i>
</span>
</div>
<span class="grain" aria-hidden="true"></span>
<!-- the moonlight on the letters: each letter minus itself pushed a hair away from the moon leaves only the edge
that faces the moon, filled in bone -->
<svg class="defs" width="0" height="0" aria-hidden="true">
<filter id="moonlit" x="-4%" y="-8%" width="108%" height="116%" color-interpolation-filters="sRGB">
<feOffset in="SourceAlpha" dx="0" dy="4" result="away" data-away></feOffset>
<feGaussianBlur in="away" stdDeviation="0.2 0.9" result="soft" data-soft></feGaussianBlur>
<feComposite in="SourceAlpha" in2="soft" operator="out" result="edge"></feComposite>
<feFlood flood-color="#fffaee" data-flood></feFlood>
<feComposite in2="edge" operator="in"></feComposite>
</filter>
</svg>
<section class="hero" aria-labelledby="hero-title">
<div class="words" data-words>
<h1 class="title title--body" id="hero-title" data-title>After<br>dark</h1>
<p class="title title--rim" data-rim aria-hidden="true">After<br>dark</p>
</div>
<p class="lede" data-lede>Open after sundown</p>
</section>
</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.
22 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 “Full moon background” from Animorio and fit it into my siteThe headline is written twice in the same grid cell: underneath in solid dark letters, with a gradient clipped to the text; on top a copy through an SVG filter. The filter takes the shape of the letters, subtracts a copy pushed RIM em away from the moon (feOffset, softened a little with feGaussianBlur) and fills what is left with bone white: just the edge that faces the moon.
The thread of light has a radial mask-image with its centre and radius in CSS variables: every frame the centre is the moon’s, measured in the headline’s coordinates. So letters near the moon shine and far ones barely do, and the thread lights up as the moon rises.
How low the moon is, the pixel too far, the light and the press are numbers in an object GSAP animates; one draw in the ticker writes them into the moon, the halo and the thread. The rise is a long power3.out: quick at first, then a slowing down that feels like a horizon.
The moon chases the pointer on a soft spring (stiffness 26, damping 8.2), by FOLLOW pixels at most: it arrives late and sways once. The filter offset leans sideways as far as the moon moves from the middle of the headline, so the light also catches the sides facing it, and it is rewritten only when it changes by a tenth of a pixel.
Moon and headline are sized with min() of vw and vh, so they fit the phone box as they fit a big screen; on resize the headline, the moon and its resting place are measured again, even halfway through the rise.
| Name | File | Default | What it changes |
|---|---|---|---|
TITLE | script.js | After|dark | The headline (the vertical bar breaks the line). |
LINE | script.js | Open after sundown | The small line under the headline (empty to remove it). |
RISE | script.js | 4.6 | How many seconds the moon takes to rise. |
HEIGHT | script.js | 0.2 | How far above the middle of the headline it stops, as a share of the moon. |
RIM | script.js | 0.024 | How thick the thread of light on the edge of the letters is, in em. |
FOLLOW | script.js | 16 | How many pixels at most the moon follows the pointer. |
GLOW | script.js | 1 | How strong the light around the moon is. |
REST | script.js | 6 | How many seconds it stays up before setting and rising again. |
LOOP | script.js | true | Set and rise again. |
AUTO_PILOT | script.js | 3 | After how many seconds without a pointer the invisible one starts moving (0 never). |
As the background of the first screen of an evening event, a venue that opens at night, a festival, a night programme or a sleep app: the headline stays the star and the moon backlights it.
The same moon with adapted sizes: moon and headline are measured on the height too and fit the box; the finger moves the moon like the pointer and holding it down makes the moon brighter.
The moon is already in place behind the headline: the light and the words appear in a fade, the moon does not follow the pointer and does not set; pressing brightens it slightly.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.8 KB; the libraries: GSAP 28 KB.
Tested on 31 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.