Skip to content
animorio
IT
Back to the library

Custom plan card

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

The pricing card of Tidewell, a made-up site builder, on a near black page: the Studio plan on top and, under it, a tray of add-ons. Each add-on is a chip with its own mass, moved by hand-written physics: held, it follows the finger on a spring and leans with its speed; let go, it flies on with its inertia and bounces off the edges. Around the dock of the card there is a magnetic field: the closer a chip gets, the harder it is pulled, a dotted field line joins it to its slot and the dock lights up; close enough, the magnet snatches it even out of your hand. It hits its slot, squashes, the card gives on its own spring and the price rolls digit by digit. Pulled off, the magnet holds it like a rubber band until it breaks free with a jolt.

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>
<!--
  "Custom plan 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 custom plan pricing card with add-ons that snap on like magnets</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 pricing of Tidewell, a made-up site builder for studios: the Studio plan card on top, the add-ons in a
         tray under it. Each add-on is a chip with a mass: dragged and thrown, it flies with inertia; near the card a
         magnet pulls it in, it hits its slot, the card gives under the blow and the price rolls. Pulled off, the
         magnet holds it until it breaks free -->
    <div class="build" data-build>
      <div class="plan" data-plan>
        <article class="plan__card" data-card>
          <span class="plan__grain" aria-hidden="true"></span>
          <span class="plan__shine" aria-hidden="true"></span>
          <header class="plan__head">
            <span class="plan__brand">
              <svg class="plan__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 12.5c2.2-3.3 4.6-3.3 7 0s4.8 3.3 7 0"/><path d="M3 7.5c2.2-3.3 4.6-3.3 7 0s4.8 3.3 7 0"/></svg>
              Tidewell
            </span>
            <span class="plan__chip">Build your plan</span>
          </header>
          <div class="plan__row">
            <div class="plan__title">
              <span class="plan__name">Studio</span>
              <span class="plan__count" data-count>No add-ons yet</span>
            </div>
            <p class="plan__price" aria-label="Price per month">
              <span class="plan__cur">$</span><span class="plan__digits" data-digits></span><span class="plan__per">/mo</span>
            </p>
          </div>
          <div class="dock" data-dock>
            <span class="dock__field" aria-hidden="true"></span>
            <span class="dock__hint" data-hint>
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2.5v8M4.6 7.4 8 10.8l3.4-3.4M3 13.5h10"/></svg>
              Drop add-ons here
            </span>
          </div>
          <button class="plan__btn" type="button" data-btn>
            <span class="plan__btn-face" data-face>
              <span class="plan__btn-sweep" data-sweep aria-hidden="true"></span>
              <span class="plan__btn-words" data-words>Start with Studio</span>
              <svg class="plan__btn-icon" viewBox="0 0 16 16" aria-hidden="true">
                <path class="plan__arrow" data-arrow d="M3 8h9M8.5 4.2L12.3 8 8.5 11.8"/>
                <path class="plan__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
              </svg>
            </span>
          </button>
        </article>
      </div>

      <section class="tray" aria-label="Add-ons">
        <header class="tray__head">
          <span class="tray__label">Add-ons</span>
          <span class="tray__note">Drag onto the plan</span>
        </header>
        <div class="tray__well" data-well></div>
      </section>
    </div>

    <!-- the line of the field, from the chip the magnet is pulling to the slot that waits for it -->
    <svg class="lines" data-lines aria-hidden="true"><path class="lines__path" data-line d=""/></svg>

    <div class="chips" data-chips>
      <button class="chip" type="button" data-chip data-price="3" data-name="Custom domain">
        <span class="chip__face">
          <span class="chip__icon"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.6"/><path d="M2.6 8h10.8M8 2.4c1.7 1.6 2.5 3.4 2.5 5.6S9.7 12 8 13.6M8 2.4C6.3 4 5.5 5.8 5.5 8s.8 4 2.5 5.6"/></svg></span>
          <span class="chip__name">Custom domain</span>
          <span class="chip__price">+$3</span>
        </span>
      </button>
      <button class="chip" type="button" data-chip data-price="5" data-name="Analytics">
        <span class="chip__face">
          <span class="chip__icon"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 13V9.5M6.4 13V5.5M9.8 13V8M13.2 13V3"/></svg></span>
          <span class="chip__name">Analytics</span>
          <span class="chip__price">+$5</span>
        </span>
      </button>
      <button class="chip" type="button" data-chip data-price="8" data-name="Client portal">
        <span class="chip__face">
          <span class="chip__icon"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.6" y="3" width="10.8" height="10" rx="2"/><path d="M2.6 6.2h10.8M5.4 9.4h3.4"/></svg></span>
          <span class="chip__name">Client portal</span>
          <span class="chip__price">+$8</span>
        </span>
      </button>
      <button class="chip" type="button" data-chip data-price="9" data-name="AI copywriter">
        <span class="chip__face">
          <span class="chip__icon"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10.6 2.8l2.6 2.6-7 7-3.3.7.7-3.3z"/><path d="M9 4.4 11.6 7"/></svg></span>
          <span class="chip__name">AI copywriter</span>
          <span class="chip__price">+$9</span>
        </span>
      </button>
      <button class="chip" type="button" data-chip data-price="6" data-name="Team seats">
        <span class="chip__face">
          <span class="chip__icon"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="6" cy="5.8" r="2.3"/><path d="M1.9 13c.4-2.4 2-3.7 4.1-3.7s3.7 1.3 4.1 3.7"/><path d="M10.4 3.7a2.2 2.2 0 0 1 0 4.3M11.6 9.5c1.4.4 2.3 1.5 2.5 3.5"/></svg></span>
          <span class="chip__name">Team seats</span>
          <span class="chip__price">+$6</span>
        </span>
      </button>
    </div>

    <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"/></svg>
    <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.

