Affinity — group by
Variant: Group by
Five interview notes, in the order they were taken, regrouped by theme — and grouping is two facts, so it gets two beats. First the sort: every row that changes slot crosses in one shared 448ms ease-in-out window, the down-movers riding above, because the order arrives whole. Then, 128ms later, the seam: the second run steps down by exactly one header’s height in 256ms, and the boundary between the themes exists as space before anything names it. Only then does "Onboarding" fade into the slot the seam opened. A header that arrives while a row still occupies its slot either paints over the row or gets painted over by it. The top label hands from "All notes" to "Export" with a 32ms gap, sequenced so the two names never sit at half opacity on the same frame, and never long enough to leave the list unnamed. Undo runs the same beats backwards: the header leaves, the seam closes, then the order dissolves. The dots carry the theme from the first frame, so the regroup confirms what colour already said. Reach for it on group-by toggles, swimlanes and any list that can be viewed flat or by category.
The source
A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Affinity — group by</title>
<style>
:root {
/* Neutrals — fixed, never remixed. */
--ivory: #faf9f5;
--paper: #ffffff;
--oat: #e3dacc;
--slate: #141413;
/* Knobs — the remix API. A knob exists iff declared here and used below. */
--hue: 38.8;
--lift: 0;
--chroma: 1;
--round: 1;
--speed: 1;
/* Accents — derived from the knobs with the family's offsets baked in,
so one hue roll moves them together. Defaults reproduce the original hex. */
--clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
--clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
--olive: oklch(
calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
);
--rust: oklch(
calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
);
/* Clock — 6.4s. A 448ms sort, a 128ms beat, a 256ms seam; the second
header arrives only once the seam has opened its slot. */
--cycle: 6.4s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
/* Row pitch — row plus gap, so every travel lands in a slot. */
--_p: 26px;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
background: var(--ivory);
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
color: var(--slate);
}
.board {
position: relative;
width: min(248px, 86vw);
height: 176px;
}
.hdr {
position: absolute;
left: 2px;
right: 0;
height: 20px;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.02em;
color: color-mix(in srgb, var(--slate) 62%, transparent);
}
.hdr > span {
position: absolute;
inset: 0;
display: flex;
align-items: center;
gap: 6px;
}
.count {
font-weight: 500;
font-variant-numeric: tabular-nums;
color: color-mix(in srgb, var(--slate) 42%, transparent);
}
.h-top {
top: 0;
}
.h-onb {
top: calc(4 * var(--_p) + 2px);
opacity: 0;
animation: hdr-late var(--t) infinite;
}
.h-all {
animation: lbl-out var(--t) infinite;
}
.h-exp {
opacity: 0;
animation: lbl-in var(--t) infinite;
}
/* A 2px ivory keyline around every row, so two rows crossing mid-flight
read as passing rather than merging. */
.row {
position: absolute;
left: 0;
right: 0;
height: 22px;
display: flex;
align-items: center;
gap: 7px;
padding: 0 8px;
font-size: 12px;
white-space: nowrap;
background: var(--paper);
border: 1px solid color-mix(in srgb, var(--slate) 10%, transparent);
border-radius: calc(5px * var(--round));
box-shadow: 0 0 0 2px var(--ivory);
}
.dot {
flex: none;
width: 6px;
height: 6px;
border-radius: 50%;
}
.e .dot {
background: var(--clay);
}
.o .dot {
background: var(--olive);
}
/* Flat order is the order the notes were taken in. Each row carries the
distance to its slot; the Onboarding pair carry a second one for the seam. */
.r1 {
top: 22px;
}
.r2 {
top: calc(22px + var(--_p));
--_dy: calc(2 * var(--_p));
--_dy2: calc(3 * var(--_p) + 2px);
}
.r3 {
top: calc(22px + 2 * var(--_p));
--_dy: calc(-1 * var(--_p));
}
.r4 {
top: calc(22px + 3 * var(--_p));
--_dy: var(--_p);
--_dy2: calc(2 * var(--_p) + 2px);
}
.r5 {
top: calc(22px + 4 * var(--_p));
--_dy: calc(-2 * var(--_p));
}
/* The rows travelling down ride above the ones travelling up — they
cross the longer distance, so theirs is the path worth keeping whole. */
.r2,
.r4 {
z-index: 2;
}
.r3,
.r5 {
animation: regroup var(--t) infinite;
}
.r2,
.r4 {
animation: regroup-part var(--t) infinite;
}
/* Two beats, because grouping is two facts. First the sort: every row
that changes slot crosses in one shared 448ms window, so the runs
form as a single decision. Then, 128ms later, the seam: the second
run steps down by one header's height in 256ms, and the boundary
between the themes opens as space before it is ever named. Undoing
it runs the same beats backwards — the seam closes, then the order
dissolves. */
@keyframes regroup {
0%,
14% {
translate: 0 0;
animation-timing-function: var(--ease-in-out);
}
21%,
65% {
translate: 0 var(--_dy);
animation-timing-function: var(--ease-in-out);
}
72%,
100% {
translate: 0 0;
}
}
@keyframes regroup-part {
0%,
14% {
translate: 0 0;
animation-timing-function: var(--ease-in-out);
}
21%,
23% {
translate: 0 var(--_dy);
animation-timing-function: var(--ease-in-out);
}
27%,
60% {
translate: 0 var(--_dy2);
animation-timing-function: var(--ease-in-out);
}
64%,
65% {
translate: 0 var(--_dy);
animation-timing-function: var(--ease-in-out);
}
72%,
100% {
translate: 0 0;
}
}
/* "All notes" names the list until the sort lands; "Export" takes over
32ms later, as the seam starts to open. Old out before new in, never
at half opacity together, and never long without a name. */
@keyframes lbl-out {
0%,
19.5% {
opacity: 1;
translate: 0 0;
animation-timing-function: var(--ease-out);
}
21.5%,
60.5% {
opacity: 0;
translate: 0 -3px;
animation-timing-function: var(--ease-out);
}
63.5%,
100% {
opacity: 1;
translate: 0 0;
}
}
@keyframes lbl-in {
0%,
22% {
opacity: 0;
translate: 0 3px;
animation-timing-function: var(--ease-out);
}
25%,
58% {
opacity: 1;
translate: 0 0;
animation-timing-function: var(--ease-out);
}
60%,
100% {
opacity: 0;
translate: 0 3px;
}
}
/* The second header's slot is occupied until the seam opens, so it
arrives into space that already exists — and leaves before the seam
closes on it. */
@keyframes hdr-late {
0%,
26.5% {
opacity: 0;
translate: 0 3px;
animation-timing-function: var(--ease-out);
}
30%,
58% {
opacity: 1;
translate: 0 0;
animation-timing-function: var(--ease-out);
}
60%,
100% {
opacity: 0;
translate: 0 3px;
}
}
@media (prefers-reduced-motion: reduce) {
/* The rows change slot on a single frame — the grouping is the
content, the travel was the explanation — and the headers keep
their fades without the 3px drift, on a slower loop. */
.r3,
.r5 {
animation-name: regroup-step;
}
.r2,
.r4 {
animation-name: regroup-part-step;
}
.hdr > span,
.h-onb {
translate: none !important;
}
.r2,
.r3,
.r4,
.r5,
.h-all,
.h-exp,
.h-onb {
animation-duration: calc(var(--t) * 1.5);
}
@keyframes regroup-step {
0%,
14% {
translate: 0 0;
animation-timing-function: steps(1, end);
}
21%,
65% {
translate: 0 var(--_dy);
animation-timing-function: steps(1, end);
}
72%,
100% {
translate: 0 0;
}
}
@keyframes regroup-part-step {
0%,
14% {
translate: 0 0;
animation-timing-function: steps(1, end);
}
21%,
23% {
translate: 0 var(--_dy);
animation-timing-function: steps(1, end);
}
27%,
60% {
translate: 0 var(--_dy2);
animation-timing-function: steps(1, end);
}
64%,
65% {
translate: 0 var(--_dy);
animation-timing-function: steps(1, end);
}
72%,
100% {
translate: 0 0;
}
}
}
</style>
</head>
<body>
<div
class="board"
role="img"
aria-label="Five research notes in the order they were taken regroup by theme: sorting into two runs in one shared motion, then a seam opens between the runs and the second section header arrives in it"
>
<div class="hdr h-top">
<span class="h-all">All notes <span class="count">5</span></span>
<span class="h-exp"
><i class="dot" style="background: var(--clay)"></i>Export
<span class="count">3</span></span
>
</div>
<div class="hdr h-onb">
<span
><i class="dot" style="background: var(--olive)"></i>Onboarding
<span class="count">2</span></span
>
</div>
<div class="row e r1"><i class="dot"></i>Couldn’t find export</div>
<div class="row o r2"><i class="dot"></i>Skipped the tour</div>
<div class="row e r3"><i class="dot"></i>Wanted CSV, got PDF</div>
<div class="row o r4"><i class="dot"></i>Invite step confused</div>
<div class="row e r5"><i class="dot"></i>Exported twice to check</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.