Skip to content
animorio
IT
Back to the library

Running medals

Physics, HoverGSAP, CSS onlyAdvancedCompressed weight: Demo 13 KBGSAP 28 KBFreeDownload the zip

The achievements screen of Pacewell, an invented running app, in the style of premium Dribbble shots: four medals of real looking metal (brushed gold, silver, bronze and one still to unlock under frosted glass) hang from fabric ribbons on a brass rod. Each one is a pendulum with real physics: gravity brings it back, the air slows it, the pointer drags it and the medals knock into each other with small elastic hits; the ribbons twist slightly and the reflection slides over the metal. A click turns a medal over to show its engraved back; the last one unlocks with a light running over the titanium and the half marathon time climbing.

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>
<!--
  "Running medals" 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 achievement medals swinging on their ribbons</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" data-stage>
    <!-- the achievements screen of Pacewell, an invented running app: four medals hang from fabric ribbons on a thin
         brass rod and swing like real pendulums. The pointer pushes them and they knock into each other; a click
         turns a medal over to show its engraved back; the last one is still frosted glass until it unlocks -->
    <section class="card" data-card aria-label="Pacewell achievements">
      <header class="card__head">
        <div class="brand">
          <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M5 18.5L11 5.5M10.5 18.5L16.5 5.5M16 18.5l3-6.5"/>
          </svg>
          <span class="brand__name">Pacewell</span>
        </div>
        <span class="chip"><span class="chip__roll" data-count><span>3</span><span>4</span></span><span class="chip__of">of 4 earned</span></span>
      </header>
      <h1 class="card__title">Achievements</h1>

      <div class="rack" data-rack>
        <span class="rod" aria-hidden="true"><span class="rod__cap"></span><span class="rod__cap rod__cap--end"></span></span>

        <div class="medal" data-medal data-metal="gold" data-name="Riverside 10K" data-info="Sep 14, 2026 · 47:36">
          <span class="medal__shadow" data-shadow></span>
          <div class="medal__swing" data-swing>
            <span class="ribbon" data-ribbon><span class="ribbon__fold" data-fold></span></span>
            <span class="medal__ring"></span>
            <span class="medal__edge" data-edge></span>
            <div class="medal__body" data-body>
              <div class="face face--front" data-front>
                <span class="face__ring"></span>
                <span class="face__big">10K</span>
                <span class="face__small">Best</span>
              </div>
              <div class="face face--back" data-back>
                <span class="face__ring"></span>
                <span class="face__line">Riverside</span>
                <span class="face__time">47:36</span>
                <span class="face__line">14.09.26</span>
              </div>
              <span class="medal__glint" data-glint></span>
            </div>
          </div>
        </div>

        <div class="medal" data-medal data-metal="silver" data-name="October distance" data-info="Oct 31, 2026 · 104.6 km">
          <span class="medal__shadow" data-shadow></span>
          <div class="medal__swing" data-swing>
            <span class="ribbon" data-ribbon><span class="ribbon__fold" data-fold></span></span>
            <span class="medal__ring"></span>
            <span class="medal__edge" data-edge></span>
            <div class="medal__body" data-body>
              <div class="face face--front" data-front>
                <span class="face__ring"></span>
                <span class="face__big">100</span>
                <span class="face__small">km</span>
              </div>
              <div class="face face--back" data-back>
                <span class="face__ring"></span>
                <span class="face__line">October</span>
                <span class="face__time">104.6</span>
                <span class="face__line">31.10.26</span>
              </div>
              <span class="medal__glint" data-glint></span>
            </div>
          </div>
        </div>

        <div class="medal" data-medal data-metal="bronze" data-name="First 5K" data-info="Mar 2, 2026 · 27:58">
          <span class="medal__shadow" data-shadow></span>
          <div class="medal__swing" data-swing>
            <span class="ribbon" data-ribbon><span class="ribbon__fold" data-fold></span></span>
            <span class="medal__ring"></span>
            <span class="medal__edge" data-edge></span>
            <div class="medal__body" data-body>
              <div class="face face--front" data-front>
                <span class="face__ring"></span>
                <span class="face__big">5K</span>
                <span class="face__small">First</span>
              </div>
              <div class="face face--back" data-back>
                <span class="face__ring"></span>
                <span class="face__line">Park run</span>
                <span class="face__time">27:58</span>
                <span class="face__line">02.03.26</span>
              </div>
              <span class="medal__glint" data-glint></span>
            </div>
          </div>
        </div>

        <div class="medal medal--locked" data-medal data-metal="titanium" data-locked data-name="Harbour Half" data-info="Nov 2, 2026 · 1:52:08">
          <span class="medal__shadow" data-shadow></span>
          <div class="medal__swing" data-swing>
            <span class="ribbon" data-ribbon><span class="ribbon__fold" data-fold></span></span>
            <span class="medal__ring"></span>
            <span class="medal__edge" data-edge></span>
            <div class="medal__body" data-body>
              <div class="face face--front" data-front>
                <span class="face__ring"></span>
                <span class="face__big">21.1</span>
                <span class="face__small">Half</span>
              </div>
              <div class="face face--back" data-back>
                <span class="face__ring"></span>
                <span class="face__line">Harbour</span>
                <span class="face__time">1:52</span>
                <span class="face__line">02.11.26</span>
              </div>
              <span class="medal__sweep" data-sweep></span>
              <span class="frost" data-frost>
                <svg class="lock" viewBox="0 0 24 24" aria-hidden="true">
                  <path class="lock__shackle" data-shackle d="M8.2 10.5V8a3.8 3.8 0 0 1 7.6 0v2.5"/>
                  <rect class="lock__body" x="6" y="10.5" width="12" height="9" rx="2.4"/>
                  <path class="lock__key" d="M12 14.2v2"/>
                </svg>
              </span>
              <span class="medal__glint" data-glint></span>
            </div>
          </div>
        </div>

        <span class="spark" data-spark aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M10 1.5v4.2M10 14.3v4.2M3.2 4.8l2.6 2.4M14.2 12.8l2.6 2.4M16.8 4.8l-2.6 2.4M5.8 12.8l-2.6 2.4"/></svg></span>
        <span class="spark" data-spark aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M10 1.5v4.2M10 14.3v4.2M3.2 4.8l2.6 2.4M14.2 12.8l2.6 2.4M16.8 4.8l-2.6 2.4M5.8 12.8l-2.6 2.4"/></svg></span>
        <span class="spark" data-spark aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M10 1.5v4.2M10 14.3v4.2M3.2 4.8l2.6 2.4M14.2 12.8l2.6 2.4M16.8 4.8l-2.6 2.4M5.8 12.8l-2.6 2.4"/></svg></span>

        <span class="cursor" data-cursor aria-hidden="true">
          <svg viewBox="0 0 24 24"><path d="M5 3.2l13.6 8.1-6 1.3-3.2 5.6z"/></svg>
        </span>
      </div>

      <footer class="goal" data-goal>
        <div class="goal__text">
          <span class="goal__label" data-label-wrap><span data-label>Next goal</span></span>
          <span class="goal__value" data-value-wrap><span data-value>Half marathon · 18.6 of 21.1 km</span></span>
        </div>
        <span class="goal__bar" aria-hidden="true"><span class="goal__fill" data-fill></span></span>
      </footer>
    </section>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

