Pane — maximize and restore
Variant: Maximize
A pane in a four-up workspace growing from its own slot to fill the workspace, then shrinking back into exactly that slot. It is one element whose clip opens from the slot’s rectangle to the whole area, with its contents riding the same curve so the header stays pinned to the clip’s corner — a copy crossfaded in its place would ask the eye to match two rectangles, and restore would read as rebuilding the layout. Siblings dim as the pane passes over them, a transitional cue that they are being covered rather than removed. Extra detail fills the gained room only after the clip has landed and leaves 84ms before it closes. Opening takes 308ms and restoring 252ms: the way back is the cheaper decision. Use it for dashboards, editors and any tiled view where one tile can take focus.
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>Pane — maximize and restore</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 — 5.6s, so 1% is 56ms. Maximize travels for 308ms, restore
for 252ms: going back is the cheaper decision. */
--cycle: 5.6s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
--ease-accent: cubic-bezier(0.32, 0.72, 0, 1);
--_gap: 6px;
/* The slot's offset inside the workspace: half of it plus half a gap. */
--_slot: calc(50% + var(--_gap) / 2);
--_r: calc(8px * 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);
}
.ws {
position: relative;
width: clamp(250px, 64vw, 380px);
height: clamp(160px, 58vh, 220px);
padding: var(--_gap);
display: grid;
grid-template: 1fr 1fr / 1fr 1fr;
gap: var(--_gap);
border-radius: calc(12px * var(--round));
background: color-mix(in srgb, var(--oat) 34%, var(--ivory));
border: 1px solid color-mix(in srgb, var(--slate) 9%, transparent);
overflow: hidden;
}
.pane {
position: relative;
border-radius: var(--_r);
background: var(--paper);
border: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
padding: 8px 10px;
display: flex;
flex-direction: column;
gap: 6px;
overflow: hidden;
animation: recede var(--t) infinite;
}
.pane.slot {
visibility: hidden;
}
.name {
font-size: 11px;
font-weight: 600;
letter-spacing: -0.005em;
color: color-mix(in srgb, var(--slate) 70%, transparent);
white-space: nowrap;
}
.bar {
display: block;
height: 6px;
border-radius: 3px;
background: color-mix(in srgb, var(--slate) 12%, transparent);
}
/* The maximized pane is the slot's pane, not a copy that replaces it:
one element whose clip opens from the slot rectangle to the whole
workspace. Its contents ride a translate on the same curve so they
stay pinned to the clip's top-left corner — the header never slides
under the edge it lives against. */
/* A filter on the parent is drawn after the child's clip, so the hairline
and the lift follow the clipped shape at every frame instead of
belonging to a full-size box the clip cuts away. */
.lift {
position: absolute;
inset: var(--_gap);
filter: drop-shadow(0 0 0.6px color-mix(in srgb, var(--slate) 34%, transparent))
drop-shadow(0 4px 12px color-mix(in srgb, var(--slate) 9%, transparent));
}
.max {
position: absolute;
inset: 0;
border-radius: var(--_r);
background: var(--paper);
clip-path: inset(var(--_slot) 0 0 var(--_slot) round var(--_r));
animation: open var(--t) infinite;
}
.content {
position: absolute;
inset: 0;
padding: 8px 10px;
display: flex;
flex-direction: column;
gap: 6px;
transform: translate(var(--_slot), var(--_slot));
animation: pin var(--t) infinite;
}
.content .name {
color: var(--clay-d);
}
.spark path {
stroke: var(--clay);
}
.spark {
width: 92px;
height: 22px;
display: block;
overflow: visible;
}
/* The slot shares the workspace's right edge, so the control in the
top-right corner only ever travels vertically. */
.corner {
position: absolute;
inset: 0;
transform: translateY(var(--_slot));
animation: pin-y var(--t) infinite;
}
.btn {
position: absolute;
top: 5px;
right: 6px;
width: 20px;
height: 20px;
display: grid;
place-items: center;
color: color-mix(in srgb, var(--slate) 46%, transparent);
}
.btn svg {
width: 11px;
height: 11px;
display: block;
overflow: visible;
}
.btn .out {
animation: icon-out var(--t) infinite;
}
.btn .in {
opacity: 0;
animation: icon-in var(--t) infinite;
}
.tap {
position: absolute;
left: 50%;
top: 50%;
width: 26px;
height: 26px;
margin: -13px 0 0 -13px;
border-radius: 50%;
background: color-mix(in srgb, var(--slate) 12%, transparent);
opacity: 0;
animation: tap var(--t) infinite;
}
/* The room the pane gained is filled only after it has stopped growing.
Content that arrives during the open is read through a moving clip,
and on restore it leaves before the clip starts closing over it. */
.more {
position: absolute;
top: 36px;
right: 12px;
width: 40%;
display: grid;
gap: 7px;
}
.stat {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 6px;
font-size: 11px;
color: color-mix(in srgb, var(--slate) 56%, transparent);
border-bottom: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
padding-bottom: 4px;
opacity: 0;
animation: more var(--t) infinite;
}
.stat b {
font-weight: 600;
font-variant-numeric: tabular-nums;
color: var(--slate);
}
.stat:nth-child(2) {
animation-name: more-2;
}
.stat:nth-child(3) {
animation-name: more-3;
}
.wide {
position: absolute;
left: 10px;
bottom: 12px;
width: 48%;
display: grid;
gap: 6px;
opacity: 0;
animation: more-3 var(--t) infinite;
}
@keyframes open {
0%,
11% {
clip-path: inset(var(--_slot) 0 0 var(--_slot) round var(--_r));
animation-timing-function: var(--ease-accent);
}
16.5%,
59.5% {
clip-path: inset(0 0 0 0 round var(--_r));
animation-timing-function: var(--ease-accent);
}
64%,
100% {
clip-path: inset(var(--_slot) 0 0 var(--_slot) round var(--_r));
}
}
@keyframes pin {
0%,
11% {
transform: translate(var(--_slot), var(--_slot));
animation-timing-function: var(--ease-accent);
}
16.5%,
59.5% {
transform: translate(0, 0);
animation-timing-function: var(--ease-accent);
}
64%,
100% {
transform: translate(var(--_slot), var(--_slot));
}
}
@keyframes pin-y {
0%,
11% {
transform: translateY(var(--_slot));
animation-timing-function: var(--ease-accent);
}
16.5%,
59.5% {
transform: translateY(0);
animation-timing-function: var(--ease-accent);
}
64%,
100% {
transform: translateY(var(--_slot));
}
}
/* Siblings dim rather than vanish. They are still there, under the
maximized pane, and restore returns to them — fading them out
entirely would make "restore" read as rebuilding the workspace. */
@keyframes recede {
0%,
11% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
15%,
60.5% {
opacity: 0.45;
animation-timing-function: var(--ease-out);
}
65%,
100% {
opacity: 1;
}
}
@keyframes more {
0%,
16.5% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
20%,
58% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
59.5%,
100% {
opacity: 0;
}
}
@keyframes more-2 {
0%,
17.2% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
20.7%,
58% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
59.5%,
100% {
opacity: 0;
}
}
@keyframes more-3 {
0%,
17.9% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
21.4%,
58% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
59.5%,
100% {
opacity: 0;
}
}
/* The glyph swaps on the press frame: the control is the part under
the finger, so it is the part that answers first. */
@keyframes icon-out {
0%,
10.5% {
opacity: 1;
animation-timing-function: ease;
}
12%,
56.5% {
opacity: 0;
animation-timing-function: ease;
}
58%,
100% {
opacity: 1;
}
}
@keyframes icon-in {
0%,
10.5% {
opacity: 0;
animation-timing-function: ease;
}
12%,
56.5% {
opacity: 1;
animation-timing-function: ease;
}
58%,
100% {
opacity: 0;
}
}
@keyframes tap {
0%,
7% {
opacity: 0;
transform: scale(1.3);
animation-timing-function: var(--ease-out);
}
10%,
11% {
opacity: 1;
transform: scale(1);
animation-timing-function: var(--ease-out);
}
15%,
53% {
opacity: 0;
transform: scale(1.3);
animation-timing-function: var(--ease-out);
}
56%,
57% {
opacity: 1;
transform: scale(1);
animation-timing-function: var(--ease-out);
}
61%,
100% {
opacity: 0;
transform: scale(1.3);
}
}
@media (prefers-reduced-motion: reduce) {
/* The pane changes size on one frame, as it would with no animation
at all; the siblings' dimming and the extra content keep their
fades, so the sequence — dim, fill, empty, return — still reads. */
.max {
animation-name: open-step;
}
.content {
animation-name: pin-step;
}
.corner {
animation-name: pin-y-step;
}
.tap {
transform: none;
animation-name: tap-still;
}
.max,
.content,
.corner,
.tap,
.pane,
.stat,
.wide,
.btn .out,
.btn .in {
animation-duration: calc(var(--t) * 1.5);
}
@keyframes open-step {
0%,
12% {
clip-path: inset(var(--_slot) 0 0 var(--_slot) round var(--_r));
animation-timing-function: steps(1, end);
}
12.1%,
60% {
clip-path: inset(0 0 0 0 round var(--_r));
animation-timing-function: steps(1, end);
}
60.1%,
100% {
clip-path: inset(var(--_slot) 0 0 var(--_slot) round var(--_r));
}
}
@keyframes pin-step {
0%,
12% {
transform: translate(var(--_slot), var(--_slot));
animation-timing-function: steps(1, end);
}
12.1%,
60% {
transform: translate(0, 0);
animation-timing-function: steps(1, end);
}
60.1%,
100% {
transform: translate(var(--_slot), var(--_slot));
}
}
@keyframes pin-y-step {
0%,
12% {
transform: translateY(var(--_slot));
animation-timing-function: steps(1, end);
}
12.1%,
60% {
transform: translateY(0);
animation-timing-function: steps(1, end);
}
60.1%,
100% {
transform: translateY(var(--_slot));
}
}
@keyframes tap-still {
0%,
7% {
opacity: 0;
animation-timing-function: ease;
}
10%,
11% {
opacity: 1;
animation-timing-function: ease;
}
15%,
53% {
opacity: 0;
animation-timing-function: ease;
}
56%,
57% {
opacity: 1;
animation-timing-function: ease;
}
61%,
100% {
opacity: 0;
}
}
}
</style>
</head>
<body>
<div
class="ws"
role="img"
aria-label="A four-pane workspace where the metrics pane grows from its own slot to fill the workspace while the other panes dim, shows extra detail once it has room, then shrinks back exactly into its slot"
>
<div class="pane">
<span class="name">Logs</span>
<span class="bar" style="width: 82%"></span>
<span class="bar" style="width: 64%"></span>
<span class="bar" style="width: 74%"></span>
</div>
<div class="pane">
<span class="name">Trace</span>
<span class="bar" style="width: 48%"></span>
<span class="bar" style="width: 70%; margin-left: 12%"></span>
<span class="bar" style="width: 40%; margin-left: 24%"></span>
</div>
<div class="pane">
<span class="name">Preview</span>
<span class="bar" style="width: 90%; height: 22px; border-radius: var(--_r)"></span>
</div>
<div class="pane slot"></div>
<div class="lift">
<div class="max">
<div class="content">
<span class="name">Metrics</span>
<svg class="spark" viewBox="0 0 92 22" fill="none" aria-hidden="true">
<path
d="M1 17 12 14l10 4 11-9 10 3 11-8 10 6 11-5 15-2"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<span class="bar" style="width: 62px"></span>
</div>
<div class="more">
<div class="stat">p50 <b>41ms</b></div>
<div class="stat">p95 <b>118ms</b></div>
<div class="stat">errors <b>0.2%</b></div>
</div>
<div class="wide">
<span class="bar" style="width: 92%"></span>
<span class="bar" style="width: 70%"></span>
</div>
<div class="corner">
<span class="btn">
<span class="tap"></span>
<svg class="out" viewBox="0 0 12 12" fill="none" aria-hidden="true">
<path
d="M7 1h4v4M5 11H1V7M11 1 7.2 4.8M1 11l3.8-3.8"
stroke="currentColor"
stroke-width="1.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<svg
class="in"
viewBox="0 0 12 12"
fill="none"
aria-hidden="true"
style="position: absolute"
>
<path
d="M11 5H7V1M1 7h4v4M7 5l4-4M5 7l-4 4"
stroke="currentColor"
stroke-width="1.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</span>
</div>
</div>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.