Skip to content
animorio
IT
All components

Habit day picker

Pickers, SVG, HoverGSAPMediumCompressed weight: Demo 7.0 KBGSAP 28 KBFreeDownload the zip

The day picker of a habit, alone on white in the premium style of product shots: seven days in pale rounds, and the chosen ones turn to ink. Two chosen days side by side weld together: a liquid neck forms between them and widens on a spring until they become one capsule, while the two lean towards each other and a light runs along the run. Taking out a day in the middle snaps the capsule and the two ends recoil. Above, the line rolls between «3 days a week», «Weekdays» and «Every day»; below, the bar of the longest run.

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>
<!--
  "Habit day 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 habit day picker with pills that weld into a run</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the day picker of a habit: seven real toggle buttons. Days chosen next to each other weld into one capsule,
         with a liquid neck that forms between them; taking out a day in the middle snaps the capsule in two -->
    <section class="pick" data-pick aria-labelledby="pick-title">
      <header class="pick__head">
        <div class="pick__habit">
          <svg class="pick__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.5 4.5c2.4-.9 4.6-.6 6.5.9 1.9-1.5 4.1-1.8 6.5-.9v10.6c-2.4-.9-4.6-.6-6.5.9-1.9-1.5-4.1-1.8-6.5-.9Z"/><path d="M10 5.4v10.4"/></svg>
          <span id="pick-title" class="pick__title">Read 20 pages</span>
        </div>
        <span class="pick__count" aria-live="polite"><span class="pick__countin" data-count>3 days a week</span></span>
      </header>

      <div class="days" data-days role="group" aria-label="Repeat on">
        <svg class="days__ink" data-ink aria-hidden="true">
          <defs>
            <filter id="weld" x="-20%" y="-60%" width="140%" height="220%" color-interpolation-filters="sRGB">
              <feGaussianBlur in="SourceGraphic" stdDeviation="4" result="soft" data-blur/>
              <feColorMatrix in="soft" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 24 -10" result="weld"/>
              <feDropShadow in="weld" dx="0" dy="3" stdDeviation="3" flood-color="#0b0b10" flood-opacity="0.22"/>
            </filter>
            <filter id="weld-mask" x="-20%" y="-60%" width="140%" height="220%" color-interpolation-filters="sRGB">
              <feGaussianBlur in="SourceGraphic" stdDeviation="4" data-blur/>
              <feColorMatrix mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 24 -10"/>
            </filter>
            <linearGradient id="sheen" x1="0" y1="0" x2="1" y2="0">
              <stop offset="0" stop-color="#fff" stop-opacity="0"/>
              <stop offset="0.5" stop-color="#fff" stop-opacity="0.32"/>
              <stop offset="1" stop-color="#fff" stop-opacity="0"/>
            </linearGradient>
            <linearGradient id="gloss" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" stop-color="#fff" stop-opacity="0.16"/>
              <stop offset="0.45" stop-color="#fff" stop-opacity="0"/>
            </linearGradient>
            <mask id="ink-mask" maskUnits="userSpaceOnUse"><g filter="url(#weld-mask)" fill="#fff" data-mask></g></mask>
          </defs>
          <g class="days__wells" data-wells></g>
          <g filter="url(#weld)" class="days__blobs" data-blobs></g>
          <rect class="days__gloss" data-gloss fill="url(#gloss)" mask="url(#ink-mask)"/>
          <rect class="days__sheen" data-sheen fill="url(#sheen)" mask="url(#ink-mask)"/>
        </svg>
        <button class="day" type="button" aria-pressed="false" aria-label="Monday" data-day>M</button>
        <button class="day" type="button" aria-pressed="false" aria-label="Tuesday" data-day>T</button>
        <button class="day" type="button" aria-pressed="false" aria-label="Wednesday" data-day>W</button>
        <button class="day" type="button" aria-pressed="false" aria-label="Thursday" data-day>T</button>
        <button class="day" type="button" aria-pressed="false" aria-label="Friday" data-day>F</button>
        <button class="day" type="button" aria-pressed="false" aria-label="Saturday" data-day>S</button>
        <button class="day" type="button" aria-pressed="false" aria-label="Sunday" data-day>S</button>
      </div>

      <footer class="pick__foot">
        <span class="run">
          <span class="run__label" data-runlabel>Longest run</span>
          <span class="run__track"><span class="run__fill" data-runfill></span></span>
          <span class="run__value"><span class="run__valuein" data-runvalue>1 day</span></span>
        </span>
        <span class="pick__today"><span class="pick__todaymark"></span>Today, Thu</span>
      </footer>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </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.

