Skip to content
animorio
IT
Back to the library

Plan comparison

ScrollGSAP, CSS onlyMediumCompressed weight: Demo 9.8 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The pricing section of a made-up analytics app, Plotwell, in the premium product style: on a near black page a dark panel with the comparison table of the three plans stays put and the scroll fills it in. The column heads rise, every feature row comes in with its rule, its values and its checks drawing themselves, and a violet light runs down the recommended column one row at a time. Then the switch goes from monthly to yearly and the prices roll digit by digit; at the end the recommended column takes the light: a beam goes round its edge, the Recommended label drops in and the trial button shines.

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>
<!--
  "Plan comparison" 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>Plotwell pricing</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 pricing section of a made-up product analytics tool, Plotwell. The stage sticks while you scroll and the
       comparison of the three plans fills itself in: the columns rise, every feature row comes in with its values and
       its checks, and a light runs down the recommended column row by row. Then the switch goes from monthly to
       yearly and every price rolls to the new one; at the end the recommended column takes the light: a beam goes
       round its edge, the label drops in and the trial button catches a shine. -->
  <main>
    <section class="prezzi" data-prezzi>
      <div class="palco" data-palco>
        <div class="alone" data-alone aria-hidden="true"></div>
        <div class="grana" aria-hidden="true"></div>

        <div class="spazio" data-spazio>
          <div class="cornice" data-cornice>
            <article class="pannello" data-pannello>
              <span class="pannello__luce" aria-hidden="true"></span>

              <header class="capo" data-capo>
                <div class="capo__testo">
                  <p class="capo__marchio">
                    <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 13.5V9.2M6 13.5V5.8M10 13.5V7.6M14 13.5V2.5"/></svg>
                    Plotwell
                  </p>
                  <h2 class="capo__titolo">Compare plans</h2>
                  <p class="capo__riga">Every plan comes with unlimited projects and live dashboards.</p>
                </div>
                <div class="interruttore" data-interruttore role="group" aria-label="Billing period">
                  <span class="interruttore__pomo" aria-hidden="true"></span>
                  <span class="interruttore__voce" data-voce="0">Monthly</span>
                  <span class="interruttore__voce" data-voce="1">Yearly <em class="sconto" data-sconto>-20%</em></span>
                </div>
              </header>

              <div class="tavola" data-tavola>
                <div class="scelta" data-scelta aria-hidden="true">
                  <span class="scelta__bordo"></span>
                  <span class="scelta__chip" data-chip>
                    <svg viewBox="0 0 12 12"><path d="M6 1.2l1.3 3.1 3.3.3-2.5 2.2.8 3.3L6 8.4 3.1 10.1l.8-3.3L1.4 4.6l3.3-.3z"/></svg>
                    Recommended
                  </span>
                </div>
                <div class="faro" data-faro aria-hidden="true"><span class="faro__fronte" data-fronte></span></div>
                <!-- the cells are written by script.js from the PLANS and ROWS lists -->
              </div>
            </article>
          </div>
        </div>
      </div>
    </section>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.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 “Plan comparison” 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 a dark panel with round corners rises, with the Plotwell brand, the title ‘Compare plans’ and on the right the Monthly / Yearly switch with a green ‘-20%’ label. As you scroll the section stays put and the table fills itself in. First the glass of the middle column lights up, then the heads of the three plans rise, Starter, Growth and Scale, with the big prices ‘$0’, ‘$39’ and ‘$99 /mo’. Then the feature rows come in one at a time: the thin rule draws from the left, the name slides in, the values rise with a small bounce (tracked events, team seats, data history) and the checks draw themselves in their circles, while where a feature is missing a dim dash stays. With every row a violet light runs down the Growth column, with a bright line at its front that settles under the row that just came in. At the bottom the three buttons rise. Then the switch goes to Yearly: the knob runs, stretches as it goes and settles on a spring, ‘-20%’ pops, and every price rolls forward digit by digit to the yearly one (‘$31’, ‘$79’), while underneath ‘billed monthly’ makes way for the yearly total. At the end the recommended column takes the light: the glass brightens, a beam goes round its edge, the ‘Recommended’ label with its star drops in on top on a spring, the violet glow behind the panel grows and a shine crosses the ‘Start 14-day trial’ button. Scrolling back rewinds it all. With the pointer a soft light follows over the panel's surface.

How it works

A still stage and one timeline

The section is 420vh tall with a 100vh sticky stage inside. Everything that happens is one paused GSAP timeline that ScrollTrigger moves forward and back with the scroll (scrub 0.7); Lenis makes the scrolling smooth.

A table written from data

Plans and rows are two lists at the top of the script: the cells are written into a CSS grid with the names column and three equal columns. The glass of the recommended column and the light that runs down are two items of the same grid, under the cells.

The light that runs down

The light is a gradient cut with clip-path: inset, reading the --riempi variable; the bright line in front has its top at --riempi percent. The timeline takes --riempi one sixth further with every row, on a soft ease, so it settles under the row that just came in.

Prices that roll forward

Every digit is a column with the digits 0 to 9 written twice. It always goes forward: a lower digit goes past 9, the same one spins a full turn, so the whole price rolls. The yearly prices are worked out from the discount.

The knob and the beam

The switch's knob moves with two CSS variables: --t for the place (both positions measured from the words) and --stira, which stretches it while it runs and comes back on a spring. The beam on the edge is a masked conic-gradient turned by --ang.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the whole section takes: 2 = twice as much.
GLOWscript.js1How strong the violet light behind the recommended plan is.
BEAMscript.js1How bright the beam going round the recommended column is.
ROLLscript.js1How long the prices take to roll, compared with the default.
DISCOUNTscript.js20The yearly discount in percent: the yearly prices are worked out from it.
POINTERscript.js1How much the soft light on the panel follows the pointer.

Try them in the Playground

When to use it

For the pricing page of a SaaS, an analytics app, a team tool or a subscription service: the plan comparison table that reads row by row as you scroll and ends on the plan to pick.

On phones

The same animation with adapted sizes: under 600 pixels the panel switches to its narrow version (a shorter names column, smaller prices, buttons with the short label), scales to fit the box and scrolling with a finger fills it in the same way.

With reduced motion

No scroll ride and no movement: the table is already filled in, with the yearly prices, the recommended column lit and the label in place, and the panel fades in.

Pitfalls

  • GSAP writes its own inline transform: the Recommended label was centred with the CSS translate, so the centring has to go to GSAP with xPercent and yPercent, or it jumps sideways as soon as it is animated.
  • In a scroll-linked timeline state changes are not done with call or with classes, which do not undo when scrolling back: the colour of the switch's words and the texts under the prices are tweens, so they rewind by themselves.
  • The knob's sizes come from the switch's words, which change with the font and with the narrow version: they are measured again on every resize and when the fonts are ready.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 9.8 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.

Testing

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