
The menu that opens from its button
Menus, Transitions, Text
Free
A farm shop’s basket with a goal, free delivery from a certain total: a bar fills towards it with a little bounce and, when it gets there, turns gold while a small van drives along it to the end; the quantities roll their figures, the prices count, a row dragged to the left goes away and the suggested product flies into the basket.
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>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The basket with a goal</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/nunito-sans@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the basket with a goal: a bar fills towards free delivery and a small van sets off when it gets there; the
quantities roll, the totals count, a row dragged aside goes away and a suggestion flies in -->
<section class="basket" aria-labelledby="basket-title" data-basket data-autoclic>
<header class="basket__head">
<h2 class="basket__title" id="basket-title">Your basket</h2>
<p class="basket__count" data-count></p>
</header>
<div class="goal" data-goal>
<p class="goal__text" aria-live="polite" data-goal-text></p>
<div class="goal__track" aria-hidden="true">
<span class="goal__fill" data-fill></span>
<svg class="goal__van" viewBox="0 0 40 26" data-van><path d="M3 5.5h20v13H3z"/><path d="M23 9.5h7.5l5 5v4H23z"/><circle cx="10" cy="20.5" r="3.2"/><circle cx="29" cy="20.5" r="3.2"/></svg>
</div>
</div>
<ul class="items" aria-label="Products" data-items></ul>
<div class="extra" data-extra>
<p class="extra__label">Goes well with</p>
<button class="extra__add" type="button" data-add></button>
</div>
<footer class="basket__foot">
<p class="basket__total"><span>Subtotal</span><strong data-total></strong></p>
<button class="basket__go" type="button" data-go>Checkout</button>
</footer>
<p class="sr" aria-live="polite" data-live></p>
</section>
</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.
36 values to change
With the Animorio connector, Claude Code takes it from here, guide included, and fits it into your project. Paste this request:
Take “The basket with a goal” from Animorio and fit it into my siteThe quantity changes with a small timeline: the old figure leaves upwards or downwards, depending on the way of the change (yPercent), in 0.12 seconds, and the new one comes in from the other side with back.out. The row’s price and the subtotal count with a tween on a plain object, rounded to 50 cents while they count.
The bar is an element scaled in width (scaleX) to the share of the goal reached, in FILL seconds with elastic.out: it may go a little past the mark, up to 102%, and come back. The subtotal instead counts with power3.out, never going past the real figure. Once FREE is reached, a class colours the bar and the figure gold.
The van sits on the tip of the bar; when the goal is reached a timeline takes it to the end in FILL seconds, rocking it with keyframes on y and on the rotation, and pops the word free with back.out. Under the goal it goes back to following the tip.
The row listens to pointer events: once the pointer has moved 6 pixels sideways it decides whether the gesture is horizontal (then it takes the pointer capture and the row follows the finger, only to the left) or vertical (then it leaves it to the page, which scrolls: touch-action pan-y). Let go past SWIPE of its width it leaves to the left and its height goes to zero; otherwise it comes back with back.out.
The suggestion’s drawing is copied into an element that flies to the new row, whose position is read again every frame because it is opening meanwhile: across with power2.inOut, down with back.in, so it makes an arc; once there, the real drawing bounces. The rows are reached with Tab and Delete takes them away, handing the focus to the first row left; a click from a script (the library’s preview) is a pretend shopper: one more oil, the jam, the jam dragged away, one oil less.
| Name | File | Default | What it changes |
|---|---|---|---|
FREE | script.js | 45 | The total from which delivery is free, in euros. |
ITEMS | script.js | [['Chestnut honey', 'Jar · 250 g', 9, 1, 'honey'], …] | The products in the basket: name, size, price, how many and drawing (honey, oil, pasta or jam). |
EXTRA | script.js | ['Fig jam', 'Jar · 220 g', 6, 1, 'jam'] | The product suggested, written the same way. |
SWIPE | script.js | 0.4 | How far a row must be dragged to go, as a share of its width. |
FILL | script.js | 0.9 | The seconds the bar takes to reach its new length, and the van to drive to the end. |
For the basket of an online shop or a farm shop, a restaurant order, a fundraiser with a target, any list with a total and a threshold to reach (free shipping, a discount, a gift).
The rows are dragged to the left with a finger; vertically the page scrolls as usual (touch-action pan-y), because the gesture is taken only when it is clearly sideways; taps on the buttons do not wait for a double tap (touch-action manipulation).
The figures change without rolling, the prices and the subtotal go straight to the new figure, the bar changes length at once and the van does not drive (it sits on the tip of the bar), rows disappear at once and the suggestion comes in without flying; no entrance.
GSAP 3.15.0, Nunito Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.6 KB; the libraries: GSAP 28 KB.
Tested on 3 October 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.
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.