Skip to content
animorio
IT
All components

Storage ring card

Cards, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 7.1 KBGSAP 28 KBFreeDownload the zip

The storage card of a file app, clean like a real product piece: a ring split into four coloured parts that draw one after another, the percentage counting up to 72% in the middle, the legend with thin bars. Hovering an item lifts its part out of the ring and the centre says how much it weighs; Upgrade doubles the space and every part shrinks to half.

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>
<!--
  "Storage ring card" 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 storage card with a ring that fills up</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 storage card of a file app: a ring split in four that draws itself, the percentage counting up in the middle,
         a legend with thin bars, each part lifting out of the ring on hover, and an Upgrade that doubles the space -->
    <section class="store" data-card aria-label="Driftbox storage">
      <header class="store__head">
        <svg class="store__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M7 18h10.5a4 4 0 0 0 .6-7.95A6 6 0 0 0 6.5 9.2 4.4 4.4 0 0 0 7 18Z"></path></svg>
        <div class="store__title">
          <p class="store__name">Storage</p>
          <p class="store__sub">Driftbox <span>&middot;</span> <span data-plan>Personal plan</span></p>
        </div>
        <p class="store__cap"><span data-used-gb>72.4</span> GB <span class="store__of">of <span data-cap>100</span> GB</span></p>
      </header>

      <div class="store__body">
        <div class="ring" data-ring>
          <svg class="ring__svg" viewBox="0 0 200 200" aria-hidden="true">
            <circle class="ring__track" cx="100" cy="100" r="78" pathLength="100" transform="rotate(-90 100 100)" data-track></circle>
            <g data-segs></g>
          </svg>
          <div class="ring__center" aria-live="polite">
            <div class="ring__big"><span class="ring__val" data-center-val>0%</span></div>
            <p class="ring__small" data-center-lab>used</p>
          </div>
        </div>

        <ul class="legend" data-legend></ul>
      </div>

      <footer class="store__foot">
        <p class="store__free"><span data-free>27.6</span> GB free</p>
        <button class="up" type="button" data-up>
          <span class="up__roll">
            <span class="up__txt" data-up-a>Upgrade</span>
            <span class="up__txt up__txt--b" data-up-b aria-hidden="true">Upgraded</span>
          </span>
          <svg class="up__ico" viewBox="0 0 16 16" aria-hidden="true" data-up-ico>
            <path class="up__arrow" d="M3.5 8h8.5M8.5 4.5 12 8l-3.5 3.5"></path>
            <path class="up__check" d="M3.6 8.4 6.6 11.2 12.4 4.8" data-up-check></path>
          </svg>
        </button>
      </footer>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></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>

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.

35 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 “Storage ring card” 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 very light grey background rises the white storage card of Driftbox, an invented file app: the black cloud, Storage, «Personal plan» and on the right 72.4 GB of 100. Below, on the left, a grey ring draws itself clockwise from twelve o’clock, then on top of it the four coloured parts draw one after another, Photos in indigo, Videos in violet, Documents in teal and Other in grey, each one parted from the next by a small gap; meanwhile the percentage in the middle counts from 0 to 72% and on the right the thin bars of the legend fill up in a stagger, each with its share of the used space. When the drawing ends the ring swells by a pixel and comes back with a small bounce. Hovering an item in the legend, or the part itself, lifts the part out of the ring along its middle and thickens it, the others step back, the item’s bar gets thicker and in the middle the percentage rolls away upwards to make room for the item’s weight, «31.2 GB» and «Photos». Upgrade, at the bottom, rolls into Upgraded, turns green and draws a done mark: the plan becomes Pro, the capacity goes up to 200 GB and every part of the ring shrinks to half, while the percentage drops to 36% and the free space grows. A drawn pointer reads the four items, rests on the videos part, presses Upgrade and starts again; the mouse and a finger do the same.

How it works

A ring a hundred long

Each part is a circle with pathLength="100": the stroke-dasharray is written in hundredths of the ring, «31.2 100» is 31.2% of the turn. Where it starts is a rotation of the transform attribute around the centre, -90 degrees plus 3.6 degrees for each hundredth already taken, minus a small gap between one part and the next.

One element for GSAP, one for the attribute

The rotation sits on the circle as an attribute, the hover shift sits on the group around it: GSAP moves the group by x and y along the cosine and sine of the angle at the part’s middle, and the circle’s rotation is never touched. The thickness grows with attr stroke-width.

Drawing and counting together

On entrance each part has a drawn value from 0 to 1 that a timeline moves forward, staggered by 0.82 times the drawing duration; onUpdate rewrites the dasharrays. The percentage is an object counted over the same stretch of time, so it reaches 72% just as the last part closes.

Upgrade recomputes everything

The capacity is a piece of state that GSAP takes from 100 to 200 in 1.1 seconds: on every frame the start, length and middle of each part, the header numbers and the free space are recomputed. The button swaps two labels inside a mask and draws its mark with strokeDashoffset.

The autopilot

A timeline with repeatRefresh takes the drawn pointer to each item reading its real position every time, then to the middle of the videos part computed from its angle, then to Upgrade. At the first real touch or mouse move over the card it stops, and it starts again after eight seconds.

Values to change

NameFileDefaultWhat it changes
CAPACITYscript.js100The plan’s GB: the whole ring.
PHOTOSscript.js31.2The photos’ GB, the first part of the ring.
VIDEOSscript.js22.8The videos’ GB.
DOCSscript.js12.6The documents’ GB.
OTHERscript.js5.8The GB of everything else.
DRAW_TIMEscript.js0.5How many seconds each part takes to draw on entrance.
LIFTscript.js3.2How far the hovered part lifts out of the ring.
PAUSEscript.js1How many seconds the autopilot rests on each item.

Try them in the Playground

When to use it

For the settings of a file or photo app, a cloud service’s panel, a SaaS subscription page, anywhere you need to say how much space is left and invite an upgrade to a bigger plan.

On phones

The ring and the legend stay side by side: the ring goes down to 112 pixels and is also measured on the height (min(31vw, 30vh)), the legend tightens its type under 360 pixels. Tapping an item does what hovering does.

With reduced motion

No drawing and no bounces: the ring appears already full, the percentage is already at 72%, on hover the parts dim without lifting and Upgrade changes the numbers all at once.

Pitfalls

  • GSAP on SVG circles overwrites the transform attribute: the rotation that places the part sits on the circle, the hover shift on the group around it.
  • With pathLength="100" the dasharray is written in hundredths for the gap too: «31.2 100», not the circumference in pixels.
  • The sum of the GB must not exceed the capacity: past that, the parts overlap the start of the ring.

Libraries

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.

Testing

Tested on 26 October 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