Skip to content
animorio
IT
Back to the library

Checkout case study

Scroll, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 12 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The case study page of a made-up product studio, Oddmark Studio, on the new checkout of Brewline, a made-up coffee subscription app. The stage stays still and, as you scroll, the phone goes through the three chapters of the study: the problem, with the old five-step checkout full of fields and red rings drawing round the friction; the process, with the screen turning into a wireframe on a grid and the blocks moving one at a time and merging into a single screen, followed by the selection frame with its handles; the result, with the new checkout filling in, the order going through with a tick and a light on the glass. Beside it the results card counts the conversion, the time to pay and the drop-off, and the segmented control on top springs to the chapter.

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>
<!--
  "Checkout case study" 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>Oddmark Studio, the Brewline checkout case study</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 case study page of a made-up product studio, Oddmark. A sticky stage: as you scroll, the checkout of a made-up
       coffee app, Brewline, goes through the three chapters of the study. Problem: the old five-step screen, with red
       rings drawing round the friction. Process: the screen turns into wireframe blocks on a grid and the blocks move and
       merge into one screen. Result: the new checkout fills in, the order is placed, and the results card counts the
       numbers up. The segmented control on top follows the chapter and takes you to it -->
  <section class="corsa" data-corsa>
    <div class="palco">
      <div class="alone" aria-hidden="true"><span class="alone__rosso" data-alone-rosso></span><span class="alone__blu" data-alone-blu></span></div>

      <div class="posto" data-posto>
        <div class="scala" data-scala>

          <p class="occhiello">
            <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.5" y="2.5" width="11" height="11" rx="5.5"/><path d="M5.5 10.5 10.5 5.5"/></svg>
            Oddmark Studio <span class="occhiello__sep">/</span> Case study
          </p>
          <h2 class="titolo">Brewline checkout<br><span class="titolo__due"><span class="titolo__in" data-riga>Five steps lost two in three.</span></span></h2>

          <nav class="capitoli" data-capitoli aria-label="Chapters">
            <span class="capitoli__pillola" data-pillola aria-hidden="true"></span>
            <button class="capitolo" type="button" data-capitolo="0"><span class="capitolo__in">Problem</span></button>
            <button class="capitolo" type="button" data-capitolo="1"><span class="capitolo__in">Process</span></button>
            <button class="capitolo" type="button" data-capitolo="2"><span class="capitolo__in">Result</span></button>
          </nav>

          <div class="fila">
            <figure class="telefono" data-telefono>
              <div class="schermo" data-schermo>
                <span class="isola" aria-hidden="true"></span>
                <span class="barra-stato" aria-hidden="true"><span>9:41</span>
                  <svg viewBox="0 0 28 10"><path d="M1 8h2M5 6.5V8M8 5v3M11 3.5V8" class="segnale"/><rect x="15.5" y="1.5" width="10" height="7" rx="2"/><rect x="17" y="3" width="6.5" height="4" rx="1" class="pila"/></svg></span>

                <div class="testa-app">
                  <span class="testa-app__nome">Checkout</span>
                  <span class="testa-app__passo" data-passo-app>
                    <span class="passo-prima" data-passo-prima>Step 2 of 5</span>
                    <span class="passo-dopo" data-passo-dopo><svg viewBox="0 0 12 12" aria-hidden="true"><rect x="2.5" y="5.2" width="7" height="5" rx="1.4"/><path d="M4 5.2V4a2 2 0 0 1 4 0v1.2"/></svg>Secure</span>
                  </span>
                </div>
                <div class="avanza" data-avanza aria-hidden="true">
                  <span class="avanza__pezzo" data-pezzo></span><span class="avanza__pezzo" data-pezzo></span><span class="avanza__pezzo" data-pezzo></span><span class="avanza__pezzo" data-pezzo></span><span class="avanza__pezzo" data-pezzo></span>
                </div>

                <!-- the grid the designers lay over the screen while they rework it -->
                <div class="griglia" data-griglia aria-hidden="true"><span></span><span></span><span></span><span></span><span></span><span></span></div>

                <!-- the old screen -->
                <div class="prima" data-prima>
                  <div class="p p--banner" data-p><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M6 1.6 7.3 4.4l3 .3-2.3 2 .7 3L6 8.2 3.3 9.7l.7-3-2.3-2 3-.3z"/></svg>Join Brewline Club and save 10%</div>
                  <div class="p p--campo" data-p>First name</div>
                  <div class="p p--campo" data-p>Last name</div>
                  <div class="p p--campo" data-p>Email</div>
                  <div class="p p--campo" data-p>Phone</div>
                  <div class="p p--campo" data-p>Address line 1</div>
                  <div class="p p--campo" data-p>Postcode</div>
                  <div class="p p--campo" data-p>City</div>
                  <div class="p p--spunta" data-p><span class="casella"><svg viewBox="0 0 10 10" aria-hidden="true"><path d="M2.4 5.2 4.2 7l3.4-3.8"/></svg></span>Create an account to continue</div>
                  <div class="p p--continua" data-p>Continue</div>
                  <div class="p p--nota" data-p>Total shown at step 5</div>
                </div>

                <!-- the wireframe blocks, one for each old piece -->
                <div class="fili" data-fili aria-hidden="true"></div>

                <!-- the new screen -->
                <div class="dopo" data-dopo>
                  <div class="d d--prodotto" data-d>
                    <span class="sacco" aria-hidden="true"><span class="sacco__etichetta"></span></span>
                    <span class="prodotto__testi"><span class="prodotto__nome">Guji Natural</span><span class="prodotto__nota">250 g, whole bean</span></span>
                    <span class="prodotto__prezzo">£14.50</span>
                  </div>
                  <div class="d d--express" data-d><svg viewBox="0 0 14 14" aria-hidden="true"><path d="M7.6 1.4 3.2 8h3.4l-.8 4.6L10.8 6H7.2z"/></svg>Express pay</div>
                  <div class="d d--o" data-d><span>or pay by card</span></div>
                  <div class="d d--campo" data-d><span class="campo__nome">Email</span>sam@mailbox.co</div>
                  <div class="d d--campo" data-d><span class="campo__nome">Address</span>14 Elm Row, Leeds<svg class="campo__segno" viewBox="0 0 12 12" aria-hidden="true"><path d="M6 10.6s3.4-3 3.4-5.6a3.4 3.4 0 0 0-6.8 0c0 2.6 3.4 5.6 3.4 5.6z"/><circle cx="6" cy="5" r="1.1"/></svg></div>
                  <div class="d d--campo" data-d><span class="campo__nome">Card</span>Visa ending 4242</div>
                  <div class="d d--totale" data-d><span>Total, with delivery</span><strong>£16.90</strong></div>
                  <div class="d d--ordina" data-d data-ordina>
                    <span class="ordina__fondo" data-ordina-fondo aria-hidden="true"></span>
                    <span class="ordina__finestra"><span class="ordina__in" data-ordina-in><span class="ordina__riga">Place order</span><span class="ordina__riga"><svg viewBox="0 0 14 14" aria-hidden="true"><path d="M3.4 7.3 5.9 9.7 10.8 4.6" data-ordina-spunta/></svg>Order placed</span></span></span>
                  </div>
                  <div class="d d--nota" data-d>Free delivery over £15. Skip or pause anytime.</div>
                </div>

                <!-- the red rings round the friction -->
                <svg class="anelli" viewBox="0 0 162 346" aria-hidden="true">
                  <rect x="5" y="80" width="152" height="171" rx="9" pathLength="1" data-anello/>
                  <rect x="5" y="258.5" width="152" height="22" rx="8" pathLength="1" data-anello/>
                  <rect x="26" y="314" width="110" height="18" rx="8" pathLength="1" data-anello/>
                </svg>
                <span class="cartellino" style="left: 104px; top: 73px" data-cartellino>7 fields</span>
                <span class="cartellino" style="left: 84px; top: 251px" data-cartellino>Forced sign-up</span>
                <span class="cartellino" style="left: 92px; top: 307px" data-cartellino>Hidden total</span>

                <span class="riflesso" data-riflesso aria-hidden="true"></span>
              </div>
            </figure>

            <section class="risultati" data-risultati aria-label="Results">
              <span class="risultati__luce" aria-hidden="true"></span>
              <div class="risultati__testa">
                <span class="risultati__nome">Results</span>
                <span class="etichetta"><span class="etichetta__finestra"><span class="etichetta__in" data-etichetta>Baseline</span></span></span>
              </div>

              <p class="grande__nome">Conversion</p>
              <p class="grande"><span class="grande__valore" data-conv>1.8%</span><span class="salto" data-salto>
                <svg viewBox="0 0 10 10" aria-hidden="true"><path d="M2.5 7.5 7.5 2.5M3.8 2.5h3.7v3.7"/></svg>2.5x</span></p>

              <svg class="grafico" viewBox="0 0 180 56" preserveAspectRatio="none" aria-hidden="true">
                <defs>
                  <linearGradient id="sotto" x1="0" y1="0" x2="0" y2="1">
                    <stop offset="0" stop-color="var(--blu)" stop-opacity="0.22"/>
                    <stop offset="1" stop-color="var(--blu)" stop-opacity="0"/>
                  </linearGradient>
                </defs>
                <path class="grafico__riga" d="M0 14.5H180M0 28.5H180M0 42.5H180"/>
                <path class="grafico__area" data-area d="M2 47 C22 46 34 44 50 42 S78 36 94 30 S124 18 140 14 S166 8 178 6 V56 H2 Z"/>
                <path class="grafico__a" pathLength="1" data-linea-a d="M2 46 C26 45.5 40 47 60 45.6 S96 46.6 118 45.4 S156 46 178 45.2"/>
                <path class="grafico__b" pathLength="1" data-linea-b d="M2 47 C22 46 34 44 50 42 S78 36 94 30 S124 18 140 14 S166 8 178 6"/>
              </svg>
              <p class="legenda"><span class="legenda__a">Old flow</span><span class="legenda__b" data-legenda-b>New flow</span></p>

              <div class="riga" data-riga-ris>
                <span class="riga__nome">Time to pay</span>
                <span class="riga__valore" data-tempo>3:12</span>
                <span class="binario"><span class="binario__prima" data-prima-segno></span><span class="binario__pieno" data-pieno></span></span>
              </div>
              <div class="riga" data-riga-ris>
                <span class="riga__nome">Drop-off</span>
                <span class="riga__valore" data-abbandono>68%</span>
                <span class="binario"><span class="binario__prima" data-prima-segno></span><span class="binario__pieno" data-pieno></span></span>
              </div>
            </section>
          </div>
        </div>
      </div>
    </div>
  </section>
  <footer class="piede-pagina">Oddmark Studio and Brewline are made up.</footer>

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

