Skip to content
animorio
IT
Back to the library

Slinky spring loader

Physics, SVGGSAPMediumCompressed weight: Demo 6.2 KBGSAP 28 KBFreeDownload the zip

The file upload of a made-up app, Ostra Drive: the progress bar is a coil spring, a slinky drawn with thin lines, its back strands paler. Each turn is a small mass tied to the others by a spring, written by hand in the ticker: the head follows the upload in jumps and the turns behind it stretch unevenly and wobble. At 100% the tail lets go, the coil snaps shut to the right with a bounce and turns into the check: «Uploaded». The pointer over the coil tugs it a little. Minimal style, a single accent.

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>
<!--
  "Slinky spring 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>Slinky spring loader</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- The upload card of a made-up file app, Ostra Drive. The progress bar is a coil spring, a slinky drawn with thin
       lines: its coils are little masses tied by springs, integrated by hand in the GSAP ticker. The head follows the
       upload in jumps and the coils behind it stretch unevenly and wobble; at 100% the tail lets go, the whole coil
       snaps shut to the right with a bounce and turns into the check. The pointer over the coil tugs it a little. -->
  <main class="stage">
    <article class="loader" data-loader aria-label="Uploading brand-assets.zip">
      <header class="loader__head">
        <div class="loader__title">
          <p class="eyebrow">
            <svg class="eyebrow__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 10.5V3.2M5.2 5.9 8 3.1l2.8 2.8M3.2 9.6v2.2c0 .6.5 1.1 1.1 1.1h7.4c.6 0 1.1-.5 1.1-1.1V9.6"/></svg>
            Ostra Drive
          </p>
          <h1><span data-verb>Uploading</span> <span class="mono">brand-assets.zip</span></h1>
        </div>
        <p class="pct" aria-live="polite"><span data-pct>0</span><i>%</i></p>
      </header>

      <svg class="coil" data-coil viewBox="0 0 400 92" role="img" aria-label="A coil spring stretching as the file uploads">
        <line class="rail" x1="22" y1="82" x2="378" y2="82"/>
        <line class="rail rail--done" data-rail x1="22" y1="82" x2="22" y2="82"/>
        <g data-spring>
          <path class="strand strand--back" data-back d=""/>
          <path class="strand strand--front" data-front d=""/>
        </g>
        <g class="done" data-done-mark opacity="0">
          <circle class="done__ring" data-done-ring cx="0" cy="0" r="17"/>
          <path class="done__tick" data-done-tick d="M-6.8 0.4 -2.2 4.8 7 -4.6" pathLength="1"/>
        </g>
      </svg>

      <footer class="loader__foot">
        <p class="size"><span class="mono" data-mb>0.0</span> of <span class="mono">184 MB</span></p>
        <p class="status" data-status>Starting</p>
      </footer>
    </article>
  </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.

22 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 “Slinky spring 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 a warm white page, the Ostra Drive card: at the top «Uploading brand-assets.zip», on the right the large percentage. Below, on a thin line, an orange coil spring all bunched up on the left. The upload moves in jumps: at each jump the head of the coil runs forward on a soft spring, goes a little past and comes back, and the turns behind follow one after another, wider apart where the turns are lighter, with a wave running along the coil and dying out. The line below fills up to the head, the percentage and the megabytes climb, the bottom row counts down the seconds left. At 100% the tail lets go: the coil snaps shut to the right, the turns pack against the head and bounce, then the coil shrinks and in its place the orange circle grows with the check drawing itself: «Uploaded». After a moment it starts again. Moving the pointer over it, the nearby turns bend towards it.

How it works

The turns as masses

The coil is a row of COILS+1 nodes along the axis: each neighbouring pair is tied by a spring of stiffness STIFFNESS that wants to sit at the thickness of the wire. The masses are not all equal (a sine varies them by 35%), which is why the coil stretches unevenly, like real ones.

The head that follows

The last node is heavier and is pulled towards the upload’s point by a soft spring, damped by LAG: when the percentage jumps, the head shoots ahead, overshoots a little and drags the turns behind it, and the wave runs along the coil until DAMPING puts it out.

The ticker

In GSAP’s ticker the frame time, capped at a thirtieth of a second, is split into ten steps: at each step forces, speeds and positions, then a check that stops the turns passing through each other (they stop at the thickness of the wire and bounce a little).

The drawing

Each turn between two nodes is one loop of a helix seen from the side: the front half leans right and is solid, the back half leans left and is paler. Wider turns lean more. Just two paths, redrawn every frame.

The snap and the check

At 100% the first node stops being fixed and a spring pulls it to the right: the coil snaps shut against the head and bounces. Then the group shrinks to the middle of the stack and in its place the circle with the check grows, measured on the same centre.

Values to change

NameFileDefaultWhat it changes
COILSscript.js24How many turns the coil has.
STIFFNESSscript.js5200How stiff the spring between two turns is (higher, faster waves).
DAMPINGscript.js6How quickly the wobble dies out.
LAGscript.js0.32How loosely the head follows the upload (0.1 bouncy, 1 no overshoot).
TUGscript.js10How far the pointer can pull the coil up or down.
DURATIONscript.js6.5About how long the upload takes, in seconds.
HOLDscript.js1.6How long «Uploaded» stays before the next upload, in seconds.
--accentstyle.css#e0592aThe single accent colour: the coil, the filled line and the check.

Try them in the Playground

When to use it

Instead of the usual progress bar in a file upload, a backup or an export, when the wait lasts a few seconds and can make people smile: in a file app, a photo upload, the dashboard of a cloud service.

On phones

The card is sized on the width and the drawing on the height too (vh); since it is an SVG with its own units, the physics stays identical at every size. On a phone a finger moving over the coil tugs it like the pointer.

With reduced motion

No springs and no wobble: the coil stretches in three still steps (a third, two thirds, all), the percentage follows, and at the end the coil fades out and the check appears.

Pitfalls

  • The time between two frames is capped at a thirtieth of a second and split into ten steps: with a high STIFFNESS a single step would make the coil explode.
  • The check that stops the turns passing through each other accounts for the masses and, while loading, for the fixed first node: without it the coil bunched on the left would crumple at the first jump.
  • The circle with the check sits on the true centre of the closed stack, measured at that moment: the stack does not always end in the same place, because the head bounces.
  • The check draws with stroke-dashoffset on pathLength 1: GSAP’s autoRound is off, otherwise it would jump from 1 to 0 without drawing.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

Tested on 29 November 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 animations