6 interactive playgrounds

Motion Lab

Tune timing, origin, and spring physics on the controls themselves.

Tactile press feedback

Hold each button. Tune the duration and scale on the right.

Code & AI prompt
.press-stage { display: grid; gap: 9px; padding: 15px; }
.press-stage .lab-control-row { min-height: 64px; }
.press-default { transition: transform 420ms ease 110ms; }
.press-default:active { transform: scale(.9); }
.press-tuned { transition: transform var(--press-duration, 160ms) cubic-bezier(.23,1,.32,1); }
.press-tuned:active { transform: scale(var(--press-scale,.97)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms;
    transition-duration: .001ms;
  }
}

Origin-aware popover

Open from any corner. Turn on center origin to compare.

Code & AI prompt
.pop-stage { width: min(100%,360px); height: 132px; position: relative; }
.pop-trigger { position: absolute; z-index: 2; }
.pop-trigger[data-corner="tl"] { inset: 0 auto auto 0; }
.pop-trigger[data-corner="tr"] { inset: 0 0 auto auto; }
.pop-trigger[data-corner="bl"] { inset: auto auto 0 0; }
.pop-trigger[data-corner="br"] { inset: auto 0 0 auto; }
.pop-panel {
  position: absolute; inset: 35px auto auto 0; width: min(190px, 70%); padding: 7px 9px;
  background: var(--canvas); border-radius: 8px; box-shadow: var(--shadow); z-index: 1;
  transform-origin: var(--anchor-origin, center); opacity: 0; transform: scale(.95);
  pointer-events: none; visibility: hidden;
  transition: transform 160ms var(--ease-out), opacity 140ms, visibility 160ms;
  font-size: .77rem;
}
.pop-panel[data-side="right"] { right: 0; left: auto; }
.pop-panel[data-edge="bottom"] { top: auto; bottom: 35px; }
.pop-panel[data-open="true"] { opacity: 1; transform: scale(1); visibility: visible; }
.pop-stage[data-naive="true"] .pop-panel { transform-origin: center; }
.pop-mode { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; align-items: center; color: var(--body); white-space: nowrap; font-size: .74rem; }
.pop-mode input { accent-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms;
    transition-duration: .001ms;
  }
}

Blur-masked state morph

Save to see Idle, Saving, and Saved in one stable button.

Ready to save
Code & AI prompt
.morph-stage { align-content: center; gap: 10px; }
.morph-button { display: grid; min-width: 130px; }
.morph-button span { grid-area: 1/1; opacity: 0; filter: blur(2px); transform: translateY(3px); transition: opacity 140ms, filter 160ms, transform 160ms var(--ease-out); }
.morph-button[data-state="idle"] [data-label="idle"],
.morph-button[data-state="saving"] [data-label="saving"],
.morph-button[data-state="saved"] [data-label="saved"] { opacity: 1; filter: blur(0); transform: translateY(0); }
.morph-button[data-state="saved"] { background: #0759b4; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms;
    transition-duration: .001ms;
  }
}

Clip-path tabs and hold-to-delete

Switch tabs, then hold Delete for two seconds. Release to cancel.

Overview selectedHold for two seconds.
Code & AI prompt
.segmented-stage { align-content: center; gap: 11px; }
.clip-tabs { position: relative; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-radius: 8px; background: var(--canvas); border: 1px solid var(--line); }
.clip-tabs button,.clip-tabs-overlay span { min-width: 0; min-height: 38px; display: grid; place-items: center; padding: 5px 7px; border: 0; background: none; color: inherit; font-size: .78rem; position: relative; }
.clip-tabs button:focus-visible { z-index: 2; }
.clip-tabs-overlay {
  pointer-events: none; position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
  grid-column: 1/-1; background: var(--ink); color: var(--canvas);
  clip-path: inset(0 var(--clip-right,66.666%) 0 var(--clip-left,0%) round 7px);
  transition: clip-path 200ms var(--ease-in-out);
}
.hold-delete { isolation: isolate; overflow: hidden; position: relative; }
.hold-delete::before { position: absolute; inset: 0; content: ''; z-index: -1; background: var(--error-soft); transform: scaleX(var(--hold-progress, 0)); transform-origin: left; transition: transform 200ms var(--ease-out); }
.hold-delete[data-hold="true"]::before { transform: scaleX(1); transition: transform 2s linear; }
.hold-delete[data-deleted="true"] { color: var(--error); }
.hold-delete span { min-width: 11ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms;
    transition-duration: .001ms;
  }
}

Interruptible stacked toasts

Spawn several toasts, then hover or focus the stack to expand.

Code & AI prompt
.toast-stage { grid-template-rows: 1fr auto; gap: 7px; min-height: 158px; }
.toast-stack { position: relative; width: min(260px,100%); height: 124px; }
.toast-item {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 7px 2px 10px;
  background: var(--canvas); border-radius: 8px; box-shadow: var(--shadow);
  transform: translateY(calc(var(--layer) * -7px)) scale(calc(1 - var(--layer) * .045));
  transition: transform 300ms var(--ease-out), opacity 220ms var(--ease-out);
  font-size: .82rem;
}
.toast-item[data-leaving] { transform: translateY(14px) scale(.95); opacity: 0; pointer-events: none; }
@starting-style { .toast-item { transform: translateY(12px) scale(.95); opacity: 0; } }
.toast-stack:focus-within .toast-item { transform: translateY(calc(var(--layer) * -39px)); }
@media (hover: hover) and (pointer: fine) {
  .toast-stack:hover .toast-item { transform: translateY(calc(var(--layer) * -39px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms;
    transition-duration: .001ms;
  }
}

Spring curve playground

Drag the ball or tap Move to see the ball and card follow the same spring.

Code & AI prompt
.spring-stage { padding: 10px; display: grid; gap: 7px; }
.spring-rail { position: relative; height: 70px; overflow: hidden; border: 1px solid var(--line); background: var(--canvas); border-radius: 8px; }
.spring-rail::before { content: ''; position: absolute; left: 12px; right: 12px; top: 20px; border-top: 1px dashed var(--line-strong); }
.spring-ball { position: absolute; top: 6px; left: 5px; width: 28px; height: 28px; background: var(--ink); color: var(--canvas); border: 0; border-radius: 50%; touch-action: none; cursor: grab; transform: translateX(var(--spring-x,0px)); }
.spring-ball:active { cursor: grabbing; transform: translateX(var(--spring-x,0px)) scale(.97); }
.spring-card { position: absolute; top: 38px; left: 5px; display: grid; place-items: center; width: 66px; height: 24px; border: 1px solid var(--line); border-radius: 5px; background: var(--canvas-inset); color: var(--body); font: 500 .64rem var(--mono); transform: translateX(var(--spring-x,0px)); }
@media (prefers-reduced-motion: reduce) {
  .spring-ball:active { transform: translateX(var(--spring-x,0px)); }
}
.spring-curve { display: block; width: 100%; height: 43px; background: var(--canvas); border-radius: 6px; }
.spring-curve path { fill: none; stroke: var(--link); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spring-status { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.spring-status output { font: 500 .69rem var(--mono); color: var(--body); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms;
    transition-duration: .001ms;
  }
}