Wizard — advance a step
Variant: Advance
The baseline move for a multi-step form: Next, and the step slides away as the next one crosses in. Steps are siblings in a sequence, not levels in a hierarchy, so the outgoing panel leaves by the full width the incoming one covers — a conveyor, not a stack. The rail is the content’s shadow: fill, current ring and panels share one 320ms ease-in-out, because a fill that lands before the panel claims progress the screen has not shown, and one that lands after looks like it is catching up. "Where you are" is its own element, a ring that travels, so the eye follows it instead of hunting for which dot lit up; the destination edges clay as the ring sets off for it. The step is marked done on release of Next, the moment of commitment, so its tick is already there as the ring leaves. Back is absent on step one rather than disabled — there is nowhere for it to go. Under reduced motion the panels fade out and then in, and the rail keeps its fill and its one-gap ring move.
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>Wizard — advance a step</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: two advances and a reset. 1% of the cycle is 64ms, so
a press is 1.5% (96ms) and a step's travel is 5% (320ms). */
--cycle: 6.4s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
/* The travel curve. Panel, rail fill and current ring all ride it. */
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
/* One step along the rail: four stops, three gaps. */
--_gap: calc(100cqw / 3);
}
* {
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 {
width: clamp(232px, 82vw, 300px);
padding: 14px;
display: grid;
gap: 12px;
border-radius: calc(12px * var(--round));
background: var(--paper);
border: 1px solid color-mix(in srgb, var(--slate) 10%, transparent);
}
/* Everything that changes lives in .body, so the reset can hide all of
it in one fade without the frame itself blinking. */
.body {
display: grid;
gap: 12px;
animation: reset var(--t) infinite;
}
/* ── The rail ─────────────────────────────────────────────────────── */
.rail {
position: relative;
height: 20px;
margin: 0 10px;
container-type: inline-size;
}
.track,
.fill {
position: absolute;
left: 0;
right: 0;
top: 9px;
height: 2px;
border-radius: 1px;
background: var(--oat);
}
.fill {
background: var(--clay);
transform-origin: left center;
transform: scaleX(0);
animation: fill var(--t) infinite;
}
.dot {
position: absolute;
left: -6px;
top: 4px;
width: 12px;
height: 12px;
display: grid;
place-items: center;
border-radius: 50%;
background: var(--paper);
border: 2px solid var(--oat);
color: var(--paper);
transform: translateX(calc(var(--_i) * var(--_gap)));
}
.dot svg {
width: 8px;
height: 8px;
opacity: 0;
transform: scale(0.6);
}
.d1 {
--_i: 0;
animation: done-1 var(--t) infinite;
}
.d1 svg {
animation: tick-1 var(--t) infinite;
}
.d2 {
--_i: 1;
animation: done-2 var(--t) infinite;
}
.d2 svg {
animation: tick-2 var(--t) infinite;
}
.d3 {
--_i: 2;
animation: arrive-3 var(--t) infinite;
}
.d4 {
--_i: 3;
}
/* Drawn under the dots on a paper fill, so the track stops at its edge
instead of running through the gap to the dot inside.
"Where you are" is its own element, not a dot state. It travels, so
the eye can follow it — a current marker that blinks off one dot and
on at the next makes you look for it. */
.ring {
position: absolute;
left: -10px;
top: 0;
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid var(--clay);
background: var(--paper);
animation: ring var(--t) infinite;
}
/* ── The panels ───────────────────────────────────────────────────── */
.stage {
position: relative;
height: 96px;
overflow: hidden;
}
.panel {
position: absolute;
inset: 0;
display: grid;
gap: 7px;
align-content: start;
transform: translateX(100%);
}
.p1 {
transform: translateX(0);
animation: p1 var(--t) infinite;
}
.p2 {
animation: p2 var(--t) infinite;
}
.p3 {
animation: p3 var(--t) infinite;
}
.h {
font-size: 13px;
font-weight: 600;
letter-spacing: -0.01em;
margin-bottom: 2px;
}
.input {
height: 24px;
border-radius: calc(6px * var(--round));
border: 1px solid var(--oat);
display: flex;
align-items: center;
padding: 0 8px;
}
.input i {
display: block;
height: 6px;
border-radius: 3px;
background: color-mix(in srgb, var(--slate) 22%, transparent);
}
.opt {
height: 18px;
display: flex;
align-items: center;
gap: 8px;
}
.opt b {
width: 12px;
height: 12px;
flex: none;
border-radius: 50%;
border: 2px solid var(--oat);
}
.opt.on b {
border: 4px solid var(--clay);
}
.opt i,
.row i {
display: block;
height: 6px;
border-radius: 3px;
background: var(--oat);
}
.row {
height: 22px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid color-mix(in srgb, var(--slate) 7%, transparent);
}
.sw {
width: 22px;
height: 12px;
border-radius: 999px;
background: var(--oat);
position: relative;
}
.sw::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--paper);
}
.sw.on {
background: var(--olive);
}
.sw.on::after {
left: 12px;
}
/* ── Footer ───────────────────────────────────────────────────────── */
.foot {
display: flex;
justify-content: space-between;
align-items: center;
}
.btn {
height: 28px;
padding: 0 14px;
display: grid;
place-items: center;
border-radius: 999px;
font-size: 12px;
font-weight: 600;
}
.back {
color: color-mix(in srgb, var(--slate) 55%, transparent);
animation: back var(--t) infinite;
}
.next {
background: var(--clay-d);
color: var(--paper);
animation: press var(--t) infinite;
}
/* ── Keyframes ────────────────────────────────────────────────────── */
/* Steps are siblings in a sequence, not levels of a hierarchy, so the
outgoing panel leaves by the same full width the incoming one crosses
— a conveyor, not a stack. Nothing waits behind; you are not "inside"
step one when you're on step two. */
@keyframes p1 {
0%,
12.5% {
transform: translateX(0);
animation-timing-function: var(--ease-in-out);
}
17.5%,
85% {
transform: translateX(calc(-100% - 16px));
}
86%,
100% {
transform: translateX(0);
}
}
@keyframes p2 {
0%,
12.5% {
transform: translateX(calc(100% + 16px));
animation-timing-function: var(--ease-in-out);
}
17.5%,
47.5% {
transform: translateX(0);
animation-timing-function: var(--ease-in-out);
}
52.5%,
85% {
transform: translateX(calc(-100% - 16px));
}
86%,
100% {
transform: translateX(calc(100% + 16px));
}
}
@keyframes p3 {
0%,
47.5% {
transform: translateX(calc(100% + 16px));
animation-timing-function: var(--ease-in-out);
}
52.5%,
85% {
transform: translateX(0);
}
86%,
100% {
transform: translateX(calc(100% + 16px));
}
}
/* The rail is the content's shadow: same window, same curve. A fill that
lands before the panel claims progress the screen hasn't shown yet; one
that lands after makes the rail look like it's catching up. */
@keyframes fill {
0%,
12.5% {
transform: scaleX(0);
animation-timing-function: var(--ease-in-out);
}
17.5%,
47.5% {
transform: scaleX(0.3333);
animation-timing-function: var(--ease-in-out);
}
52.5%,
85% {
transform: scaleX(0.6667);
}
86%,
100% {
transform: scaleX(0);
}
}
@keyframes ring {
0%,
12.5% {
transform: translateX(0);
animation-timing-function: var(--ease-in-out);
}
17.5%,
47.5% {
transform: translateX(var(--_gap));
animation-timing-function: var(--ease-in-out);
}
52.5%,
85% {
transform: translateX(calc(2 * var(--_gap)));
}
86%,
100% {
transform: translateX(0);
}
}
/* A step is marked done on release of Next — the moment of commitment —
so the tick is already there as the ring leaves it behind. */
@keyframes done-1 {
0%,
12.5% {
background: var(--paper);
border-color: var(--clay);
animation-timing-function: ease;
}
14.5%,
85% {
background: var(--clay);
border-color: var(--clay);
}
86%,
100% {
background: var(--paper);
border-color: var(--clay);
}
}
@keyframes done-2 {
0%,
12.5% {
background: var(--paper);
border-color: var(--oat);
animation-timing-function: ease;
}
14.5%,
47.5% {
background: var(--paper);
border-color: var(--clay);
animation-timing-function: ease;
}
49.5%,
85% {
background: var(--clay);
border-color: var(--clay);
}
86%,
100% {
background: var(--paper);
border-color: var(--oat);
}
}
/* The destination edges clay as the ring sets off for it, not as it
arrives — a colour change under a ring that is half over the dot
reads as a crescent. */
@keyframes arrive-3 {
0%,
47.5% {
border-color: var(--oat);
animation-timing-function: ease;
}
49.5%,
85% {
border-color: var(--clay);
}
86%,
100% {
border-color: var(--oat);
}
}
@keyframes tick-1 {
0%,
12.5% {
opacity: 0;
transform: scale(0.6);
animation-timing-function: var(--ease-out);
}
15%,
85% {
opacity: 1;
transform: scale(1);
}
86%,
100% {
opacity: 0;
transform: scale(0.6);
}
}
@keyframes tick-2 {
0%,
47.5% {
opacity: 0;
transform: scale(0.6);
animation-timing-function: var(--ease-out);
}
50%,
85% {
opacity: 1;
transform: scale(1);
}
86%,
100% {
opacity: 0;
transform: scale(0.6);
}
}
@keyframes press {
0%,
10.9% {
transform: scale(1);
animation-timing-function: var(--ease-out);
}
12.5% {
transform: scale(0.96);
animation-timing-function: var(--ease-out);
}
15%,
45.9% {
transform: scale(1);
animation-timing-function: var(--ease-out);
}
47.5% {
transform: scale(0.96);
animation-timing-function: var(--ease-out);
}
50%,
100% {
transform: scale(1);
}
}
/* Back has nothing to go back to on step one, so it isn't there yet. */
@keyframes back {
0%,
12.5% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
17.5%,
85% {
opacity: 1;
}
86%,
100% {
opacity: 0;
}
}
@keyframes reset {
0%,
81% {
opacity: 1;
animation-timing-function: ease;
}
84.5%,
86.5% {
opacity: 0;
animation-timing-function: ease;
}
91%,
100% {
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
/* The panels stop travelling and crossfade in place; the rail keeps
its fill and its ring, because that is the state, and the ring's
one-gap move is small enough to stay. The cycle stretches 1.5x. */
.p1,
.p2,
.p3,
.fill,
.ring,
.dot,
.dot svg,
.next,
.back,
.body {
animation-duration: calc(var(--t) * 1.5);
}
.p1 {
animation-name: f1;
}
.p2 {
animation-name: f2;
}
.p3 {
animation-name: f3;
}
.p2,
.p3 {
transform: none;
opacity: 0;
}
/* Out, then in — never both. Overlapping crossfades put two
panels' content in the same spot at half opacity. */
@keyframes f1 {
0%,
12.5% {
opacity: 1;
transform: none;
animation-timing-function: ease;
}
14.5%,
85% {
opacity: 0;
transform: none;
}
86%,
100% {
opacity: 1;
transform: none;
}
}
@keyframes f2 {
0%,
14.5% {
opacity: 0;
transform: none;
animation-timing-function: var(--ease-out);
}
17.5%,
47.5% {
opacity: 1;
transform: none;
animation-timing-function: ease;
}
49.5%,
100% {
opacity: 0;
transform: none;
}
}
@keyframes f3 {
0%,
49.5% {
opacity: 0;
transform: none;
animation-timing-function: var(--ease-out);
}
52.5%,
85% {
opacity: 1;
transform: none;
}
86%,
100% {
opacity: 0;
transform: none;
}
}
}
</style>
</head>
<body>
<div
class="frame"
role="img"
aria-label="A four-step form advancing twice: each step's panel slides out left as the next slides in, while the progress rail fills and a ring marking the current step travels along it on the same curve"
>
<div class="body">
<div class="rail" aria-hidden="true">
<span class="track"></span>
<span class="fill"></span>
<span class="ring"></span>
<span class="dot d1"
><svg viewBox="0 0 12 12" fill="none">
<path
d="M2.5 6.2 5 8.5l4.5-5"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/></svg
></span>
<span class="dot d2"
><svg viewBox="0 0 12 12" fill="none">
<path
d="M2.5 6.2 5 8.5l4.5-5"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/></svg
></span>
<span class="dot d3"></span>
<span class="dot d4"></span>
</div>
<div class="stage">
<div class="panel p1">
<p class="h">Your details</p>
<span class="input"><i style="width: 46%"></i></span>
<span class="input"><i style="width: 64%"></i></span>
</div>
<div class="panel p2">
<p class="h">Pick a plan</p>
<span class="opt"><b></b><i style="width: 40%"></i></span>
<span class="opt on"><b></b><i style="width: 54%"></i></span>
<span class="opt"><b></b><i style="width: 34%"></i></span>
</div>
<div class="panel p3">
<p class="h">Notifications</p>
<span class="row"><i style="width: 48%"></i><span class="sw on"></span></span>
<span class="row"><i style="width: 36%"></i><span class="sw"></span></span>
</div>
</div>
<div class="foot">
<span class="btn back">Back</span>
<span class="btn next">Next</span>
</div>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.