Drill-down — peek, then commit
Variant: Peek, then commit
Look before you leap. A 280ms hold on a row opens a preview out of that row; another 560ms of holding fills a bar — linear, because it is time, and an eased bar would lie about where the threshold is — and running it out commits. Let go early and the card closes back into the row in 160ms, faster than it opened, and nothing happened. Peek and page are the same surface: one full-frame card seen through a clip-path window that goes row, then peek, then frame, while its contents never move, so committing is the window opening rather than a new view arriving. The window’s first and last frame is a copy of the row itself, and the row and the contents swap in sequence rather than crossfading — two layers at half opacity in a window that small are just two sets of text. Going back closes it into the row it came from. The shadow is a filter on a wrapper so it follows the clip rather than the box. Use it on dense lists where opening something is costly to undo — evidence, messages, files — and a look is usually all anyone needed.
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>Drill-down — peek, then commit</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 — 8s, so 1% is 80ms. The hold threshold is 280ms, the peek
opens in 280ms and closes in 160ms, and committing takes another
560ms of holding — long enough that a peek is never a navigation
by accident. */
--cycle: 8s;
--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);
--ease-accent: cubic-bezier(0.32, 0.72, 0, 1);
/* The card is one full-frame surface seen through three windows: the
row it was pressed on, the peek, and the whole frame. Its contents
never move — the window does — so the peek and the committed view
are the same layout and nothing has to be read twice. */
--_r: calc(7px * var(--round));
--_in-row: inset(74px 12px calc(100% - 102px) 12px round var(--_r));
--_in-peek: inset(24px 16px 24px 16px round calc(11px * var(--round)));
--_in-full: inset(0 0 0 0 round calc(12px * var(--round)));
}
* {
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);
}
.frame {
position: relative;
width: min(300px, calc(100vw - 32px));
height: 182px;
border-radius: calc(12px * var(--round));
background: var(--paper);
border: 1px solid color-mix(in srgb, var(--slate) 9%, transparent);
overflow: hidden;
}
.under {
position: absolute;
inset: 0;
animation: dim var(--t) var(--ease-out) infinite;
}
.head {
position: absolute;
left: 12px;
top: 0;
height: 36px;
display: flex;
align-items: center;
font-size: 12px;
font-weight: 600;
letter-spacing: -0.005em;
}
.list {
position: absolute;
left: 12px;
right: 12px;
top: 40px;
display: grid;
gap: 6px;
}
.row {
position: relative;
display: flex;
align-items: center;
gap: 8px;
height: 28px;
padding: 0 10px;
border-radius: var(--_r);
border: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
font-size: 11px;
font-weight: 500;
font-variant-numeric: tabular-nums;
isolation: isolate;
}
.row .when {
font-weight: 400;
color: color-mix(in srgb, var(--slate) 50%, transparent);
}
.row .amt {
margin-left: auto;
}
.flag {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--rust);
}
/* The press tint is an overlay's opacity, not the row's background, so
the card's copy of the row can carry the same tint on the same clock. */
.held::before,
.face::before {
content: '';
position: absolute;
inset: -1px;
z-index: -1;
border-radius: inherit;
background: color-mix(in srgb, var(--clay) 10%, transparent);
opacity: 0;
animation: held var(--t) var(--ease-out) infinite;
}
/* The card's first and last frame is the row itself: a copy at the
row's exact rectangle, so the window that opens out of the row shows
the row, then crossfades to what is inside it. */
.face {
position: absolute;
left: 12px;
right: 12px;
top: 74px;
background: var(--paper);
animation: face var(--t) var(--ease-out) infinite;
}
.finger {
position: absolute;
left: 58%;
top: 88px;
width: 30px;
height: 30px;
margin: -15px 0 0 -15px;
border-radius: 50%;
background: color-mix(in srgb, var(--slate) 13%, transparent);
opacity: 0;
animation: finger var(--t) var(--ease-out) infinite;
}
/* The lift is a filter on a wrapper, so the shadow follows the clipped
shape on every frame instead of the full-size box the clip hides. */
.lift {
position: absolute;
inset: 0;
filter: drop-shadow(0 0 0.6px color-mix(in srgb, var(--slate) 30%, transparent))
drop-shadow(0 8px 18px color-mix(in srgb, var(--slate) 14%, transparent));
}
.card {
position: absolute;
inset: 0;
background: var(--paper);
clip-path: var(--_in-row);
opacity: 0;
animation:
window var(--t) var(--ease-accent) infinite,
card-op var(--t) var(--ease-out) infinite;
}
/* Committed, the page keeps the peek's 28px column rather than reflowing
to the frame's edge, so the back control aligns to it optically. */
.back {
position: absolute;
left: 23px;
top: 0;
height: 36px;
display: flex;
align-items: center;
gap: 2px;
font-size: 12px;
font-weight: 500;
color: color-mix(in srgb, var(--slate) 55%, transparent);
opacity: 0;
animation: committed var(--t) var(--ease-out) infinite;
}
.back svg {
width: 14px;
height: 14px;
display: block;
}
.inner {
position: absolute;
inset: 0;
animation: inner var(--t) var(--ease-out) infinite;
}
.body {
position: absolute;
left: 28px;
right: 28px;
top: 34px;
display: grid;
gap: 6px;
}
.title {
display: flex;
align-items: baseline;
gap: 8px;
height: 20px;
margin-bottom: 2px;
font-size: 13px;
font-weight: 600;
letter-spacing: -0.01em;
font-variant-numeric: tabular-nums;
}
.title span {
font-size: 11px;
font-weight: 400;
color: color-mix(in srgb, var(--slate) 50%, transparent);
}
.pay {
display: flex;
align-items: center;
gap: 8px;
height: 26px;
padding: 0 9px;
border-radius: calc(5px * var(--round));
border: 1px solid color-mix(in srgb, var(--rust) 30%, transparent);
font-size: 11px;
font-variant-numeric: tabular-nums;
}
.pay .amt {
margin-left: auto;
font-weight: 600;
color: var(--rust);
}
.hint {
position: absolute;
left: 28px;
right: 28px;
bottom: 34px;
display: grid;
gap: 5px;
font-size: 11px;
color: color-mix(in srgb, var(--slate) 48%, transparent);
animation: hint var(--t) var(--ease-out) infinite;
}
.bar {
height: 2px;
border-radius: 1px;
background: color-mix(in srgb, var(--slate) 9%, transparent);
overflow: hidden;
}
/* The fill is time held, so it runs linear: an eased bar would claim
the threshold is nearer or further than it is. */
.bar i {
display: block;
height: 100%;
background: var(--clay);
transform: scaleX(0);
transform-origin: 0 50%;
animation: fill var(--t) linear infinite;
}
/* 9.5–13%: the first hold opens a peek out of the row. 18–20%: let go
early — it closes back into the row in 160ms and nothing happened.
39.5–43%: hold again. 50–54.5%: held through the threshold, the same
surface opens to the frame and the peek is now the page. 80–84%:
back, into the row it came from. */
@keyframes window {
0%,
9.5% {
clip-path: var(--_in-row);
}
13%,
18% {
clip-path: var(--_in-peek);
}
20%,
39.5% {
clip-path: var(--_in-row);
}
43%,
50% {
clip-path: var(--_in-peek);
}
54.5%,
80% {
clip-path: var(--_in-full);
animation-timing-function: var(--ease-in-out);
}
84%,
100% {
clip-path: var(--_in-row);
}
}
/* Visible only while the window is larger than the row. It cuts on and
off at the row's rectangle, where the face makes it identical to the
row beneath, so the cut is invisible. */
@keyframes card-op {
0%,
9.5% {
opacity: 0;
}
9.6%,
20% {
opacity: 1;
}
20.1%,
39.5% {
opacity: 0;
}
39.6%,
84% {
opacity: 1;
}
84.1%,
100% {
opacity: 0;
}
}
@keyframes dim {
0%,
9.5% {
opacity: 1;
}
13%,
18% {
opacity: 0.4;
}
20%,
39.5% {
opacity: 1;
}
43%,
50% {
opacity: 0.4;
}
54.5%,
80% {
opacity: 0;
}
83%,
100% {
opacity: 1;
}
}
@keyframes held {
0%,
6% {
opacity: 0;
}
7.5%,
18% {
opacity: 1;
}
20%,
36% {
opacity: 0;
}
37.5%,
54.5% {
opacity: 1;
}
56%,
100% {
opacity: 0;
}
}
/* Sequenced, never crossfaded: inside a window this small, two layers
at half opacity are two sets of text on top of each other. The row
leaves in 80ms, then the contents arrive; closing runs it backwards. */
@keyframes face {
0%,
9.5% {
opacity: 1;
}
10.5%,
18.5% {
opacity: 0;
}
19.5%,
39.5% {
opacity: 1;
}
40.5%,
81.5% {
opacity: 0;
}
83%,
100% {
opacity: 1;
}
}
@keyframes inner {
0%,
10.5% {
opacity: 0;
}
12.5%,
17.5% {
opacity: 1;
}
18.5%,
40.5% {
opacity: 0;
}
42.5%,
80.5% {
opacity: 1;
}
81.5%,
100% {
opacity: 0;
}
}
@keyframes finger {
0%,
6% {
opacity: 0;
transform: scale(0.9);
}
7.5%,
18% {
opacity: 1;
transform: scale(1);
}
19.5%,
36% {
opacity: 0;
transform: scale(0.9);
}
37.5%,
50% {
opacity: 1;
transform: scale(1);
}
52%,
100% {
opacity: 0;
transform: scale(0.9);
}
}
/* 13–20% and 43–50%: the same 560ms of holding. The first is let go at
71%; the second runs out and commits. */
@keyframes fill {
0%,
13% {
transform: scaleX(0);
}
18% {
transform: scaleX(0.714);
}
20%,
43% {
transform: scaleX(0);
}
50%,
100% {
transform: scaleX(1);
}
}
@keyframes hint {
0%,
50% {
opacity: 1;
}
52%,
84% {
opacity: 0;
}
84.1%,
100% {
opacity: 1;
}
}
@keyframes committed {
0%,
54.5% {
opacity: 0;
}
58%,
79% {
opacity: 1;
}
80.5%,
100% {
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
/* The window stops travelling. The card fades in and out at the peek's
size, and the commit is a cut to the full frame — what the same UI
does with no animation — while the hold bar keeps filling, because
the threshold is information. Slowed to 1.5x. */
.card {
animation: card-still calc(var(--t) * 1.5) var(--ease-out) infinite;
}
.finger {
transform: none;
animation-name: finger-still;
}
.face {
display: none;
}
.inner {
animation: none;
}
.under,
.held::before,
.finger,
.back,
.hint,
.bar i {
animation-duration: calc(var(--t) * 1.5);
}
@keyframes card-still {
0%,
9.5% {
opacity: 0;
clip-path: var(--_in-peek);
}
12%,
18% {
opacity: 1;
clip-path: var(--_in-peek);
}
20%,
39.5% {
opacity: 0;
clip-path: var(--_in-peek);
}
42%,
50% {
opacity: 1;
clip-path: var(--_in-peek);
}
50.1%,
80% {
opacity: 1;
clip-path: var(--_in-full);
}
83%,
100% {
opacity: 0;
clip-path: var(--_in-full);
}
}
@keyframes finger-still {
0%,
6% {
opacity: 0;
}
7.5%,
18% {
opacity: 1;
}
19.5%,
36% {
opacity: 0;
}
37.5%,
50% {
opacity: 1;
}
52%,
100% {
opacity: 0;
}
}
}
</style>
</head>
<body>
<div
class="frame"
role="img"
aria-label="A list of invoices. Pressing and holding the flagged invoice opens a preview card out of its row, showing two identical payments, while a bar fills. Released early, the card closes back into the row. Held until the bar fills, the same card opens to the whole frame and becomes the page; going back closes it into the row."
>
<div class="under">
<div class="head">Halden Supply</div>
<div class="list">
<div class="row">
INV-4502<span class="when">Mar 09</span><span class="amt">$6,440</span>
</div>
<div class="row held">
INV-4471<span class="when">Mar 02</span><span class="flag"></span
><span class="amt">$5,960</span>
</div>
<div class="row">
INV-4519<span class="when">Mar 21</span><span class="amt">$1,210</span>
</div>
<div class="row">
INV-4533<span class="when">Mar 30</span><span class="amt">$2,750</span>
</div>
</div>
</div>
<div class="lift">
<div class="card">
<div class="row face">
INV-4471<span class="when">Mar 02</span><span class="flag"></span
><span class="amt">$5,960</span>
</div>
<div class="back">
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path
d="m15 5-7 7 7 7"
stroke="currentColor"
stroke-width="2.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
Halden Supply
</div>
<div class="inner">
<div class="body">
<div class="title">INV-4471 <span>2 payments · $5,960</span></div>
<div class="pay">Mar 02 · 09:14<span class="amt">$2,980</span></div>
<div class="pay">Mar 02 · 09:18<span class="amt">$2,980</span></div>
</div>
<div class="hint">
Keep holding to open
<span class="bar"><i></i></span>
</div>
</div>
</div>
</div>
<span class="finger"></span>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.