Skip to content
animorio
IT
All components

Delivery window picker

Pickers, Hover, PhysicsGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The delivery step in the checkout of an online grocery shop, dark and premium like a Dribbble shot: five days in a row with a sliding pill, and under them a thin histogram of how busy every hour is, mint for the quiet hours and amber for the peak. A glass lens two hours wide follows the finger on a spring, leans a little with its speed and lands on the hour with a pixel of bounce; the bars under it light up, the delivery fee rolls digit by digit and the tag says how busy the van will be. Another day reshapes the bars one after the other; Reserve books it with a light running round the button and then a check.

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>
<!--
  "Delivery window picker" 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 delivery window picker with the fee that follows demand</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 delivery window of a grocery app at checkout. Under the days, a thin histogram says how busy every hour is:
         the quiet hours are mint, the peak hours amber. A glass lens two hours wide sits on the bars; drag it and the
         bars under it light up, the fee rolls digit by digit and the tag says how busy the van will be -->
    <section class="slot" data-wrap aria-label="Delivery window">
      <span class="slot__glow" data-glow aria-hidden="true"></span>
      <div class="slot__card" data-card>
        <header class="slot__head">
          <div>
            <h2 class="slot__title">Delivery window</h2>
            <p class="slot__sub">Larder groceries · 14 items</p>
          </div>
          <span class="slot__chip">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1.8 4.6h7.4v6.2H1.8zM9.2 6.6h2.9l2.1 2.2v2H9.2"/><circle cx="4.6" cy="11.6" r="1.3"/><circle cx="11.6" cy="11.6" r="1.3"/></svg>
            Van
          </span>
        </header>

        <div class="slot__days" role="radiogroup" aria-label="Day" data-days>
          <span class="slot__pill" data-pill aria-hidden="true"></span>
        </div>

        <div class="slot__chart" data-chart>
          <div class="slot__bars" data-bars aria-hidden="true"></div>
          <div class="slot__lens" data-lens role="slider" tabindex="0" aria-label="Delivery window" aria-valuemin="0" aria-valuenow="0">
            <span class="slot__lens-label" data-label>2 – 4 pm</span>
            <span class="slot__lens-glass" aria-hidden="true"><span class="slot__lens-shine"></span></span>
            <span class="slot__lens-grip" aria-hidden="true"><i></i><i></i><i></i></span>
          </div>
        </div>
        <div class="slot__ticks" data-ticks aria-hidden="true"></div>

        <div class="slot__fee">
          <div class="slot__fee-left">
            <span class="slot__fee-name">Delivery fee</span>
            <span class="slot__tag" data-tag><span class="slot__tag-words" data-tag-words>Quiet hour · shared van</span></span>
          </div>
          <span class="slot__amount" data-amount aria-hidden="true"></span>
        </div>

        <button class="slot__btn" type="button" data-btn>
          <span class="slot__btn-beam" aria-hidden="true"></span>
          <span class="slot__btn-face" data-face>
            <span class="slot__btn-words" data-words>Reserve Thu, 2 – 4 pm</span>
            <svg class="slot__btn-icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="slot__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
            </svg>
          </span>
        </button>
      </div>
    </section>
    <p class="sr" aria-live="polite" data-live></p>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.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.

37 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 “Delivery window picker” 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 an almost black page with a low light from above and a very fine grain sits, alone, the delivery card of Larder, an online grocery shop: a dark slab with a one pixel edge that catches the light at the top and three soft shadows under it. At the top Delivery window, Larder groceries · 14 items and a chip with a drawn little van. Below, five days from Wed 4 to Sun 8 in a sunken row: a lighter pill slides onto the chosen day on a spring, stretching a little as it runs and settling. Further down fourteen thin bars, from 8 am to 10 pm, say how busy each hour is: mint when it is quiet, amber at the peak. On the bars sits a glass lens two hours wide, its edge catching the light, a three line grip under it and its label above, 2 – 4 pm. Dragged, it follows the finger on a spring, leans slightly with its speed, gives a little rubber past the ends and, let go, lands on the nearest hour with a pixel of bounce. The bars under it light up and rise by a hair, the others stay dim; at every new hour a reflection crosses the glass, the delivery fee rolls digit by digit between 0.99 and 5.99 dollars, and the tag changes colour and words: Quiet hour · shared van, Steady · 3 stops before you, Peak · fewer vans free; the light under the card takes the colour of the hour too. Picking another day reshapes the bars one after the other on a spring. Reserve Thu, 2 – 4 pm sinks under the finger and comes back with a bounce, says Holding your slot while a mint light runs round it, then turns mint, a check draws itself and it says Reserved. Until someone touches it, the card goes round by itself.

