
Logo loader
Transitions, SVG, Text
A minimal page transition for Halloween night, with no pumpkins and no candle drawn: only light, dark and one line. On a click the warm light of the page closes into a circle that gets smaller and warmer, drawn towards the link, and the letters of the title thin out as the light leaves them; it flickers like a flame being blown and goes out. From that point a thread of smoke rises, curls and fades, then the next page lights up again from the same point and its title takes its weight as the light reaches 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>
<!--
"Candle-out transition" 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 page transition that goes out like a candle</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>
<main class="scena" data-stage>
<!-- the first page: a title in the warm light of the page -->
<section class="pagina is-on" data-page="a" aria-label="Tonight">
<header class="testa">
<span class="marchio">Vesper</span>
<span class="voce">Stories for the long night</span>
</header>
<h1 class="titolo" data-title>After dark</h1>
<p class="riga-sotto">Short stories, read by one lamp.</p>
<a class="vai" href="#story" data-go data-autoclic>
<span class="vai__t">Read tonight’s story</span>
<svg class="vai__freccia" viewBox="0 0 26 12" aria-hidden="true"><path d="M1 6h22M18.5 1.5 23.5 6l-5 4.5"/></svg>
</a>
</section>
<!-- the second page: the same light, lit again from the point where the first one went out -->
<section class="pagina" data-page="b" aria-label="The story" aria-hidden="true">
<header class="testa">
<span class="marchio">Vesper</span>
<span class="voce">Nine minutes, by the window</span>
</header>
<h2 class="titolo" data-title>Last light</h2>
<p class="riga-sotto">The house was quiet, and the wick still warm.</p>
<a class="vai vai--torna" href="#tonight" data-go data-autoclic>
<svg class="vai__freccia" viewBox="0 0 26 12" aria-hidden="true"><path d="M25 6H3M7.5 1.5 2.5 6l5 4.5"/></svg>
<span class="vai__t">Back to tonight</span>
</a>
</section>
<!-- the dark that closes in around the light, and the warm glow that gathers as it shrinks -->
<div class="buio" data-dark aria-hidden="true"></div>
<div class="calore" data-warm aria-hidden="true"></div>
<!-- the one line of smoke that rises when the light goes out -->
<svg class="fumo" data-smoke aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="sfuma" gradientUnits="userSpaceOnUse" data-fade>
<stop offset="0" style="stop-color:var(--fumo);stop-opacity:0.95"/>
<stop offset="0.55" style="stop-color:var(--fumo);stop-opacity:0.5"/>
<stop offset="1" style="stop-color:var(--fumo);stop-opacity:0"/>
</linearGradient>
<filter id="velo" x="-50%" y="-10%" width="200%" height="120%"><feGaussianBlur stdDeviation="2.2"/></filter>
</defs>
<path class="fumo__velo" data-wisp filter="url(#velo)"/>
<path class="fumo__filo" data-thread/>
</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.
24 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 “Candle-out transition” from Animorio and fit it into my siteOver the page lies a veil the colour of the night, with a radial gradient that is clear in the middle: the circle of light. A script writes its centre, radius and edge softness every frame, with five stops for an edge that fades gently. At rest the radius is bigger than the page and leaves only a vignette that breathes with three overlapping sines.
A second layer in screen blending lays an orange gradient on the same centre: its strength grows as the radius drops, so the shrinking circle warms up by itself. The ember left after the light goes out is the same layer with one more number that GSAP brings down to zero.
Before it goes out the radius passes through seven hand-picked values, smaller and smaller but not in order (22, 31, 15, 25, 10, 17, 7 pixels), with timings that grow longer: the flame leaning and catching again. The FLICKER knob draws them closer to the starting radius.
The smoke is an SVG path of thirty points joined with a Catmull-Rom curve: each point rises with its place along the thread and moves sideways with two sines that run over time, wider towards the top, so the line curls as it rises. Its head and tail are two numbers that GSAP raises, and a vertical gradient fades it upwards; under it the same line, blurred, makes a veil.
The letters of the title are measured once; every frame their distance from the centre of the light, compared with the radius, gives a value between zero and one that picks the weight of the variable font, from 300 to 620. So the title thins out as the light leaves it and takes its weight as the light reaches it.
| Name | File | Default | What it changes |
|---|---|---|---|
SPEED | script.js | 1 | 2 = twice as fast, 0.5 = half as fast. |
FLICKER | script.js | 1 | How hard the light flickers before it goes out: 0 = it just goes out. |
WARMTH | script.js | 1 | How warm the light gets as it closes in: 0 = no warm glow. |
SMOKE | script.js | 1 | How tall the thread of smoke rises. |
CURL | script.js | 1 | How much the smoke curls: 0 = a straight line. |
DARK | script.js | 0.9 | Seconds of dark between the smoke and the new light. |
THIN | script.js | 300 | The weight of the title letters out of the light (lit, they are 620). |
For moving from one page to another on a dark, intimate site: a story magazine, a night-time podcast, a theatre, an art-house cinema, a bar that opens in the evening, a special Halloween page. It works with any link: the light closes in towards the one that was clicked.
The same transition: the title is as big as the screen allows, in width and height, the smoke rises a little less and the light closes in towards the link that was tapped.
Nothing closes in and nothing rises: the page fades into the dark and the next page fades in, with its title already at its weight.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.1 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.