Skip to content
animorio
IT
Back to the library

Checkout transition

Transitions, HoverGSAP, CanvasAdvancedCompressed weight: Demo 11 KBGSAP + Flip 37 KBFreeDownload the zip

The page transition of a made-up homeware online shop, Quillhouse: pressing Checkout in the side cart widens the panel into the payment page, the three product rows fly to the top right and compact on top of each other into a stack that becomes the order summary, the total flies to its place and rolls from 206 to 214 dollars, the card fields come in staggered and Checkout turns into Pay. Hovering the stack lifts the rows behind so they show; Back to cart opens the stack back into rows. The thumbnails are real, copyright-free product photos: the stoneware vase, the folded linen, the glass pitcher.

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 transition" 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 Checkout transition with the summary stack</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
  <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 shop of a made-up homeware brand, Quillhouse: pressing Checkout in the side cart opens the payment page.
         The cart rows compact on top of each other into a stack that becomes the order summary, top right,
         the total flies to its place and rolls, the card fields come in staggered. Back to cart opens the stack again. -->
    <div class="fit" data-fit>
      <div class="app" data-app>

        <!-- the shop page under the cart -->
        <section class="shop" data-shop aria-hidden="true">
          <header class="shop__bar">
            <span class="brand">Quillhouse</span>
            <nav class="shop__nav"><span>Living</span><span>Kitchen</span><span>Textiles</span><span>Journal</span></nav>
            <span class="bag">
              <svg viewBox="0 0 20 20"><path d="M4.6 7.2h10.8l-.9 9.2a1.4 1.4 0 0 1-1.4 1.3H6.9a1.4 1.4 0 0 1-1.4-1.3Z"/><path d="M7.4 7.2V5.9a2.6 2.6 0 0 1 5.2 0v1.3"/></svg>
              <span class="bag__n">3</span>
            </span>
          </header>
          <div class="shop__hero">
            <span class="shop__kicker">New in, autumn</span>
            <span class="shop__title">Made for slow mornings</span>
          </div>
          <div class="grid">
            <div class="tile"><span class="tile__photo" data-photo="vase"></span><span class="tile__name">Stoneware vase</span><span class="tile__price">$68</span></div>
            <div class="tile"><span class="tile__photo" data-photo="throw"></span><span class="tile__name">Linen throw</span><span class="tile__price">$96</span></div>
            <div class="tile tile--third"><span class="tile__photo" data-photo="carafe"></span><span class="tile__name">Glass pitcher</span><span class="tile__price">$42</span></div>
          </div>
        </section>
        <div class="scrim" data-scrim></div>

        <!-- the side cart panel: it widens into the payment page -->
        <div class="drawer" data-drawer></div>

        <!-- the cart -->
        <section class="cart" data-cart aria-label="Your bag">
          <header class="cart__head" data-cart-in>
            <span class="cart__title">Your bag</span>
            <span class="cart__count">3 items</span>
            <span class="close" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M4.4 4.4l7.2 7.2M11.6 4.4l-7.2 7.2"/></svg></span>
          </header>
          <ul class="list" data-list>
            <li class="row" data-row>
              <div class="row__card" data-card>
                <div class="row__in" data-in>
                  <span class="row__photo" data-photo="vase"></span>
                  <span class="row__info"><span class="row__name">Stoneware vase</span><span class="row__meta">Ash glaze, 1 x $68.00</span></span>
                  <span class="row__price">$68.00</span>
                </div>
              </div>
            </li>
            <li class="row" data-row>
              <div class="row__card" data-card>
                <div class="row__in" data-in>
                  <span class="row__photo" data-photo="throw"></span>
                  <span class="row__info"><span class="row__name">Linen throw</span><span class="row__meta">Natural, 1 x $96.00</span></span>
                  <span class="row__price">$96.00</span>
                </div>
              </div>
            </li>
            <li class="row" data-row>
              <div class="row__card" data-card>
                <div class="row__in" data-in>
                  <span class="row__photo" data-photo="carafe"></span>
                  <span class="row__info"><span class="row__name">Glass pitcher</span><span class="row__meta">Clear, 1 x $42.00</span></span>
                  <span class="row__price">$42.00</span>
                </div>
              </div>
            </li>
          </ul>
          <footer class="cart__foot">
            <span class="cart__rule" data-cart-in></span>
            <div class="cart__sum"><span class="cart__label" data-cart-in>Subtotal</span><span class="slot slot--cart" data-slot-cart></span></div>
            <span class="cart__note" data-cart-in>Shipping and taxes calculated at checkout</span>
            <span class="cta-slot cta-slot--cart" data-cta-cart></span>
          </footer>
        </section>

        <!-- the payment page -->
        <section class="pay" data-pay aria-label="Checkout">
          <header class="pay__bar">
            <button class="back" type="button" data-back data-pay-in>
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M9.8 3.6 5.4 8l4.4 4.4"/></svg>
              <span>Back to cart</span>
            </button>
            <span class="brand brand--small" data-pay-in>Quillhouse</span>
            <span class="secure" data-pay-in>
              <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="3.6" y="7.2" width="8.8" height="6.4" rx="1.6"/><path d="M5.6 7.2V5.4a2.4 2.4 0 0 1 4.8 0v1.8"/></svg>
              Secure checkout
            </span>
          </header>

          <form class="form" autocomplete="off" onsubmit="return false">
            <div class="form__head" data-pay-in>
              <span class="form__title">Payment</span>
              <span class="form__sub">All transactions are secure and encrypted.</span>
            </div>
            <label class="field field--focus" data-pay-in data-focus>
              <span class="field__label">Card number</span>
              <span class="field__value">4242 4242 4242 4242<span class="caret" data-caret></span></span>
              <svg class="field__card" viewBox="0 0 30 20" aria-hidden="true"><rect x="0.6" y="0.6" width="28.8" height="18.8" rx="3.4"/><rect class="chip" x="4.4" y="6" width="6.4" height="5.2" rx="1.2"/><path d="M4.4 15h9"/></svg>
            </label>
            <div class="field-row">
              <label class="field" data-pay-in>
                <span class="field__label">Expiry</span>
                <span class="field__value">08 / 29</span>
              </label>
              <label class="field" data-pay-in>
                <span class="field__label">Security code</span>
                <span class="field__value">382</span>
              </label>
            </div>
            <label class="field" data-pay-in>
              <span class="field__label">Name on card</span>
              <span class="field__value">Mara Lindqvist</span>
            </label>
            <div class="save" data-pay-in>
              <span class="switch" data-switch><span class="switch__knob" data-knob></span></span>
              <span>Save card for faster checkout</span>
            </div>
            <span class="cta-slot cta-slot--pay" data-cta-pay></span>
          </form>

          <aside class="summary" data-summary>
            <span class="summary__bg" data-pay-in data-early></span>
            <div class="summary__head" data-pay-in data-early><span>Order summary</span><span class="summary__n">3 items</span></div>
            <div class="pile" data-pile></div>
            <div class="summary__lines">
              <div class="line" data-pay-in><span>Subtotal</span><span>$206.00</span></div>
              <div class="line" data-pay-in><span>Shipping</span><span>$8.00</span></div>
              <span class="summary__rule" data-pay-in data-early></span>
              <div class="line line--total"><span data-pay-in>Total</span><span class="slot slot--pay" data-slot-pay></span></div>
            </div>
          </aside>
        </section>

        <!-- the two pieces that fly between the pages -->
        <span class="total" data-total aria-live="polite"></span>
        <button class="cta" type="button" data-cta>
          <span class="cta__face" data-cta-face>
            <span class="cta__sheen" data-sheen></span>
            <span class="cta__labels">
              <span class="cta__a" data-cta-a>Checkout</span>
              <span class="cta__b" data-cta-b>Pay $214.00</span>
            </span>
          </span>
        </button>
      </div>
    </div>

    <!-- the drawn pointer of the walk on its own -->
    <svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.2 5.1 19l4-3.9 2.7 6 2.6-1.2-2.6-5.8 5.6-.3Z"/>
    </svg>
  </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/Flip.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 transition” 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 paper-coloured table, with the light of a window at the top left and a fine grain, sits the shop window of Quillhouse, a made-up homeware brand: behind, blurred and veiled, the page with ‘Made for slow mornings’ and the product photos; in front, the ‘Your bag’ side cart with three rows, three real photos: the small rough stoneware vase with dried flowers on a wooden table by a green window, the stack of folded natural linens and the clear glass pitcher on a pale grey ground, then ‘Subtotal $206.00’ and the terracotta ‘Checkout’ button. The drawn pointer reaches it, a light crosses the button and it presses: the panel widens to the left until it becomes the payment page while the shop behind recedes and disappears. The three rows fly to the top right and compact on top of each other: the vase stays in front, the linen and the pitcher slide under it, each a little narrower and higher, and the stack becomes the order summary; each row lands with a one pixel settle and the two behind dim. The total flies from the foot of the cart to the summary, grows and its digits roll from 206 to 214. The button stretches into the form and Checkout slides away to make room for ‘Pay $214.00’, while in come, staggered, the bar with ‘Back to cart’, the ‘Payment’ title, the card number with its lit edge and the blinking caret, expiry, code, name, and the ‘Save card’ switch that clicks on. The pointer passes over the stack and the rows behind lift like a fan to show themselves, then it presses ‘Back to cart’: the page folds back into the panel, the stack opens into the three rows, the total rolls back down to 206 and Pay turns back into Checkout. With a real mouse the cart rows rise a little, the button catches the light and the stack opens as you pass.

