Skip to content
animorio
IT
Back to the library

Installment plan

Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 6.0 KBGSAP 28 KBFreeDownload the zip

The installment plan of a purchase, on warm white: three, six or twelve months to choose, the monthly amount in large type and under it a row of blocks, one per payment, the first green because it is paid today. Changing plan divides the blocks again, the amount counts to its new value and the terms roll. Pointing at a block lifts it and below you read that payment’s date and amount.

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>
<!--
  "Installment plan" 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>Installment plan</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">
    <!-- the installment plan of a purchase: three, six or twelve payments, the blocks of the schedule
         dividing again, the monthly amount counting and the date of each payment on pointing at it -->
    <section class="ip" data-ip aria-label="Pay over time">
      <header class="ip__head"><strong>Pay over time</strong><span class="ip__total">Order <b data-outorder>$480.00</b></span></header>
      <div class="ip__seg" role="group" aria-label="Number of payments" data-seg>
        <i class="ip__pick" data-pick aria-hidden="true"></i>
        <button type="button" class="ip__opt" data-plan="3"><span>3 months</span></button>
        <button type="button" class="ip__opt" data-plan="6"><span>6 months</span></button>
        <button type="button" class="ip__opt" data-plan="12"><span>12 months</span></button>
      </div>
      <div class="ip__hero">
        <span class="ip__num">$<span data-outnum>160.00</span></span>
        <span class="ip__what"><b>a month</b><span class="ip__clip"><span data-outterms>0% interest</span></span></span>
      </div>
      <div class="ip__plan">
        <div class="ip__blocks" data-blocks></div>
        <div class="ip__ends"><span>Today</span><span class="ip__clip"><span data-outlast>Jan 30</span></span></div>
      </div>
      <p class="ip__note"><span class="ip__clip"><span data-outnote>3 payments, the first one today.</span></span></p>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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

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 “Installment plan” 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 warm white, a rounded card: “Pay over time” and on the right “Order $480.00”. Below, three options in a row, “3 months”, “6 months” and “12 months”, the first on a white tile. Then, in large type, “$160.00”, and beside it “a month” with “0% interest” in green. Under it, a row of three wide blocks: the first green, the others grey; at the two ends “Today” and “Jan 30”. At the bottom a light grey box: “3 payments, the first one today.”. Moving the pointer onto the second block lifts and darkens it, and the box says “Dec 30 · $160.00”. Picking “6 months” slides the tile, the three blocks narrow and three more come in from the right edge, the amount counts down to 80.00 and the last date rolls into “Apr 30”. With “12 months” the blocks become twelve, the amount is 41.31 and the terms roll into “6% APR · $495.72 in all”.

How it works

Twelve blocks, always

The blocks are always twelve buttons. For the chosen plan the first ones take equal places and widths; the extra ones close to zero width against the right edge and cannot be reached.

Dividing again

Changing plan animates every block’s position and width to the new values, slightly staggered: the first ones narrow and the others come out of the edge.

The amount

With no interest it is the total divided by the payments; with a rate it is the constant-payment formula. The number shown chases the computed one.

The dates

Each payment falls on the same day of the next month, or on the last day when the month is shorter. Pointing at a block shows its date and amount.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#0f8a5fThe colour of today’s payment and of the terms.
TOTALscript.js480How much the order costs, in dollars.
APRscript.js6The yearly rate of the longest plan, in percent: the other two are interest-free.
SPLITscript.js0.7How many seconds the blocks take to divide again.
SPRINGscript.js1How much the tile and the block pointed at bounce.
LOOPscript.jstrueLeft alone, the demo’s pointer points at the payments, changes plan and starts again.

Try them in the Playground

When to use it

At the checkout of an online store, on the page of an expensive product or in the quote for a course or a trip, where people choose in how many parts to pay; the same row of blocks dividing again carries a project’s milestones, the doses of a treatment or the instalments of a subscription.

On phones

The card is at most 348 pixels wide and about 270 tall, and narrows with the screen: the blocks share the width they find, and with twelve payments they are about 20 pixels wide. On a phone a tap on a block shows its payment and another takes it away.

With reduced motion

No sliding blocks and no counting: on changing plan the blocks are in place at once, the amount and the terms change in one step, and the block pointed at darkens without lifting. The demo’s pointer does not start.

Pitfalls

  • Rate, amounts and dates are examples: in a real product the terms come from the lender, have to be shown in full (rate, APR, total due) and the rules change from country to country.
  • The payment is rounded to the cent, so the total is the payment times the number of payments: in a real plan the last payment absorbs the difference.
  • The closed blocks stay in the page with aria-hidden and out of the Tab order; the live ones give date and amount in aria-label, because they all look the same.
  • The blocks’ width is in pixels on the row’s width: on resize it is recomputed.
  • The order day in the demo is fixed, so the dates are always the same; in a real product it is today’s date.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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