28 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 “Habit day 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 a white background there is only the picker: at the top a book drawn in a thin line and Read 20 pages, on the right how often, in grey; below, seven rounds for the days from Monday to Sunday, pale for the days not chosen with a grey letter, ink for the chosen ones with a white letter and a thread of light on top; under Thursday a short green bar says it is today. Touching a day the round squashes a little, then the ink rises with a bounce; if a chosen day is already next to it, a liquid neck grows between the two and widens until they are one capsule, the two lean towards each other and settle back, and a light runs along the run. Taking out a day in the middle the neck thins and tears, that day’s ink goes and the two ends recoil by a hair. At the top the line rolls: 3 days a week, Weekdays, Weekends, Every day; at the bottom Longest run, a little green bar that stretches on a spring and how many days in a row.

How it works

Seven real buttons

The days are seven buttons with aria-pressed: keyboards, screen readers and forms work by themselves, and the arrow keys move the focus from day to day. The drawing sits in an svg under them that takes no pointer.

The weld

For each chosen day there is an ink circle, and between two neighbouring days a rectangle as tall as the circle times a value t from 0 to 1. They all go through one filter: an feGaussianBlur and an feColorMatrix that sharpens the alpha (24, −10). Where two shapes are close the blurred white adds up and becomes solid: that is the liquid neck, which forms by itself as t rises with elastic.out.

The ends recoil

When two days weld they lean LEAN pixels towards each other and come back to zero on an elastic; when the capsule snaps the bridge drops with power3.in and the ends left behind jump away and come back. It is a dx offset on the circle’s centre, read on every frame.

Light and gloss

A mask repeats the same shapes through the filter without the shadow: through it pass a still gloss on top and a band of light that runs along a run that has just welded. The shadow under the capsule is an feDropShadow inside the same filter.

The words

The line at the top comes from the shape of the week (Weekdays, Weekends, Every day or the number) and rolls up or down as the days grow or shrink; the longest run is counted walking the seven days and stretches the bar on a spring.

Values to change

NameFileDefaultWhat it changes
STARTscript.js[0, 2, 4]The days chosen when the page opens (0 is Monday).
TODAYscript.js3Which day is today, marked with the short bar.
WELD_TIMEscript.js0.75The seconds of the neck forming between two days.
SPRINGscript.js1How springy the capsules are.
LEANscript.js2.5How many pixels the days lean when they weld and recoil when they snap.
NECKscript.js4How soft and liquid the neck between two days is.
--inkstyle.css#16161bThe colour of the capsules.
--accentstyle.css#2f7d62The green of the run and of today.

Try them in the Playground

When to use it

In habit, workout, meditation and study apps, in repeating reminders, in the days of a class or a subscription, in the delivery days of a grocery service: wherever you pick days of the week and it matters to see how many are in a row.

On phones

The rounds are sized on the screen width between 34 and 46 pixels, so the row fits a 320 phone; on touch the day squashes and is chosen, and the Today label goes below 380 pixels.

With reduced motion

No bounces, leaning or running light: the ink and the necks fade in and out, the words change with a fade. The drawn pointer does not show.

Pitfalls

  • The weld filter also blurs the outer edge: the svg reaches sixteen pixels past each side and the filter region is larger than the shape, or the capsule and its shadow get cut straight.
  • The gloss and the light go through a mask with the same shapes and the same filter but no shadow: with the shadow the mask would be wider than the capsule.
  • The centres are measured again after the font loads and on every resize, because the rounds are sized on the window width.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 14 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