How it works

The rows move house, Flip makes the trip

The three rows, the total and the button are real elements that change parent: Flip.getState measures them, the is-pay class changes the page, the rows move from the cart list to the summary stack, the total and the button to their new places, and Flip.from carries them from the old place to the new one. Rows and button with scale: false (they change width without stretching the words), the total with scale: true, so it grows like a number.

The stack is just CSS

In the stack each row is absolute: the first in front with z-index 3, the second 9 pixels higher and 9 narrower on each side, the third twice that. Flip knows nothing about stacks: it measures where they end and gets there. The cart panel widens to the whole page with the same Flip, and the content of the rows behind fades as they arrive.

One element for Flip, the child for the rest

The li belongs to Flip, the card inside to the landing settle and the hover fan, the content to the fade: three transforms that never wipe each other. What only leaves or arrives on one page (the title, the fields, the summary background) is marked and fades in a stagger, never the whole folder, or the rows in flight would vanish with it.

The total rolls

Each digit is a column holding 0-9 twice: going up from 206 to 214 the 0 goes to 1 and the 6 rolls past 9 up to 14, then snaps back to 4 unseen; going down, the other way. The columns start from the right, with back.out for the overshoot.

The real photos

The vase, the linen and the pitcher are three real CC0 and public domain photos, saved as flat webp files next to the page (vaso.webp, plaid.webp, caraffa.webp): the script sets them as the background of the thumbnails and the shop photos from a single map, so whoever copies the demo changes three file names. The photos are wider than tall and the object is not always centred: each has its own background-size and background-position, with a span[data-photo] selector that outweighs the thumbnail classes. Behind, the veil and the blur of the shop stay CSS.

