Skip to content
animorio
IT
Back to the library

Downgrade modal

Transitions, HoverGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The «Switch to Free?» window of a made-up SaaS app, Driftboard, opening out of the Pro plan card: the two plans side by side and the list of features. Over Switch to Free the features you would lose switch off one after another, the tick drawing itself back and a thin line running through them, the monthly price rolls from $24 to $0 and three projects out of eight dim. To really switch you hold while an amber ring fills around the button, then the window closes back into the card, which now says Free with Upgrade anytime; Keep Pro closes it with a small settle of relief. Minimal style.

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>
<!--
  "Downgrade modal" 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>Switch to Free?, Driftboard</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>
  <!-- the downgrade window of a made-up SaaS, Driftboard: it opens out of the Pro plan card. Over Switch to Free the
       features you would lose switch off one after another, the monthly price rolls from $24 to $0 and the projects
       that would be archived dim. Switching asks for a hold, then the window closes back into the card, which now
       says Free with Upgrade anytime. Keep Pro closes it with a small settle of relief -->
  <main class="stage" data-stage>
    <span class="glow" aria-hidden="true"></span>

    <section class="plan" data-card aria-label="Your plan">
      <span class="plan__sheen" data-sheen aria-hidden="true"></span>
      <div class="plan__face" data-face="pro">
        <header class="plan__top">
          <p class="brand"><svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4 13.5c2.6-6 9.4-6 12 0"/><path d="M7 15.5c1.6-3 4.4-3 6 0"/></svg>Driftboard</p>
          <p class="tag">Current plan</p>
        </header>
        <div class="plan__row">
          <h1 class="plan__name">Pro</h1>
          <p class="plan__price"><span>$24</span> / month</p>
        </div>
        <p class="plan__meta">Renews Dec 3 · 8 projects · 4 seats</p>
        <button class="soft" type="button" data-open>Change plan</button>
      </div>
      <div class="plan__face plan__face--free" data-face="free" aria-hidden="true">
        <header class="plan__top">
          <p class="brand"><svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4 13.5c2.6-6 9.4-6 12 0"/><path d="M7 15.5c1.6-3 4.4-3 6 0"/></svg>Driftboard</p>
          <p class="tag tag--quiet">Current plan</p>
        </header>
        <div class="plan__row">
          <h2 class="plan__name">Free</h2>
          <p class="plan__price"><span>$0</span> / month</p>
        </div>
        <p class="plan__meta">5 active projects · 3 archived for 30 days</p>
        <button class="up" type="button" data-upgrade tabindex="-1"><span class="up__light" aria-hidden="true"></span><span class="up__text">Upgrade anytime</span></button>
      </div>
    </section>

    <div class="scrim" data-scrim aria-hidden="true"></div>

    <div class="window" data-window>
      <span class="window__shadow" data-shadow aria-hidden="true"></span>
      <div class="modal" role="dialog" aria-modal="true" aria-labelledby="titolo" data-modal>
        <div class="modal__in" data-in>
          <header class="head">
            <div>
              <h2 class="head__title" id="titolo">Switch to Free?</h2>
              <p class="head__sub">You can upgrade again anytime.</p>
            </div>
            <p class="bill" aria-live="polite">
              <span class="bill__label">Monthly</span>
              <span class="bill__sum" aria-hidden="true">$<span class="col col--tens" data-tens><span class="col__strip" data-strip-tens><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span></span></span><span class="col"><span class="col__strip" data-strip-units><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span></span></span></span>
              <span class="sr" data-bill-read>$24 a month</span>
            </p>
          </header>

          <div class="tiers" data-tiers>
            <span class="tiers__frame" data-frame aria-hidden="true"></span>
            <div class="tier" data-tier="pro">
              <span class="tier__name">Pro</span>
              <span class="tier__note">Current · $24</span>
            </div>
            <svg class="tiers__arrow" viewBox="0 0 24 12" aria-hidden="true"><path d="M2 6h19"/><path d="M16.5 1.5 21 6l-4.5 4.5"/></svg>
            <div class="tier" data-tier="free">
              <span class="tier__name">Free</span>
              <span class="tier__note">From Dec 3 · $0</span>
            </div>
          </div>

          <ul class="feats" aria-label="What changes">
            <li class="feat" data-lost>
              <span class="feat__mark"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M4.4 8.3 6.9 10.8 11.7 5.6"/></svg></span>
              <span class="feat__name">Unlimited projects<span class="feat__strike" aria-hidden="true"></span></span>
              <span class="feat__free">Up to 5</span>
            </li>
            <li class="feat">
              <span class="feat__mark"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M4.4 8.3 6.9 10.8 11.7 5.6"/></svg></span>
              <span class="feat__name">Boards and templates</span>
              <span class="feat__keep">Kept</span>
            </li>
            <li class="feat" data-lost>
              <span class="feat__mark"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M4.4 8.3 6.9 10.8 11.7 5.6"/></svg></span>
              <span class="feat__name">90-day version history<span class="feat__strike" aria-hidden="true"></span></span>
              <span class="feat__free">7 days</span>
            </li>
            <li class="feat" data-lost>
              <span class="feat__mark"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M4.4 8.3 6.9 10.8 11.7 5.6"/></svg></span>
              <span class="feat__name">Custom domains<span class="feat__strike" aria-hidden="true"></span></span>
              <span class="feat__free">None</span>
            </li>
            <li class="feat">
              <span class="feat__mark"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M4.4 8.3 6.9 10.8 11.7 5.6"/></svg></span>
              <span class="feat__name">Public share links</span>
              <span class="feat__keep">Kept</span>
            </li>
            <li class="feat" data-lost>
              <span class="feat__mark"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M4.4 8.3 6.9 10.8 11.7 5.6"/></svg></span>
              <span class="feat__name">Priority support<span class="feat__strike" aria-hidden="true"></span></span>
              <span class="feat__free">Community</span>
            </li>
          </ul>

          <div class="data">
            <span class="tiles" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i data-archive></i><i data-archive></i><i data-archive></i></span>
            <span class="data__window" aria-live="polite">
              <span class="data__line" data-line="keep">All 8 projects stay active</span>
              <span class="data__line data__line--warn" data-line="lose">3 of your 8 projects will be archived</span>
            </span>
          </div>

          <footer class="foot">
            <button class="keep" type="button" data-keep>Keep Pro</button>
            <button class="switch" type="button" data-switch>
              <svg class="switch__ring" data-ring-svg aria-hidden="true"><path class="switch__track" data-track></path><path class="switch__fill" data-ring pathLength="1"></path></svg>
              <span class="switch__window">
                <span class="switch__strip" data-label>
                  <span class="switch__line">Switch to Free</span>
                  <span class="switch__line">Hold to confirm</span>
                  <span class="switch__line"><svg class="spin" data-spin viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6"/><path d="M8 2a6 6 0 0 1 6 6"/></svg>Switching</span>
                </span>
              </span>
            </button>
          </footer>
        </div>
      </div>
    </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"></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.