38 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 “Custom plan 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 near black page, with a faint violet light behind, sits the pricing card of Tidewell: at the top the mark with two waves and the Build your plan pill, then Studio, No add-ons yet and the big price, $12 a month. In the middle a dashed dock with Drop add-ons here, at the bottom the light Start with Studio button with its arrow. Under the card, in a tray, five dark chips with their drawn icon and price: Custom domain +$3, Analytics +$5, Client portal +$8, AI copywriter +$9, Team seats +$6; at first they drop into the tray one by one and settle, floating ever so slightly. Picking one up lifts it with a wider shadow; it follows the finger on a spring and leans with its speed. Brought near the card, the dock lights up violet, a dotted line runs from the chip to the slot waiting for it and the magnet pulls harder and harder; up close it snatches the chip out of your hand. Thrown, it flies on with its inertia, bounces off the edges and the field bends its path. When it arrives it hits its slot, squashes, turns violet, a ring of light opens, the card dips and tilts under the blow and springs back, the price rolls digit by digit and the add-on count under Studio changes. Pulling a chip off the card, the magnet holds it like a rubber band, the card follows a little, then the chip breaks free with a jolt and goes back to the tray. A tap sends a chip onto the card or back. Start with Studio gives under the press, a light sweeps through it twice, Plan saved with the price and a tick that draws itself comes in, then it goes back. The light on the card and its edge follows the pointer. Left alone, a drawn pointer builds the plan: it drags Analytics, throws Custom domain and AI copywriter, pulls Analytics off, saves and empties the plan to start again.

How it works

A small physics, written by hand

Each chip has a position, a velocity, a lean and a squash, and one state: in the tray, in the hand, in flight, on the card or being pulled. GSAP’s ticker splits every frame into steps of 1/240 of a second and on each step adds up the forces: a spring to its place in the tray or on the card, a stiffer spring to the finger, air drag in flight and bounces off the edges of the page.

The magnet: inverse square

The field is measured from the chip’s distance to the dock, with a falloff that reaches zero at the edge of the field. Inside, the acceleration towards the free slot is proportional to 1/d², capped up close, with extra drag so the chip does not orbit. In the hand the magnet only leans it towards the slot; under a set distance it takes over.

The blow and the breakaway

When a chip arrives, its speed turns into a squash that settles on a spring and into a push on the card, down and round depending on where it lands; the card has its own spring and comes back. Pulled off, the chip follows the finger less and less (a rubber band that stiffens) until the distance passes the breakaway: it leaves the card, the card snaps back and for a moment the magnet ignores it.

Values to change

NameFileDefaultWhat it changes
BASE_PRICEscript.js12The price of the Studio plan alone, in dollars a month.
MAGNETscript.js1How hard the magnet pulls: 2 twice as hard, 0.5 half.
FIELDscript.js96How far the field reaches past the dock, in pixels of the design.
BREAKAWAYscript.js62How far a docked chip is pulled before it breaks free.
BOUNCEscript.js0.55How much speed a chip keeps when it hits an edge.
RECOILscript.js1How much the card gives under a landing chip (0 not at all).
SPEEDscript.js1The pace of the autopilot: 2 twice as fast.
--accentstyle.css#6d6bffThe violet of the magnet: the field, the docked chips, the line.
--pagestyle.css#0b0b0eThe near black of the page.

Try them in the Playground

When to use it

For the pricing page of a subscription product, a website builder or a service with add-ons: visitors build their own plan by dragging or throwing the add-ons onto the card and see the price change at once.

On phones

The same animation with adapted measures: card and tray are sized on the height too and both fit the frame; chips are dragged and thrown with a finger, and a tap sends them onto the card or back.

With reduced motion

No motion: the plan is already built with three add-ons and appears with a fade; tapping a chip moves it with a fade, without flight.

Pitfalls

  • Just pulled off the card the chip is still inside the field, and the magnet took it straight back: for a moment after the breakaway the field ignores it.
  • The pixel measures (the tray, the slots on the card, the card’s centre) are taken with the card free of its spring, and taken again on resize.
  • In Mona Sans the digits have different widths: each price digit’s window takes the width of the digit it shows, measured once.

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 15 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