Values to change

NameFileDefaultWhat it changes
FLIP_TIMEscript.js1.05The seconds of the move from the cart to the payment page, and back.
STAGGERscript.js0.07The seconds between one row and the next as they stack.
STACK_GAPscript.js9How many pixels each row shows behind the first one, in the stack.
PEEKscript.js1.4How far the stack opens when hovered.
ROLL_TIMEscript.js0.95The seconds the total's digits take to roll.
FIELD_STAGGERscript.js0.07The seconds between one card field and the next as they come in.
HOLDscript.js1.6The pause before the drawn pointer starts its round again.
LOOPscript.jstrueThe drawn pointer repeats its round on its own.

Try them in the Playground

When to use it

In the step from the cart to the payment of an online shop, especially homeware, furniture, ceramics, textiles or handmade goods: when you want the buyer to see their things arrive in the summary instead of a hard page change. It also works for a booking (the nights and the extras becoming the summary) or for a subscription summary. The colours are --accent, --panel and --soft in the CSS.

On phones

The same animations at adapted sizes: when the box is taller than wide the window switches to its tall shape, 440 by 580, with the cart almost full width and, on the payment page, the summary on top with the stack on the left and the total on the right, above the card fields. Everything scales down to fit the box, height included. With a finger you press Checkout and Back to cart.

With reduced motion

No flights and no pointer: pressing Checkout the cart fades out and the payment page appears already in place, with the stack, the 214 total and Pay; Back to cart does the same the other way.

Pitfalls

  • With every row at the same zIndex during the flight the DOM order wins: the front row, arriving last, slides under the others and jumps to the front at the end. Without zIndex in Flip the stack's z-index (3, 2, 1) holds during the flight too.
  • Emptying the cart foot (the total and the button leave) makes it drop and the remaining words jump down: the places of the total and the button have a fixed height.
  • Hiding the whole folder of the payment page also hides the rows flying into it: only that page's own things fade, one by one.
  • A rule with a single attribute, [data-photo="vase"], weighs the same as .row__photo: written before it, the thumbnail's background-size: cover wipes it out. With the tag name in front (span[data-photo]) it weighs more and each photo's framing holds everywhere.

Libraries

GSAP 3.15.0, Flip 3.15.0, Fraunces (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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