

index.html
<!-- no pill in the markup:
the script adds it
behind the options -->
<div class="pinch"
aria-label="View">
<button
class="pinch-option" …
data-value="day"
aria-checked="true">
<!-- radio roles, roving
tabindex: from JS -->pinch.css
/* isolate: z-index -1 puts
the pill under the labels
but above the glass */
.pinch { …
isolation: isolate; …
.pinch-pill { …
left: 0; …
z-index: -1;
/* set by JS per frame */
will-change: transform,
width;pinch.js
// the edge in front gets
// the stiff spring, so the
// pill stretches, then the
// back edge catches up
const lead = movingRight
? R : L, trail = …
for (const [s, p] of …) {
const a = -p.k * (s.x -
s.target) - p.c * s.v;
s.v += a * dt;
s.x += s.v * dt;






