
Keep scrolling
Transitions, Scroll
Scroll inside the preview
The page of the Arc table lamp by Halvor, a made-up lighting studio: when the big Add to cart button is about to leave the screen it lifts off, hops and flies down to the bottom, where it becomes the sticky cart bar, with the frosted glass ground unrolling from the button and the thumbnail, the name, the price and the colour arriving one by one. Scrolling back up the bar folds and the button flies home. In the bar the colour is a filled swatch that rolls to the next one, and Add to cart draws a tick while the count in the bag rolls up. Minimal style.
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>
<!--
"Sticky cart bar" 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>Halvor, the Arc table lamp</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 product page of a made-up lighting studio, Halvor. When the big Add to cart button is about to leave the
screen it lifts off and flies down, becoming the sticky bar at the bottom with the thumbnail, the name, the price
and the colour; scrolling back up, the bar folds and the button flies home -->
<svg width="0" height="0" style="position:absolute" aria-hidden="true" focusable="false">
<defs>
<linearGradient id="g-paralume" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" style="stop-color: var(--l1)"/>
<stop offset="1" style="stop-color: var(--l3)"/>
</linearGradient>
<linearGradient id="g-base" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" style="stop-color: var(--l2)"/>
<stop offset=".55" style="stop-color: var(--l1)"/>
<stop offset="1" style="stop-color: var(--l3)"/>
</linearGradient>
<linearGradient id="g-luce" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffd9a0" stop-opacity=".55"/>
<stop offset="1" stop-color="#ffd9a0" stop-opacity="0"/>
</linearGradient>
<radialGradient id="g-pozza" cx=".5" cy=".5" r=".5">
<stop offset="0" stop-color="#ffcf8a" stop-opacity=".55"/>
<stop offset="1" stop-color="#ffcf8a" stop-opacity="0"/>
</radialGradient>
<radialGradient id="g-ombra" cx=".5" cy=".5" r=".5">
<stop offset="0" stop-color="#1d1b18" stop-opacity=".22"/>
<stop offset="1" stop-color="#1d1b18" stop-opacity="0"/>
</radialGradient>
<symbol id="lampada" viewBox="0 0 300 360">
<ellipse cx="150" cy="340" rx="128" ry="12" fill="url(#g-ombra)"/>
<path d="M196 132 L258 120 L300 340 L150 340 Z" fill="url(#g-luce)"/>
<ellipse cx="236" cy="340" rx="72" ry="9" fill="url(#g-pozza)"/>
<path d="M60 326 v8 a58 11 0 0 0 116 0 v-8" fill="var(--l3)"/>
<ellipse cx="118" cy="326" rx="58" ry="11" fill="url(#g-base)"/>
<ellipse cx="104" cy="323" rx="26" ry="3.2" fill="#fff" opacity=".28"/>
<path d="M118 326 V128" stroke="var(--l3)" stroke-width="6" stroke-linecap="round" fill="none"/>
<path d="M118 128 Q150 62 220 92" stroke="var(--l3)" stroke-width="6" stroke-linecap="round" fill="none"/>
<circle cx="118" cy="128" r="7" fill="var(--l2)"/>
<g transform="translate(224 102) rotate(24)">
<path d="M-46 4 C-46 -30 -22 -42 0 -42 C22 -42 46 -30 46 4 Z" fill="url(#g-paralume)"/>
<path d="M-36 -18 C-28 -32 -14 -37 -2 -37" stroke="#fff" stroke-opacity=".45" stroke-width="3" stroke-linecap="round" fill="none"/>
<rect x="-47" y="2" width="94" height="5" rx="2.5" fill="var(--l3)"/>
<ellipse cx="0" cy="8" rx="30" ry="3" fill="#fff6e4"/>
</g>
</symbol>
<symbol id="spunta" viewBox="0 0 16 16">
<path d="M3.2 8.6 L6.6 11.8 L12.8 4.6" pathLength="1" style="stroke-dasharray: 1; stroke-dashoffset: var(--d, 0)" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
</symbol>
</defs>
</svg>
<header class="testa">
<a class="marchio" href="#">Halvor</a>
<nav class="voci" aria-label="Shop">
<a href="#">Lighting</a><a href="#">Furniture</a><a href="#">Journal</a>
</nav>
<span class="borsa" aria-live="polite">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4.5 7h11l-1 9.5h-9z M7.5 7V5.6a2.5 2.5 0 0 1 5 0V7" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/></svg>
<span class="borsa__finestra"><span class="borsa__num" data-num>0</span></span>
<span class="solo-lettore" data-letto>0 items in your bag</span>
</span>
</header>
<main>
<section class="prodotto">
<figure class="scena" aria-hidden="true">
<svg class="scena__lampada" viewBox="0 0 300 360"><use href="#lampada"/></svg>
</figure>
<div class="info">
<p class="mono">Table lamp · Spun aluminium</p>
<h1 class="nome">Arc Table Lamp</h1>
<p class="prezzo">$148</p>
<div class="colori">
<p class="mono">Colour <span class="colore-nome" data-colore-nome>Clay</span></p>
<div class="campioni" role="radiogroup" aria-label="Colour">
<button class="campione" role="radio" aria-checked="true" data-campione="0" style="--c: #c46a43" aria-label="Clay"></button>
<button class="campione" role="radio" aria-checked="false" data-campione="1" style="--c: #9fae95" aria-label="Sage"></button>
<button class="campione" role="radio" aria-checked="false" data-campione="2" style="--c: #d9cbb4" aria-label="Oat"></button>
</div>
</div>
<button class="bottone bottone--grande" type="button" data-grande data-aggiungi>
<span class="bottone__fondo" aria-hidden="true"></span>
<span class="bottone__finestra">
<span class="bottone__riga" data-a>Add to cart</span>
<span class="bottone__riga bottone__riga--b" data-b aria-hidden="true"><svg class="spunta"><use href="#spunta"/></svg>Added</span>
</span>
</button>
<p class="nota">Free shipping · 30-day returns</p>
</div>
</section>
<section class="parte">
<p class="mono parte__titolo">Materials</p>
<ul class="righe">
<li><span>Shade</span><span>Spun aluminium, powder-coated</span></li>
<li><span>Arm</span><span>Brushed steel</span></li>
<li><span>Base</span><span>Cast iron, felt underside</span></li>
</ul>
</section>
<section class="parte">
<p class="mono parte__titolo">Dimensions</p>
<div class="misure">
<div><span class="misura">46 cm</span><span class="mono">Height</span></div>
<div><span class="misura">24 cm</span><span class="mono">Shade</span></div>
<div><span class="misura">2 m</span><span class="mono">Fabric cable</span></div>
</div>
</section>
<section class="parte">
<p class="mono parte__titolo">Reviews</p>
<blockquote class="voce">
<p>“Warm enough to read by, quiet enough to forget it is there.”</p>
<footer class="mono">A reader in Porto</footer>
</blockquote>
<blockquote class="voce">
<p>“The arm stays exactly where you leave it.”</p>
<footer class="mono">A studio in Ghent</footer>
</blockquote>
</section>
<footer class="piede mono">Halvor Studio · Lighting made slowly</footer>
</main>
<div class="barra" data-barra aria-hidden="true" inert>
<span class="barra__fondo" data-fondo aria-hidden="true"></span>
<span class="barra__pezzo barra__miniatura" data-pezzo aria-hidden="true"><svg viewBox="40 46 252 300"><use href="#lampada"/></svg></span>
<span class="barra__pezzo barra__testi" data-pezzo>
<span class="barra__nome">Arc Table Lamp</span>
<span class="barra__prezzo">$148</span>
</span>
<button class="barra__pezzo barra__campione" type="button" data-pezzo data-giro aria-label="Colour: Clay. Change colour">
<span class="barra__pila" data-pila>
<span style="--c: #c46a43"></span><span style="--c: #9fae95"></span><span style="--c: #d9cbb4"></span>
</span>
</button>
<button class="bottone bottone--barra" type="button" data-barra-bottone data-aggiungi>
<span class="bottone__fondo" aria-hidden="true"></span>
<span class="bottone__finestra">
<span class="bottone__riga" data-a>Add to cart</span>
<span class="bottone__riga bottone__riga--b" data-b aria-hidden="true"><svg class="spunta"><use href="#spunta"/></svg>Added</span>
</span>
</button>
</div>
<div class="volo" data-volo aria-hidden="true"><span>Add to cart</span></div>
<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="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.
56 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Sticky cart bar” from Animorio and fit it into my siteScrollTrigger.create on the big button, start «top 16%» (the TRIGGER value), onEnter goes to the bar and onLeaveBack back to the page. No timeline tied to the scroll: the gesture plays in time, so it reads even when scrolling fast.
A fixed element, the pill in flight, has a single value p from 0 to 1. Every frame the page button and the bar button are measured with getBoundingClientRect, and the pill's x, y, width and height are interpolated with power2.inOut; y lifts by ARC pixels with a sine, so the button hops before it falls. Both ends are measured live: if the page keeps scrolling or the window is resized, the pill still lands in the right place.
The bar's ground (frosted glass with backdrop-filter) starts at scaleX 0 with its origin on the right, where the button lands, and unrolls with expo.out halfway through the flight; the pieces arrive with back.out 0.07 seconds apart, starting from the last. The bar's real button switches on only when the pill in flight has landed, and the page button switches off as soon as it leaves: at any moment only one is visible.
The lamp's three colours are CSS variables (--l1, --l2, --l3) used by the gradients of the SVG symbol: GSAP takes them to the new colour in 0.6 seconds, and the big lamp and the thumbnail change together. The bar's swatch is a stack of three discs in a round window that slides by -100% per colour. The tick is a path with pathLength 1 whose stroke-dashoffset reads the --d variable, taken from 1 to 0.
| Name | File | Default | What it changes |
|---|---|---|---|
TRIGGER | script.js | 0.16 | Where the top of the big button must reach to become the bar (0.16 = 16% from the top). |
FLY | script.js | 0.8 | Seconds of the flight between the page and the bar. |
ARC | script.js | 26 | How far the button lifts before it falls, in pixels. |
UNROLL | script.js | 0.55 | Seconds of the bar's ground unrolling. |
STAGGER | script.js | 0.07 | Seconds between one piece of the bar and the next. |
ROLL | script.js | 0.42 | Seconds of the roll of labels, numbers and the swatch. |
ADDED | script.js | 1.6 | Seconds the button says Added. |
A product page in an online shop, when the buy button must stay within reach while scrolling through materials and reviews.
The same animations. The lamp sits on top, shorter (38vh), the big button is as wide as the column; in the bar the price hides and, below 380 pixels, the swatch too.
No flight: the page button fades out and the bar fades in, and the other way round going back up. The colour changes at once, the labels with a fade, and the bar does not show itself off.
GSAP 3.15.0, ScrollTrigger 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.7 KB; the libraries: GSAP + ScrollTrigger 45 KB.
Tested on 20 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.
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.