
Column shutter
Transitions
The cart of a made-up homeware shop, Kettlewood, in the clean style of today’s apps: pressing Checkout turns the same panel into the order summary. The product rows, with real photos of a stoneware mug, a candle and a notebook, shrink into thumbnails that fly into a column on the side, leaving a thin trail, the total slides to its place and grows, the fields come in staggered and Checkout stretches into Pay. Back to cart runs the way back.
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>
<!--
"Cart to summary" 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 cart that turns into the order summary</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 cart of a made-up home goods shop, Kettlewood: Checkout turns the same panel into the order summary,
the product rows (real CC0 photos) shrink into thumbnails in a column on the side, the total slides to its place and grows -->
<div class="fit" data-fit>
<section class="card" data-card aria-label="Kettlewood cart">
<header class="head">
<div class="head__a" data-head-a>
<span class="head__title">Your cart</span>
<span class="head__count">3 items</span>
</div>
<div class="head__b" data-head-b>
<button class="back" type="button" data-back>
<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="head__title">Checkout</span>
</div>
<span class="shop" aria-hidden="true">
<svg viewBox="0 0 16 16"><path d="M3 13.4V7.2L8 3l5 4.2v6.2Z"/><path d="M6.6 13.4V9.8h2.8v3.6"/></svg>
Kettlewood
</span>
</header>
<div class="body">
<aside class="side" data-side aria-hidden="true"></aside>
<ul class="list" data-list>
<li class="row" data-row>
<span class="slot" data-slot><span class="thumb thumb--mug" data-thumb><img src="mug.webp" alt="A pale grey stoneware mug on a wooden table" width="320" height="320" decoding="async"></span></span>
<span class="row__info"><span class="row__name">Stoneware mug</span><span class="row__meta">Ash, 2 x $18.00</span></span>
<span class="row__price">$36.00</span>
</li>
<li class="row" data-row>
<span class="slot" data-slot><span class="thumb thumb--candle" data-thumb><img src="candle.webp" alt="A white candle in a glass jar with a wooden wick, seen from above" width="320" height="320" decoding="async"></span></span>
<span class="row__info"><span class="row__name">Cedar candle</span><span class="row__meta">Large, 1 x $28.00</span></span>
<span class="row__price">$28.00</span>
</li>
<li class="row" data-row>
<span class="slot" data-slot><span class="thumb thumb--book" data-thumb><img src="notebook.webp" alt="An open dotted notebook with a pen on grey linen" width="320" height="320" decoding="async"></span></span>
<span class="row__info"><span class="row__name">Linen notebook</span><span class="row__meta">Dotted, 1 x $22.00</span></span>
<span class="row__price">$22.00</span>
</li>
</ul>
<form class="form" data-form autocomplete="off" onsubmit="return false">
<label class="field" data-field>
<span class="field__label">Email</span>
<span class="field__box"><span class="field__value" data-value>ines@hollowfield.co</span></span>
</label>
<label class="field" data-field>
<span class="field__label">Ship to</span>
<span class="field__box"><span class="field__value" data-value>14 Larch Lane, Bristol</span></span>
</label>
<label class="field" data-field>
<span class="field__label">Card</span>
<span class="field__box">
<svg class="field__card" viewBox="0 0 24 16" aria-hidden="true"><rect x="0.8" y="0.8" width="22.4" height="14.4" rx="2.4"/><path d="M0.8 5.2h22.4"/><path d="M4 11h5"/></svg>
<span class="field__value" data-value>4242 4242 4242 4242</span>
</span>
</label>
</form>
</div>
<div class="sum" data-sum>
<div class="sum__line sum__line--b" data-extra><span>Subtotal</span><span>$86.00</span></div>
<div class="sum__line sum__line--b" data-extra><span>Shipping</span><span>$7.40</span></div>
<div class="sum__total">
<span class="sum__label" data-sum-label><span class="sum__la">Subtotal</span><span class="sum__lb">Total</span></span>
<span class="total" data-total><span data-total-text>$86.00</span></span>
</div>
</div>
<button class="cta" type="button" data-cta>
<span class="cta__fill" data-cta-fill></span>
<span class="cta__label cta__label--a" data-cta-a>Checkout
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.4"/><path d="M8.6 4 12.6 8l-4 4"/></svg>
</span>
<span class="cta__label cta__label--b" data-cta-b>Pay $93.40</span>
<span class="cta__label cta__label--c" data-cta-c>
<svg viewBox="0 0 16 16" aria-hidden="true"><path data-check d="M3.4 8.4 6.6 11.4 12.6 4.8"/></svg>
Paid
</span>
</button>
</section>
</div>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.4-4.2 2.8 6.2 2.8-1.2-2.8-6.1h6.2Z"/></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>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.
47 values to change
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 “Cart to summary” from Animorio and fit it into my siteCart and summary are the same card: the is-b class changes the width, hides the rows and shows the side column and the fields. The thumbnails are not copied but really moved with appendChild into the column, and on the way back put back into their place in the row, a 44 pixel slot that always stays there.
Before the change Flip.getState reads the card, the three thumbnails, the total row and the button; then the page changes and Flip.from animates each from its old position to the new one with expo.inOut, nested because they live inside the widening card, absolute for the thumbnails that change parent, and a stagger only for them.
At take-off, for each thumbnail a box with a green border is placed in the card at its starting position, measured with getBoundingClientRect and divided by the container’s scale; the box fades and shrinks in seven tenths, staggered like the thumbnails.
The total row travels with Flip, but the figure inside grows with its own scale tween with back.out, from the right edge; halfway the figure leaves upwards and comes back in from below with the new amount.
When Pay is pressed the button sinks to 0.97 and comes back with an elastic; a green fill widens with scaleX from the left, the label leaves upwards and Paid arrives, with its check drawn by stroke-dashoffset.
| Name | File | Default | What it changes |
|---|---|---|---|
SHOP | script.js | 'Kettlewood' | The name of the made-up shop, written in the corner of the card. |
FLIP_TIME | script.js | 0.9 | The seconds in which the cart becomes the summary, and back. |
STAGGER | script.js | 0.06 | The seconds between one thumbnail and the next as they fly to the side. |
GROW | script.js | 1.45 | How much the total grows in the summary. |
TRAIL | script.js | 0.45 | How visible the trail left by the thumbnails is (0 means no trail). |
HOLD | script.js | 2.2 | The seconds Paid stays before the drawn pointer goes back to the cart. |
For the cart of an online shop that leads to the checkout without changing page: the buyer sees their products stay with them while the form arrives, and the total never disappears.
The same animation: the card is drawn in pixels and the container scales it down as needed, on width and height, so the open summary fits whole in the box.
No flight: the card fades, changes state and comes back; the payment shows Paid with its check at once, without the fill.
GSAP 3.15.0, Flip 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.2 KB; the libraries: GSAP + Flip 37 KB.
Tested on 6 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.