80 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 “Downgrade modal” 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 ground, with a barely there warm glow, the plan card of Driftboard, a made-up SaaS app: the mark, the Current plan tag, Pro, $24 a month, renewing on December 3 with 8 projects and 4 seats, and the Change plan button. Pressed, the «Switch to Free?» window does not appear out of nowhere: it grows out of the card itself, with a clip that starts from its rectangle and widens to the window, while the ground darkens and the card behind steps back. Inside, the title, the monthly price, the two plans side by side (Pro on the left, current, with an amber frame; Free on the right), six features with their ticks, the projects row with eight tiles and the two buttons Keep Pro and Switch to Free. Over Switch to Free the frame slides from Pro to Free with a pixel of bounce, the price rolls from $24 to $0 (the units through 3, 2, 1 and the tens folding away), and the four features you would lose switch off one after another: the tick draws itself backwards, the circle shrinks and comes back, the row greys out, a thin line runs through it and on the right shows what stays with Free (Up to 5, 7 days, None, Community); the two that stay say Kept. Then the projects row rolls to «3 of your 8 projects will be archived» and three tiles empty into amber. Leaving the button everything lights up again, backwards and quicker. On click the button becomes Hold to confirm: held, an amber ring fills around it and the button gives a little; let go too soon, the ring runs back. Full, a spinner turns on Switching and the window closes back into the card, which now says Free, $0, 5 active projects and 3 archived for 30 days, with the amber Upgrade anytime button and a light running through it. Keep Pro closes the window into the card, which dips a few pixels and comes back with a settle, like a sigh of relief, while a light passes over it. Left alone, the page runs through it by itself with a pointer.

