
Column shutter
Transitions
The product page of a made-up shop, Penhallow, in the clean style of today’s apps: pressing Add to bag lifts a copy of the real photo of the steel bottle off the page, the side cart slides in from the right on a spring and the photo flies on an arc into the first row, where it lands with a small squash. The subtotal rolls digit by digit, the number on the bag jumps, the free shipping bar grows; closing the cart sends it back and the button returns to how it was.
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>
<!--
"Fly-to-cart photo" 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 product photo that flies into the side bag</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 product page of a made-up outdoor shop, Penhallow. Add to bag lifts a copy of the photo, the side bag
slides in from the right on a spring, the photo flies on an arc into the first row, the subtotal rolls and the
number on the bag jumps; closing the bag sends it back the way it came -->
<div class="fit" data-fit>
<section class="screen" data-screen aria-label="Penhallow shop">
<header class="bar">
<a class="brand" href="#" aria-label="Penhallow">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 18 9.5 7l4 6.5L16 10l5 8z"/><path d="M3 18h18"/></svg>
<span data-shop>Penhallow</span>
</a>
<nav class="links" aria-label="Sections"><span>Bottles</span><span>Packs</span><span>Camp</span></nav>
<button class="bag" type="button" aria-label="Open bag" data-bag>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5.5 8h13l-1 12h-11z"/><path d="M9 8V6.5a3 3 0 0 1 6 0V8"/></svg>
<span class="bag__count" data-badge><span class="roll" data-badge-n></span></span>
</button>
</header>
<div class="product">
<div class="photo" data-photo>
<div class="photo__art" data-art></div>
<span class="photo__tag">New size</span>
</div>
<div class="info">
<p class="info__kicker">Stainless steel</p>
<h1 class="info__name" data-name>Field bottle</h1>
<p class="info__price" data-price>$38</p>
<div class="swatches" role="radiogroup" aria-label="Size">
<button class="sw is-on" type="button" role="radio" aria-checked="true" data-sw="0"><span>750 ml</span></button>
<button class="sw" type="button" role="radio" aria-checked="false" data-sw="1"><span>500 ml</span></button>
</div>
<p class="info__colour">Size <b data-colour>750 ml</b> · brushed steel</p>
<button class="add" type="button" data-add>
<span class="add__fill" data-addfill></span>
<span class="add__label">
<span class="add__a" data-adda>Add to bag</span>
<span class="add__b" data-addb>
<svg viewBox="0 0 24 24" aria-hidden="true"><path data-check d="M5.5 12.5 10 17l8.5-9"/></svg>
Added
</span>
</span>
</button>
<p class="info__ship">Free shipping over $75</p>
</div>
</div>
<!-- the side bag -->
<div class="scrim" data-scrim></div>
<aside class="drawer" data-drawer aria-label="Your bag" aria-hidden="true">
<div class="drawer__head">
<p class="drawer__title">Your bag <span class="drawer__n"><span class="roll" data-items-n></span> <span data-items-word>item</span></span></p>
<button class="close" type="button" aria-label="Close bag" data-close>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 7l10 10M17 7 7 17"/></svg>
</button>
</div>
<div class="lines" data-lines>
<div class="line line--new" data-new>
<span class="line__thumb" data-slot></span>
<span class="line__text" data-newtext>
<span class="line__name" data-newname>Field bottle</span>
<span class="line__meta" data-newmeta>Steel · 750 ml</span>
<span class="line__qty"><span>Qty 1</span><button class="line__remove" type="button" data-remove>Remove</button></span>
</span>
<span class="line__price" data-newprice>$38.00</span>
</div>
<div class="line" data-old>
<span class="line__thumb line__thumb--cap"><img src="cappello.webp" alt="A navy cotton camp cap" width="448" height="512" decoding="async" draggable="false"></span>
<span class="line__text">
<span class="line__name">Cotton camp cap</span>
<span class="line__meta">Navy · One size</span>
<span class="line__qty"><span>Qty 1</span></span>
</span>
<span class="line__price">$24.00</span>
</div>
</div>
<div class="drawer__foot">
<div class="ship" data-shipbar>
<p class="ship__text" data-shiptext>$51.00 away from free shipping</p>
<span class="ship__track"><span class="ship__fill" data-shipfill></span></span>
</div>
<p class="sub"><span>Subtotal</span><span class="sub__v roll" data-sub></span></p>
<button class="checkout" type="button">Checkout</button>
</div>
</aside>
<!-- the copy of the photo that flies -->
<div class="flyer" aria-hidden="true" data-flyer><div class="flyer__art" data-flyart></div></div>
<!-- the drawn pointer of the autopilot -->
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.5v15.2l4.1-3.9 2.7 6.1 2.6-1.1-2.7-6h5.6z"/></svg>
</section>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.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.
44 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 “Fly-to-cart photo” from Animorio and fit it into my siteThe page is a 392 by 466 pixel screen inside a wrapper that GSAP centres and shrinks on the window’s width and height. Every position is read with getBoundingClientRect and divided by the scale, so the flight starts and lands in the screen’s own pixels even after a resize.
The bottle is a real CC0 photo in two crops of the same shot, one per size, as webp. The page, the flying copy and the row’s thumbnail use the same image with object-fit: cover and the same object-position, so when the copy lands and the thumbnail takes its place the framing does not jump. Both photos are loaded at the start, before they are needed.
The cart is an absolute panel on the right, moved out with xPercent 104. A timeline brings it to zero with back.out(1.05), a spring that goes a hair too far and comes back, while the scrim over the page darkens and the cart’s title, row and footer come in staggered from the right.
A copy of the photo is placed over the original at the same position. A single number goes from 0 to 1 with power2.inOut and on every frame computes a quadratic curve whose control point sits ARC pixels higher: position, size, corners and rotation blend between the photo and the first row’s thumbnail, read when the cart has almost stopped.
Every digit of the total and of the counts is a column from 0 to 9 inside a window one line tall. When the value changes GSAP moves with yPercent only the columns of the digits that change, from right to left, with a back.out that goes a little too far and settles.
| Name | File | Default | What it changes |
|---|---|---|---|
SHOP | script.js | 'Penhallow' | The name of the made-up shop, at the top left. |
OPEN | script.js | 0.62 | The seconds the cart takes to slide in from the right on its spring. |
FLY | script.js | 0.78 | The seconds of the photo’s flight to the cart’s first row. |
ARC | script.js | 70 | How far the flight’s arc rises above the straight line, in pixels. |
ROLL | script.js | 0.55 | The seconds the digits of the total and the count take to roll. |
ACCENT | script.js | '#2f6f4e' | The colour of the number on the bag, of the button once it has added and of the shipping bar. |
HOLD | script.js | 1.5 | The seconds the cart stays open before the drawn pointer moves on. |
For the product page of an online shop: whoever adds something sees where it went without leaving the page, checks the total and how much is left for free shipping, and goes back to browsing with one click.
The same animation with adapted sizes: the screen shrinks to the width and height of the box, the cart covers the right side as on desktop and a tap does everything a click does.
No flight and no springs: the cart fades in, the thumbnail is already in its row, the digits change in place and the button changes its label with a fade; the drawn pointer is not shown.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.9 KB; the libraries: GSAP 28 KB.
Tested on 5 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.