70 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 “Checkout case study” 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 warm white ground with a light grain sits the case study page: at the top Oddmark Studio / Case study with the studio’s little mark, the title Brewline checkout and below it a grey second line that changes with each chapter, then the segmented control Problem, Process, Result with the white pill on the current chapter. Below, on the left, a dark phone with an edge that catches the light and, on the right, the white results card, with Conversion in large type, a small chart, Time to pay and Drop-off with their bars. At first the phone shows the old checkout, Step 2 of 5: the yellow club strip, seven grey fields, the compulsory box to create an account, the grey Continue button and the note Total shown at step 5. As you scroll, a red light comes on behind the phone and three red rings draw round the fields, the box and the note, with the tags 7 fields, Forced sign-up and Hidden total popping out; in the card the figures count in red up to 1.8%, 3:12 and 68% and the grey line of the old flow draws. In the Process chapter the pill springs to Process, the rings go, the screen turns into a wireframe of blue blocks on a six-column grid, the step bar closes into one and the blocks, one after another, move to their new place and merge in pairs, with a four-handle selection frame following them; in the card the rising blue line of the new flow draws. In the Result chapter the grid goes and the new checkout appears over the blocks: the Guji Natural coffee bag at 14.50 pounds, the black Express pay button, the fields already filled, the total in view, the blue Place order button and Secure at the top. The figures rise to 4.6%, 0:48 and 21%, a blue wash comes up under the chart and the 2.5x chip arrives; then Place order is pressed, the label rolls to Order placed with a tick drawing itself and a light passes over the glass. Scrolling back undoes it all; tapping a chapter scrolls the page there.

