Fluid — pour and settle
Variant: Pour and settle
A meter topped up from 38% to a pre-set mark at 71%, poured rather than eased. Constant flow into straight walls is a straight line, so the level and the count are both linear — an ease-out here would claim the tap was being closed the whole time. The stream’s head and tail both fall on t², and the rise runs from the moment the head lands to the moment the tail does, so the last 3 points arrive after the tap has closed: that liquid was already in the air. The surface tilts on a 300ms slosh while it is fed and keeps swinging for a second after, each swing 0.62 of the last, while the number sits still on 71. The reading tracks the mean level, never the wave. Use it for quotas, storage and budget top-ups, where the update is an amount arriving and the meter should not wobble its answer while it settles.
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>Fluid — pour and settle</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 — every duration in the document runs off --t. */
--cycle: 4s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
/* Free fall, t². Both ends of the stream obey it: the head leaving
the spout and the tail after the tap closes. */
--ease-accent: cubic-bezier(0.333, 0, 0.667, 0.333);
--_water: color-mix(in oklch, var(--olive) 30%, var(--paper));
--_stream: color-mix(in oklch, var(--olive) 62%, var(--paper));
--_muted: color-mix(in oklch, var(--slate) 55%, var(--paper));
--_cue: color-mix(in oklch, var(--slate) 30%, var(--ivory));
}
@property --_n {
syntax: '<integer>';
initial-value: 38;
inherits: false;
}
* {
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);
}
.stage {
position: relative;
width: 230px;
height: 196px;
}
.spout {
position: absolute;
left: 146px;
top: 22px;
width: 84px;
height: 10px;
border-radius: calc(3px * var(--round)) 0 0 calc(3px * var(--round));
background: var(--oat);
}
.tank {
position: absolute;
left: 92px;
top: 60px;
width: 100px;
height: 120px;
overflow: hidden;
border-radius: 0 0 calc(12px * var(--round)) calc(12px * var(--round));
background: var(--paper);
}
.walls {
position: absolute;
left: 92px;
top: 60px;
width: 100px;
height: 120px;
border: 1.5px solid var(--oat);
border-top: 0;
border-radius: 0 0 calc(12px * var(--round)) calc(12px * var(--round));
}
.tank svg {
display: block;
width: 100%;
height: 100%;
overflow: visible;
}
.base rect,
.water rect {
fill: var(--_water);
}
.base line,
.water line {
stroke: var(--olive);
stroke-width: 1.5;
}
/* The fill-to line, set before the pour: the reading has a target, and
the level has to stop on it while the surface is still moving. */
.target {
stroke: var(--_cue);
stroke-width: 1.5;
stroke-dasharray: 3 3;
animation: target var(--t) infinite;
}
.rig {
position: absolute;
inset: 0;
animation: rig-cycle var(--t) linear infinite;
}
.stream {
position: absolute;
left: 150px;
top: 32px;
width: 4px;
height: 102.4px;
background: var(--_stream);
transform-origin: top;
animation: stream var(--t) infinite;
}
.level {
animation: level var(--t) linear infinite;
}
/* Drawn twice the tank's width, so a tilted surface never shows a
corner, and as SVG geometry so the tilted edge stays anti-aliased. */
.water {
transform-box: view-box;
transform-origin: 50px 74.4px;
animation: slosh var(--t) infinite;
}
.count {
position: absolute;
right: 158px;
top: 76px;
font-size: 30px;
font-weight: 600;
letter-spacing: -0.02em;
font-variant-numeric: tabular-nums;
line-height: 1;
counter-reset: n var(--_n);
animation: count var(--t) linear infinite;
}
.count::before {
content: counter(n);
}
.count span {
font-size: 15px;
font-weight: 500;
color: var(--_muted);
}
/* Head falls from the spout (220ms, t²), then the stream shortens in
step with the rising surface. The tap closes at 60.5%; the tail then
falls the remaining 64px in 171ms — √(64/102) of the head's time. */
@keyframes stream {
0%,
10% {
transform: scaleY(0);
clip-path: inset(0 0 0 0);
animation-timing-function: var(--ease-accent);
}
15.5% {
transform: scaleY(1);
animation-timing-function: linear;
}
60.5% {
transform: scaleY(0.647);
clip-path: inset(0 0 0 0);
animation-timing-function: var(--ease-accent);
}
64.8% {
transform: scaleY(0.6133);
clip-path: inset(100% 0 0 0);
}
65%,
100% {
transform: scaleY(0);
clip-path: inset(100% 0 0 0);
}
}
/* Constant flow into straight walls is a straight line: no easing on
the rise or the count. It runs from the moment the head lands to
the moment the tail does, so the last 2% arrives after the tap has
closed — the liquid that was already in the air. */
@keyframes level {
0%,
15.5% {
transform: translateY(0);
}
64.8%,
93% {
transform: translateY(-39.6px);
}
94%,
100% {
transform: translateY(0);
}
}
@keyframes count {
0%,
15.5% {
--_n: 38;
}
64.8%,
93% {
--_n: 71;
}
94%,
100% {
--_n: 38;
}
}
/* The first slosh mode: the surface tilts about its centre with a 300ms
half period. Driven while the stream lands (3.2°), free after it —
each swing 0.62 of the last, a damping ratio near 0.15. The number
stopped a second ago; the surface is still settling around it. */
@keyframes slosh {
0%,
15.5% {
transform: rotate(0deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
23% {
transform: rotate(2deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
30.5% {
transform: rotate(-3.2deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
38% {
transform: rotate(3.2deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
45.5% {
transform: rotate(-3.2deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
53% {
transform: rotate(3.2deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
60.5% {
transform: rotate(-3.2deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
68% {
transform: rotate(2deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
75.5% {
transform: rotate(-1.24deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
83% {
transform: rotate(0.77deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
90.5% {
transform: rotate(-0.48deg);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
93%,
100% {
transform: rotate(0deg);
}
}
@keyframes target {
0%,
64.3% {
stroke: var(--_cue);
animation-timing-function: var(--ease-out);
}
65.3%,
88% {
stroke: var(--clay);
animation-timing-function: ease;
}
93%,
100% {
stroke: var(--_cue);
}
}
@keyframes rig-cycle {
0%,
88% {
opacity: 1;
}
93%,
95% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
/* The pour is travel and the slosh is vestibular; both go. What
stays is the before and after — 38 at its level, 71 on its mark —
swapped under a slow crossfade, so number and level never disagree. */
.stream,
.water {
animation: none;
}
.stream {
transform: scaleY(0);
}
.rig {
animation: swap-rm calc(var(--t) * 2) ease-in-out infinite;
}
.level {
animation: level-rm calc(var(--t) * 2) infinite;
}
.count {
animation: count-rm calc(var(--t) * 2) infinite;
}
.target {
animation: target-rm calc(var(--t) * 2) ease-in-out infinite;
}
@keyframes swap-rm {
0%,
50%,
100% {
opacity: 0;
}
7.5%,
42.5%,
57.5%,
92.5% {
opacity: 1;
}
}
@keyframes level-rm {
0%,
49.9% {
transform: translateY(0);
}
50%,
100% {
transform: translateY(-39.6px);
}
}
@keyframes count-rm {
0%,
49.9% {
--_n: 38;
}
50%,
100% {
--_n: 71;
}
}
@keyframes target-rm {
0%,
50% {
stroke: var(--_cue);
}
57.5%,
92.5% {
stroke: var(--clay);
}
100% {
stroke: var(--_cue);
}
}
}
</style>
</head>
<body>
<div
class="stage"
role="img"
aria-label="Liquid pours into a tank; the level rises in a straight line from 38 to 71 percent and stops on its mark while the surface keeps sloshing and settles a second later"
>
<div class="spout"></div>
<div class="tank">
<svg viewBox="0 0 100 120" aria-hidden="true">
<g class="base">
<rect x="0" y="74.4" width="100" height="46" />
<line x1="0" y1="74.4" x2="100" y2="74.4" />
</g>
<g class="rig">
<g class="level">
<g class="water">
<rect x="-50" y="74.4" width="200" height="140" />
<line x1="-50" y1="74.4" x2="150" y2="74.4" />
</g>
</g>
</g>
<line class="target" x1="0" y1="34.8" x2="100" y2="34.8" />
</svg>
</div>
<div class="walls"></div>
<div class="rig">
<div class="stream"></div>
<div class="count"><span>%</span></div>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.