Skip to content
animorio
IT
All components

Fairy lights loader

Loading, SVGGSAP, CSS onlyEasyCompressed weight: Demo 3.7 KBGSAP 28 KBFreeDownload the zip

A loader for December, alone on black: a wire hung between two points with nine unlit fairy lights, and the percentage below. As the number climbs the lights come on one after another, each with a small pop and its warm halo, and the wire gives slightly under every new light. The bulbs sway gently on the wire. At a hundred a wave of light runs along the whole string, the label rolls to “All lit” and after a pause it starts again.

The code

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>
<!--
  "Fairy lights loader" 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>Fairy lights loader</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="stage">
    <!-- a loader made of a string of fairy lights: the bulbs light up one by one with the percentage, sway
         gently on the wire, and at the end a wave runs along the string -->
    <section class="fl" data-fl role="progressbar" aria-label="Loading" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
      <svg class="fl__svg" data-svg viewBox="0 0 300 96" aria-hidden="true">
        <defs><radialGradient id="fl-halo" cx="50%" cy="50%" r="50%"><stop offset="0" stop-color="var(--accent)" stop-opacity="0.55"></stop><stop offset="1" stop-color="var(--accent)" stop-opacity="0"></stop></radialGradient></defs>
        <path class="fl__wire" data-wire></path>
        <g data-bulbs></g>
      </svg>
      <p class="fl__pct"><b data-outpct>0%</b></p>
      <p class="fl__label"><span class="fl__clip"><span data-outlabel>Hanging the lights</span></span></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>

Playground

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.

11 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

Or ask your AI assistant for it

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 “Fairy lights loader” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On black, in the middle, a thin grey wire hung between two points, hanging in a soft curve; along the wire nine small drop-shaped bulbs, with their grey caps, unlit and dark. Below, large, “0%”, and under it the label “Hanging the lights”. The wire arrives settling on a spring and the bulbs sway gently, each in its own time. Then the number climbs: fast to a little past half, hesitating around two thirds, and finishing. At every ninth of the way a bulb comes on: it turns gold with a white glint, swells for a moment and comes back, a warm halo opens around it, and the wire gives two pixels and rises again. At “100%” they are all lit: one after another they dim for an instant and return, like a wave running along the wire, and the label rolls to “All lit”. After a couple of seconds they go out and the loader starts again.

How it works

The wire is a curve

A single curve between two points, with one number saying how low its middle hangs. The bulbs sit on the curve at equal distances and follow it if the number changes.

The percentage switches on

Every bulb has its share: it comes on when the percentage passes it. The real loading only has to change one number from 0 to 100.

The pop and the give

When it lights, the bulb starts larger and comes back on a spring, the halo rises in a third of a second and the wire drops a little and rises again: the weight of the light.

The final wave

At a hundred every bulb makes the same small step, dimming and returning, offset by seven hundredths from its neighbour: from a distance it is a wave.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ffcf70The colour of the lit bulbs.
BULBSscript.js9How many bulbs there are on the wire.
SECONDSscript.js5How many seconds the loader takes to reach 100.
HOLDscript.js2.2How many seconds it stays all lit before starting again.
LOOPscript.jstrueOnce at 100, the demo’s loader starts over.

Try them in the Playground

When to use it

When a shop’s site opens in December, while the gift basket is prepared, the Advent calendar loads or a Christmas market page starts; out of season the same string carries the lights of a terrace, a garden party or a village fair, changing only the colour.

On phones

The loader is at most 320 pixels wide and about 170 tall: the wire narrows with the screen keeping its proportions, the number stays at 40 pixels. It sits in the middle, alone.

With reduced motion

The bulbs do not sway and come on with no pop or growing halo; the wire stays still, no final wave, the label changes in one step. The number still climbs.

Pitfalls

  • The drawing is decorative: the loader is a `role="progressbar"` with its value updated, and the number is written below.
  • The bulbs move by writing their SVG group’s `transform` attribute from animated numbers: place on the wire, sway and pop sit in the same line and do not fight.
  • Lights on and steady, not blinking: the final wave passes only once.
  • In the demo the number is moved by a timeline that hesitates on purpose; on a real site you tie it to the real progress and remove the timeline.
  • The halo uses the CSS variable’s colour inside an SVG gradient: change the colour and glass and halo change together.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 3.7 KB; the libraries: GSAP 28 KB.

Testing

Tested on 2 December 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components