Fluid — coalesce
Variant: Coalesce
Snap-to-merge as surface tension. A drop is dragged at a steady 50px/s toward an anchored one; the instant its edge touches the dashed capture ring it jumps the last 24px in 90ms on an accelerating curve whose entry slope carries the drag’s speed — the pull grows as the gap closes, so there is nothing to ease out of — and the hand lets go. Two r13 drops become one r18.4, not r26: area is conserved, so the merge visibly loses size, which is how you know nothing was added. It lands wide across both and rings round into the slot on 140ms half periods, slower than a single drop’s because bigger drops oscillate slower, while the ring closes onto it and is gone. Use it for drag-to-combine — merging tags, grouping items, docking into a slot — where the capture should be visible before the user lets go.
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 — coalesce</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;
--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: 3.6s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
/* Capture accelerates all the way to contact: the pull between two
surfaces grows as the gap closes, so there is nothing to ease out
of. The 0.19 entry slope carries the drag's 50px/s into the jump. */
--ease-accent: cubic-bezier(0.5, 0.094, 1, 0.45);
--_cue: color-mix(in oklch, var(--slate) 30%, var(--ivory));
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
background: var(--ivory);
}
svg {
display: block;
width: 220px;
height: 160px;
overflow: visible;
}
.liquid {
fill: var(--olive);
}
.liquid circle,
.ring,
.grip {
transform-box: fill-box;
transform-origin: center;
}
.ring {
fill: none;
stroke: var(--_cue);
stroke-width: 1.5;
stroke-dasharray: 3 4;
animation: ring var(--t) infinite;
}
.a {
animation: a var(--t) infinite;
}
.b {
animation: b var(--t) infinite;
}
.m {
opacity: 0;
animation: m var(--t) infinite;
}
.hand {
animation: hand var(--t) infinite;
}
.grip {
fill: var(--paper);
stroke: var(--slate);
stroke-width: 1.5;
animation: grip var(--t) infinite;
}
/* Dragged at a constant 50px/s until its edge touches the capture
ring, then 24px in 90ms — the last stretch belongs to the liquid,
not the hand. */
@keyframes a {
0%,
8% {
transform: translateX(0) scale(1);
opacity: 1;
animation-timing-function: linear;
}
40% {
transform: translateX(58px) scale(1);
animation-timing-function: var(--ease-accent);
}
42.5% {
transform: translateX(82px) scale(1);
opacity: 1;
}
42.6%,
88% {
transform: translateX(82px) scale(1);
opacity: 0;
}
88.1% {
transform: translateX(0) scale(0.8);
opacity: 0;
animation-timing-function: var(--ease-out);
}
96%,
100% {
transform: translateX(0) scale(1);
opacity: 1;
}
}
/* The target is anchored — it is the slot — so it never moves; the
dragged drop does all the travelling into it. */
@keyframes b {
0%,
42.5% {
transform: scale(1);
opacity: 1;
}
42.6%,
88% {
transform: scale(1);
opacity: 0;
}
88.1% {
transform: scale(0.8);
opacity: 0;
animation-timing-function: var(--ease-out);
}
96%,
100% {
transform: scale(1);
opacity: 1;
}
}
/* Two r13 drops make one r18.4, not r26 — area is conserved, so the
merge visibly loses size, which is how you know nothing was added.
It lands wide across both, centred between them, and rings round
into the slot; every scaleY is 1/scaleX, so area holds through the
wobble too. Each half period is 140ms, slower than a single drop's
because a larger drop oscillates slower (period grows as r^1.5). */
@keyframes m {
0%,
42.4% {
transform: translateX(-9px) scale(1.25, 0.8);
opacity: 0;
}
42.5% {
transform: translateX(-9px) scale(1.25, 0.8);
opacity: 1;
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
46.4% {
transform: translateX(0) scale(0.9, 1.111);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
50.3% {
transform: translateX(0) scale(1.04, 0.962);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
54.2% {
transform: translateX(0) scale(0.985, 1.015);
animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
}
58.1%,
84% {
transform: translateX(0) scale(1, 1);
opacity: 1;
animation-timing-function: var(--ease-out);
}
89%,
100% {
transform: translateX(0) scale(0.9, 0.9);
opacity: 0;
}
}
/* The hand lets go at the ring and coasts its last 6px — the entry
slope of the curve matches the drag speed, so it never brakes. */
@keyframes hand {
0%,
8% {
transform: translateX(0);
animation-timing-function: linear;
}
40% {
transform: translateX(58px);
animation-timing-function: cubic-bezier(0.25, 0.5, 0.5, 1);
}
46.7%,
100% {
transform: translateX(64px);
}
}
@keyframes grip {
0%,
2% {
opacity: 0;
transform: scale(0.9);
animation-timing-function: var(--ease-out);
}
7%,
42% {
opacity: 1;
transform: scale(1);
animation-timing-function: var(--ease-out);
}
50%,
100% {
opacity: 0;
transform: scale(0.9);
}
}
/* The capture radius closes onto its occupant: 29px down to the merged
drop's 18.4 (scale 0.634), then gone — the slot is filled. */
@keyframes ring {
0%,
40% {
transform: scale(1);
stroke: var(--_cue);
opacity: 1;
animation-timing-function: var(--ease-out);
}
41% {
stroke: var(--clay);
animation-timing-function: var(--ease-out);
}
48% {
transform: scale(0.634);
stroke: var(--clay);
opacity: 0;
}
88% {
transform: scale(1.04);
stroke: var(--_cue);
opacity: 0;
animation-timing-function: var(--ease-out);
}
96%,
100% {
transform: scale(1);
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
/* No travel: the drops stay put and the merge is told as a
crossfade — two drops and their ring, then the single larger drop
sitting in the slot. */
.hand {
animation: none;
}
.grip {
animation: none;
opacity: 0;
}
.a,
.b,
.ring {
animation: pair calc(var(--t) * 2) ease-in-out infinite;
}
.m {
animation: one calc(var(--t) * 2) ease-in-out infinite;
}
@keyframes pair {
0%,
35% {
opacity: 1;
}
50%,
85% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes one {
0%,
35% {
opacity: 0;
}
50%,
85% {
opacity: 1;
}
100% {
opacity: 0;
}
}
}
</style>
</head>
<body>
<svg
viewBox="0 0 220 160"
role="img"
aria-label="A drop is dragged toward another; when it reaches the second drop's dashed capture ring both jump together, merge into one smaller-than-doubled drop, and wobble round"
>
<defs>
<filter
id="goo"
x="-30%"
y="-60%"
width="160%"
height="220%"
color-interpolation-filters="sRGB"
>
<feGaussianBlur in="SourceGraphic" stdDeviation="4.5" />
<feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -10" />
</filter>
</defs>
<circle class="ring" cx="160" cy="80" r="29" />
<g class="liquid" filter="url(#goo)">
<circle class="a" cx="60" cy="80" r="13" />
<circle class="b" cx="160" cy="80" r="13" />
<circle class="m" cx="160" cy="80" r="18.4" />
</g>
<g class="hand"><circle class="grip" cx="60" cy="80" r="6" /></g>
</svg>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.