How it works

The window that grows out of the card

The window is always in its place, in the middle, only hidden. On opening, the window and the card are measured with getBoundingClientRect (taking out the card’s scale and the viewer’s safety net) and the card’s rectangle becomes a clip-path: inset(top right bottom left round 18px) of the window. GSAP takes that clip to inset(0 round 20px) in MORPH seconds with expo.inOut: card and window look like one plate. To close, the sum is done again and the clip goes back to the card’s rectangle, which in the meantime has come back to its scale.

The features that switch off

The whole effect over Switch to Free is one paused timeline: the frame sliding from one plan to the other, the price digits, the features and the projects. On hover it plays forward with play(), on leaving backward with reverse() and timeScale 1.7, so everything lights up again in the opposite order and quicker. Each lost feature starts STAGGER seconds after the one before: the tick has pathLength 1 and strokeDashoffset from 0 to 1 (autoRound off, or it jumps), the strike is a span in scaleX from 0 to 1 with its origin on the left.

Hold to confirm

The first click arms the button (Hold to confirm). On pointerdown an object p goes from 0 to 1 in HOLD seconds, linear: every step draws the ring (strokeDashoffset = 1 - p) and lets the button give a little. The ring’s path is a pill computed in pixels from the real size of the button, starting from the top middle, and computed again on resize. Let go too soon, p goes back to 0; at 1 a spinner turns (transformOrigin 50% 50% on the whole svg) and after SPIN seconds the window closes back into the Free card.

Values to change

NameFileDefaultWhat it changes
MORPHscript.js0.62Seconds the window takes to grow out of the card and close back.
STAGGERscript.js0.12Seconds between one feature switching off and the next.
OFFscript.js0.34Seconds a feature takes to switch off.
ROLLscript.js0.6Seconds the price takes to roll from $24 to $0.
HOLDscript.js1.1Seconds to hold before the plan changes.
SPINscript.js0.9Seconds of Switching, with the spinner, before the window closes.
SETTLEscript.js3Pixels the card dips with relief on Keep Pro.
AUTOscript.js0.8Seconds before the page runs through by itself, when nobody touches it.

Try them in the Playground

When to use it

In the billing settings of an app or a subscription service, when someone moves to a lower plan: it shows honestly what goes and what happens to the data before confirming, with no tricks, and leaves the way back open.

On phones

The same animations. The window is as wide as the screen minus a margin and the rows tighten with the height; on short screens the subtitle hides. Without hover, the first tap on Switch to Free switches the features off and arms the button, the second one is held.

With reduced motion

No growing clip and no bounces: the window fades in, ticks and lines fade instead of drawing, the price changes at once, the spinner stays still; the hold ring still fills, because it tells how long is left.

Pitfalls

  • The card’s rectangle for the clip-path must be measured without its scale (the card steps back to 0.965 while the window is open) and divided by the scale of the viewer’s safety net, or the window closes into a rectangle smaller than the card and a jump shows.
  • The click that follows the pointerup of a hold let go halfway still arrives: the button only arms from the open state, so it does not start over.
  • The features timeline is rebuilt on resize keeping the point it was at, because the frame of the plans uses pixel sizes.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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