How it works

The lens on its spring

The lens position is a number in hours, with its velocity. On every gsap.ticker frame a spring with STIFFNESS and DAMPING (three small steps, the step capped at 1/30 s) pulls it towards the goal; dragging only moves the goal, letting go rounds it to the hour. The velocity gives a rotation of a few degrees, so the glass leans as it runs.

Covered bars

For every bar the script works out how much the lens covers it, from 0 to 1, using the decimal position: opacity and scale grow with the cover, so the bars light up as the glass slides over them. Height and colour come from that hour’s demand, the colour interpolated from --quiet to --peak; only what changed is written again.

The rolling fee

The fee is a sign, a digit, the point and two digits: each digit is a reel from 0 to 9 in a window one em tall, moved with yPercent and a back.out, with a delay that grows from left to right. The price is the average demand of the covered hours, mapped between LOW_FEE and HIGH_FEE in steps of FEE_STEP.

Days and pill

The pill moves to the day’s offsetLeft with a back.out while it stretches in proportion to the distance and settles with an elastic; the new day’s bars go to their height one after the other with a 28 millisecond stagger.

The booking

The button’s edge is a conic-gradient masked with mask-composite, turning by tweening the --a variable; then the fill turns mint, the icon widens and the check draws itself with strokeDashoffset. Moving the lens halfway cancels the booking.

Values to change

NameFileDefaultWhat it changes
DAYSscript.jsWed 4, Thu 5, Fri 6, Sat 7, Sun 8The days in the row: the weekday, a space and the number.
START_DAYscript.js1The day chosen at the start, counting from 0.
FIRST_HOURscript.js8The first hour of the histogram, on the 24 hour clock.
HOURSscript.js14How many hours the histogram shows.
WINDOWscript.js2How many hours the delivery window lasts: it is the width of the lens.
START_HOURscript.js14Where the window starts at the beginning, on the 24 hour clock.
LOW_FEEscript.js0.99The fee in the quietest window.
HIGH_FEEscript.js5.99The fee in the busiest window.
FEE_STEPscript.js0.5How much the fee changes at every step.
CURRENCYscript.js$The sign in front of the fee.
STIFFNESSscript.js260The spring pulling the lens: higher is quicker.
DAMPINGscript.js21Lower lets the lens pass the hour and come back.
SPRINGscript.js1How springy the digits, bars and pill are: 0.4 calm, 2 very bouncy.
BOOKINGscript.js1.2How many seconds the light runs round the button.
HOLDscript.js1.8How many seconds Reserved stays before the button goes back to rest.
AUTOscript.jstrueThe card goes round by itself until someone touches it.

Try them in the Playground

When to use it

In the checkout of an online grocery shop, a store with same day delivery, a restaurant that delivers or a pickup service: choosing when the courier comes while seeing at once what it costs and how busy that hour is, so whoever can picks the quiet hours.

On phones

On the phone the card is 92% of the screen wide and the heights of the bars and gaps also follow the window’s height; the lens is dragged with the finger (the bars area has touch-action: none, so the page does not scroll while you pull it) and a tap on a bar brings the lens there.

With reduced motion

Nothing moves: the lens, the pill and the bars go straight to their place with a short fade, the fee digits and the tag change in place, the light round the button fades in and out and the check appears.

Pitfalls

  • The lens followed the finger directly and, let go, stopped between two hours with the fee of one hour only: dragging only moves the spring’s goal and letting go rounds it, so the glass always lands on a whole hour and the fee is the one of the window you see.
  • With the bars switching on and off at once, the lens seemed to jump from hour to hour even when sliding slowly: each bar’s cover is worked out from the decimal position, so the light follows the glass continuously.
  • The hour labels at the edges, centred on their point, went outside the card on narrow phones: their position is kept 12 pixels inside the chart.
  • The loop started when the script was read, and the poster landed on different moments: it starts from the page’s load event.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 3 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 components