Skip to content
animorio
IT
All components

Parking fine card

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

A parking fine in a city app: the discounted amount counts up, the full one is struck through, five segments tell how many days the discount has left and give their date on hover; paying, the button fills, spins and the whole card turns from amber to green.

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>
<!--
  "Parking fine 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>Parking fine 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 city app's parking fine: the early payment discount runs out day by day on five segments,
         hovering a segment tells its date, and paying turns the whole card green -->
    <section class="mf" data-mf aria-label="Parking fine">
      <header class="mf__head">
        <span class="mf__sign" aria-hidden="true">
          <svg viewBox="0 0 24 24"><path d="M9 17.500V6.500h3.900a3.300 3.300 0 0 1 0 6.600H9"></path></svg>
        </span>
        <span class="mf__who">
          <b>Parking fine</b>
          <span>Corso Lume, <span data-issued></span></span>
        </span>
        <span class="mf__state"><span class="mf__state-word"><span data-state>Due</span></span></span>
      </header>

      <div class="mf__car">
        <span class="mf__plate" aria-label="Plate GX 482 KT"><i aria-hidden="true"></i><span>GX 482 KT</span></span>
        <span class="mf__why">Zone B, no permit</span>
      </div>

      <div class="mf__amount">
        <b class="mf__num" data-num>€0.00</b>
        <span class="mf__full"><span data-full></span><i class="mf__strike" data-strike></i></span>
        <span class="mf__off" data-off></span>
      </div>

      <div class="mf__window">
        <div class="mf__row">
          <span>Early payment discount</span>
          <span class="mf__left"><span data-left></span></span>
        </div>
        <div class="mf__days" data-days role="img" aria-label="Five days of discount">
          <span class="mf__tip" data-tip aria-hidden="true"><b data-tip-day></b><span data-tip-note></span></span>
        </div>
      </div>

      <button class="mf__pay" type="button" data-pay>
        <span class="mf__fill" data-fill></span>
        <span class="mf__wash" data-wash></span>
        <svg class="mf__icon" viewBox="0 0 20 20" aria-hidden="true">
          <g data-cardicon><rect x="2.500" y="4.500" width="15" height="11" rx="2.400"></rect><path d="M2.500 8.300h15M5.500 12.300h3"></path></g>
          <circle class="mf__spin" data-spin cx="10" cy="10" r="6.400" pathLength="1"></circle>
          <path class="mf__tick" data-tick pathLength="1" d="M5.200 10.300 8.500 13.400 14.900 6.700"></path>
        </svg>
        <span class="mf__label"><span data-label></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.

24 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 “Parking fine 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 the parking sign, “Parking fine”, the street and the time, and on the right the “Due” pill; below, the plate and the reason. At first the discounted amount counts up from zero, the full one beside it is struck through by a line that draws itself and the discount label arrives. Five segments, one per day of the discount, run out up to today while the label beside them counts the hours left. Moving over the segments, the one under the pointer rises and a glass label gives its date and whether it is gone, today, the last day or still at the discounted price. The black “Pay” button fills with light from the left while the card icon gives way to a spinner; then the whole card turns from amber to green, the pill says “Paid”, the segments fill in a wave, the button says the receipt was sent and the discount line says how much was saved. After a few seconds it is due again.

How it works

One number for the days

The days gone are a single number, from 0 to 5: each segment fills its own share of it with scaleX, and the hours-left label is worked out from the same number.

The colour in a variable

The sign, the pill, the segments, the button and the shadow all read --tone. GSAP animates the variable from amber to green and the card changes colour all at once.

The label that stays inside

The glass label centres on the segment under the pointer, but its position is clamped between the card’s edges: on the last day it never sticks out.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#e8871eThe colour of the fine to pay.
PAIDscript.js#1d9a5bThe colour of the paid fine.
AMOUNTscript.js42The fine’s full amount, in euros.
DISCOUNTscript.js30The discount for paying within the five days, in percent.
HOURS_LEFTscript.js38The hours the discount has left (1 to 120).
URGENTscript.js12Below how many hours the time left turns red.
HOLDscript.js3.5After a payment made by hand, the seconds before the card is due again.
LOOPscript.jstrueLeft alone, a pointer runs along the days and pays.

Try them in the Playground

When to use it

In a council’s or local police app, on a public payments portal, in a parking or car sharing app; and wherever something must be paid with a discount that runs out: a bill, a tax, an early renewal.

On phones

The same card: tapping a segment shows its date, the button is pressed with a thumb. The amount and the spacing are also sized on the window’s height.

With reduced motion

Amount, strike-through and days are already in place. The date label appears without moving and paying changes colours and labels without motion.

Pitfalls

  • Street, plate, dates and amount are made up. The 30% discount within five days is the one Italian fines give for many offences, but not all: in a real app rules and amounts come from the authority.
  • The payment here is fake: in a real service the button opens the payment with its confirmation, and the card turns “Paid” only when the authority records it.
  • The state is not told by colour alone: the pill says “Due” or “Paid” and the discount line gives the hours or how much was saved.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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