How it works

One timeline, in three chapters

The whole case study is a paused GSAP timeline split into three stretches, problem, process and result, and ScrollTrigger drives it back and forth with scrub while the stage stays still with position: sticky. On each update the script reads the time, works out the chapter and, only when it changes, springs the pill of the segmented control and rolls the second title line.

From the old screen to the new one through wireframe blocks

The old checkout and the new one are two lists of rectangles on the same screen. For each old piece there is a wireframe block: first it takes its place, then GSAP moves it with left, top, width and height to the rectangle of the new piece that replaces it, and the blocks that merge in pairs land in the same place and fade. The selection frame with its handles makes the same journey, group by group.

Rings and lines that draw

The red rings and the chart lines have pathLength="1", so stroke-dasharray and stroke-dashoffset run from 1 to 0 whatever their real length; with autoRound off GSAP does not round the offset and the lines draw without jumps.

Figures read from the time

Conversion, time to pay and drop-off are not tweens: they are worked out from the timeline’s time on each update, stretch by stretch, so scrolling back counts them back too. The colour changes with the chapter through a class and a CSS transition.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the whole case study takes: 2 is twice as long.
SCRUBscript.js0.6How far the phone lags behind the scroll, in seconds.
SPRINGscript.js1.6How far the chapter pill overshoots when it springs (0 for none).
STAGGERscript.js0.2The gap between one wireframe block moving and the next.
GLOWscript.js1How visible the light behind the phone is (0 none).
RINGSscript.js11: the red rings draw round the friction; 0: no rings.
SWEEPscript.js11: a light sweeps the glass when the order goes through; 0: no light.
--blustyle.css#3a5cffThe blue of the result: wireframe, button, chart and figures.
--rossostyle.css#e5484dThe red of the problem: rings, tags and baseline figures.
--fondostyle.css#f2f0ebThe warm white of the ground.

Try them in the Playground

When to use it

For a case study page in the portfolio of a design, brand or product studio, or of a freelancer: whoever scrolls sees the problem, the work and the result on the same changing screen, with the figures beside it, instead of three images stacked one under the other.

On phones

The same animation with adapted measures: the whole composition is drawn at 400 by 500 and scales down by both the width and the height of the stage, so phone and card stay side by side within the screen even in the short phone preview.

With reduced motion

No motion: the case study is already at the result, with the new checkout, the order placed, the final figures and the chart, and it appears with a fade.

Pitfalls

  • With the composition scaled by transform: scale, the space it takes stays the real one: the scale goes on an absolute child and the container takes the width and height already multiplied, or on the phone the page overflows sideways.
  • The blocks that merge in pairs and the selection frame have tweens that overlap a little: each one starts with fromTo and immediateRender: false, so scrolling back with scrub every block finds its starting place again.

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 12 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 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