58 values to change

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 “Running medals” 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 near black page, with the warm light of a display case falling from above and a fine grain, sits the achievements card of Pacewell, an invented running app: at the top the mark with its three orange strokes and the ‘3 of 4 earned’ pill, then the ‘Achievements’ heading. Below, a thin brass rod with its two round caps, and hanging from it four medals on grosgrain ribbons with orange and cream stripes, cut to a point, with a small metal ring: the first in brushed gold ‘10K Best’, the second in silver ‘100 km’, the third in bronze ‘5K First’, the last still covered by frosted glass with a padlock, its ribbon dull and grey. Each medal has a raised rim, an engraved ring, letters cut into the metal with a lit lower lip, radial brushing that catches the light in wedges and a soft shadow on the back of the card. They swing like real pendulums: gravity brings them back, the air slows them, and when two touch they knock, pass the push along and a small flash of six strokes lights up for an instant where they hit. At every hit the ribbon twists a little, the medal turns a few degrees and the reflection slides over it. The pointer passes through and drags them; over a medal it brings it slightly closer on a spring. On click the medal turns over like a coin (it narrows, its milled edge shows, it widens again) and comes forward a little to show its engraved back: the race name, the time in large figures and the date; under the rack the line changes to ‘Riverside 10K, Sep 14, 2026 · 47:36’. A click on the glass unlocks it: the padlock opens, the glass draws back from the bottom, the ribbon takes its colour, a band of light runs over the anodised titanium, the medal knocks its neighbour, the pill rolls to ‘4 of 4’, the orange bar fills and ‘Unlocked, Half marathon · 1:52:08’ rises with the time running up to the right figures. On its own a drawn pointer passes through the medals, turns the silver one over and back, then unlocks the last one.

