Skip to content
animorio
IT
All components

Data usage card

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.7 KBGSAP 28 KBFreeDownload the zip

A phone plan’s data card: the ring fills with the gigabytes used while the number counts, a tap flips it to what is left and the button adds more: the scale inside the ring stretches, the arc falls back and the gigabytes per day go up.

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>
<!--
  "Data usage 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>Data usage card</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 phone plan's data card: the ring fills with the gigabytes used, a tap on it flips to what is left,
         and the button adds extra gigabytes: the ring's scale stretches and the daily allowance grows -->
    <section class="du" data-du aria-label="Mobile data">
      <header class="du__head">
        <span class="du__title">Mobile data</span>
        <span class="du__plan">Nova <span data-plan></span> GB</span>
      </header>

      <button class="du__ring" type="button" data-flip aria-pressed="false" aria-label="Show data left">
        <svg viewBox="0 0 160 160" aria-hidden="true">
          <path class="du__track" pathLength="1" d="M36.160 123.840A62 62 0 1 1 123.840 123.840"></path>
          <path class="du__left" data-left pathLength="1" d="M36.160 123.840A62 62 0 1 1 123.840 123.840"></path>
          <path class="du__used" data-used pathLength="1" d="M36.160 123.840A62 62 0 1 1 123.840 123.840"></path>
          <g class="du__ticks" data-ticks></g>
        </svg>
        <span class="du__mid">
          <b class="du__num"><span data-num>0.0</span><i>GB</i></b>
          <span class="du__of"><span class="du__mode"><span data-mode>used</span></span> of <span data-total></span> GB</span>
        </span>
      </button>

      <p class="du__note">Renews in <span data-days></span> days, about <b><span data-day></span> GB</b> a day</p>

      <button class="du__add" type="button" data-add aria-pressed="false">
        <svg viewBox="0 0 16 16" aria-hidden="true"><path data-plus-h d="M3 8h10"></path><path data-plus-v d="M8 3v10"></path><path class="du__tick" data-check pathLength="1" d="M3.500 8.400 6.600 11.300 12.500 4.900"></path></svg>
        <span class="du__add-text"><span data-add-text></span></span>
      </button>
    </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.

26 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 “Data usage 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 white, a light card: at the top “Mobile data” and the plan’s name; in the middle a ring open at the bottom, with gigabyte marks inside it. At first the purple arc starts from zero and turns up to the gigabytes used, while the number in the middle counts with it. Tapping the ring, the number counts to the gigabytes left, the word “used” rolls to “left” and the two arcs trade colour: the used one dims, the remaining one lights up; another tap and it goes back. Below, a line says in how many days the plan renews and how many gigabytes a day are left. The black “Add 5 GB” button adds data: the total goes to 35, the marks slide along the ring to make room for a new one, the used arc falls back with a small bounce, the gigabytes per day go up and the button turns light, its plus closing into a drawn check and the label reading “5 GB added”. Pressed again, it takes them away.

How it works

One arc, two readings

Two paths on the same arc with pathLength 1: the used one and the remaining one. A number from 0 to 1 blends their colour with color-mix and makes the figure count from the gigabytes used to those left.

The scale that stretches

The marks are rotated by gigabytes over total. When the total grows with back.out they all slide back and the new one appears at the end: you see that the room has grown, not that the usage went down.

Numbers without a spring

The ring’s total bounces, but the written figures count with power2.out and a snap to the tenth: a number never passes its value.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#6d5efcThe ring’s colour.
USEDscript.js18.4The gigabytes used so far.
PLANscript.js30The plan’s gigabytes.
EXTRAscript.js5The gigabytes the button adds.
DAYSscript.js9The days left before renewal.
WARNscript.js0.85From what share of the plan the ring turns warm (0 to 1).
LOOPscript.jstrueLeft alone, a pointer flips the ring and adds the data.

Try them in the Playground

When to use it

In a carrier’s app or customer area, on the plan page of a travel eSIM, in the dashboard of a service with a monthly quota: cloud storage, minutes, credits, API calls.

On phones

The same card: the ring and the button are tapped with a thumb. The ring and the number are also sized on the window’s height.

With reduced motion

The ring is already filled up to the gigabytes used. The tap and the button change numbers, arcs and labels without motion.

Pitfalls

  • Plan, gigabytes and days are made up: in a real app they come from the carrier, and adding data is a purchase that asks for confirmation and payment.
  • The ring is a button with aria-pressed and a label saying what it will show: the state is not told by colour alone, there is the word “used” or “left”.
  • With WARN the ring turns warm near the limit: try it by raising USED in the Playground.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 18 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 components