How it works

Each medal is a pendulum

Every frame, in three small steps, the angle of each medal gets gravity (minus g over length times the sine of the angle) and air damping (minus the damping times the speed). The ribbon and the medal turn together around the pivot on the rod with a single rotate in radians.

The pointer drags

If the pointer is over the coin or over the ribbon, the medal's speed is pulled towards the pointer's along the tangent, harder when it moves fast and less when it touches the ribbon near the pivot (the lever). The drawn pointer of the autopilot goes through the same path, with its speed computed between frames.

Knocks between neighbours

For each pair of neighbours the distance between the centres is measured: if it is less than the sum of the radii they are pushed apart and, if they are closing in, they exchange speed along the normal with a restitution (BOUNCE). Above a certain speed the six stroke SVG flash starts at the contact point and the metal brightens for an instant.

The turn without 3D

The coin turns with a scaleX equal to the absolute cosine of the angle, and when the cosine changes sign front and back swap. The edge is a darker milled disc behind, shifted sideways by the sine of the angle: that is how the thickness shows. The twisted ribbon is another scaleX with the cosine of the twist, plus a shade that rises with the sine.

The unlock

A GSAP timeline opens the padlock, draws the glass back with a clip-path from the bottom, gives the ribbon its colour back, runs a band of light over the titanium, knocks the medal, rolls the pill's digit and raises the line with the time running from 0:00:00 to 1:52:08.

Values to change

NameFileDefaultWhat it changes
GRAVITYscript.js2400How hard gravity pulls the medals back: higher swings faster.
DAMPINGscript.js0.9How quickly the swinging dies out.
PUSHscript.js1How strongly the pointer drags the medals it passes through.
BOUNCEscript.js0.55How much speed is kept when two medals knock (0 = dead, 1 = elastic).
TWISTscript.js1How much the ribbons twist at every hit.
LIFTscript.js1.3How much a turned medal comes towards you.
SIZEscript.js0.42The radius of the medals, relative to their slot on the rod.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the walk of the drawn pointer.

Try them in the Playground

When to use it

On the achievements or profile page of a running, cycling, swimming or fitness app, in the awards of an online course, in the badges of a community or a game, in an app's year in review: wherever a reached goal should feel like a real object to touch. The metals are --gold, --silver, --bronze and --ti in the CSS, the brand colour is --accent.

On phones

The same animations at adapted sizes: the card takes the width of the screen, the medals are measured on their slot on the rod and on the height of the page, the ribbons get longer or shorter to fit the card. A finger drags the medals and a tap turns them over.

With reduced motion

The medals stay still and straight and do not knock: turning one is a fade between front and back, the unlock fades the glass away and the time appears already right.

Pitfalls

  • With a single step per frame two fast medals pass through each other before the knock sees them: three small steps per frame are enough.
  • The grey filter of the locked ribbon sat on a class: removing it, the filter was gone before GSAP read it and the colour came back at once. The starting filter is set inline with gsap.set.
  • Turning the coin with a negative scaleX mirrors the writing on the back: the absolute value of the cosine is used and the face is chosen by its sign.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 4 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