Transit — velocity smear
Variant: Smear
Squash and stretch with the bounce taken out: the token lengthens only while it is fast. The stretch is the travel curve's own derivative, sampled every 40ms and joined linearly as 1 + 0.7 × speed ÷ peak speed. It reaches 1.7× at the fastest point of the strong ease-in-out and stays visibly long for only a few frames. That brevity is intended: the smear should register as speed, not be seen as a shape. Give the stretch any other schedule, such as its own ease or a fixed ramp, and the token is long while it is slow, which reads as rubber. Height falls by the square root, and a translate pins the leading edge, so all the stretch trails behind; a smear shows where the token has been, never where it is going. The token leaves and lands at zero speed, so it is round at both ends, with no landing squash. Use it on fast, long, horizontal moves, like a slider thumb thrown to the end or a selection jumping across a segmented control. The speed knob is narrowed to 0.8–1.25, because a stretch on a slow move misrepresents its speed. Under reduced motion it crossfades between sockets.
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" />
<meta name="animation-knobs" content="speed: 0.8-1.25" />
<title>Transit — velocity smear</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 — 3.2s: rest, 400ms across (12.5%), rest, 400ms back, rest. */
--cycle: 3.2s;
--t: calc(var(--cycle) / var(--speed));
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
--_d: 28px;
}
* {
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 {
display: grid;
gap: clamp(14px, 5vh, 22px);
justify-items: center;
}
.track {
position: relative;
overflow: clip;
/* The carriers are track-sized, so in flight their empty boxes run
past the edge; clipping here keeps the page from scrolling. The
margin leaves room for the token's shadow. */
overflow-clip-margin: 4px;
width: min(280px, 78vw);
height: var(--_d);
}
.socket {
position: absolute;
top: 0;
width: var(--_d);
height: var(--_d);
border-radius: 50%;
border: 1.5px dashed color-mix(in srgb, var(--slate) 22%, transparent);
}
.socket.a {
left: 0;
}
.socket.b {
right: 0;
}
/* The rail is dots, not a line: a fixed reference the eye can measure
the stretch against while the token is too fast to look at. */
.rail {
position: absolute;
left: calc(var(--_d) + 12px);
right: calc(var(--_d) + 12px);
top: 50%;
height: 3px;
transform: translateY(-50%);
background: radial-gradient(
circle,
color-mix(in srgb, var(--slate) 18%, transparent) 1.5px,
transparent 1.6px
)
0 50% / 14px 3px repeat-x;
}
.x {
position: absolute;
inset: 0;
animation: travel var(--t) var(--ease-in-out) infinite;
}
.token {
position: absolute;
left: 0;
top: 0;
width: var(--_d);
height: var(--_d);
border-radius: 50%;
background: var(--clay);
animation: smear var(--t) linear infinite;
}
.cap {
font-size: 11.5px;
letter-spacing: 0.02em;
color: color-mix(in srgb, var(--slate) 55%, transparent);
}
@keyframes travel {
0%,
15% {
transform: translateX(0);
}
27.5%,
65% {
transform: translateX(calc(100% - var(--_d)));
}
77.5%,
100% {
transform: translateX(0);
}
}
/* The stretch is the travel curve's own derivative, sampled every 40ms
and joined linearly: 1 + 0.7 × (speed ÷ peak speed). Stretch on any
other schedule — an ease of its own, a fixed ramp — and the token is
long while it is slow, which reads as rubber instead of speed. Height
shrinks by the square root, keeping most of the mass without thinning
to a line. The translate pins the leading edge, so all the stretch
trails behind: a smear is where the token has been, never where it is
going. Leaving and landing are both at zero speed, so both are round. */
@keyframes smear {
0%,
15% {
transform: none;
}
17.5% {
transform: translateX(calc(var(--_d) * -0.03)) scale(1.06, 0.971);
}
18.75% {
transform: translateX(calc(var(--_d) * -0.067)) scale(1.133, 0.939);
}
20% {
transform: translateX(calc(var(--_d) * -0.173)) scale(1.347, 0.862);
}
21.25% {
transform: translateX(calc(var(--_d) * -0.35)) scale(1.7, 0.767);
}
22.5% {
transform: translateX(calc(var(--_d) * -0.111)) scale(1.223, 0.904);
}
23.75% {
transform: translateX(calc(var(--_d) * -0.051)) scale(1.102, 0.953);
}
25% {
transform: translateX(calc(var(--_d) * -0.025)) scale(1.05, 0.976);
}
27.5%,
65% {
transform: none;
}
67.5% {
transform: translateX(calc(var(--_d) * 0.03)) scale(1.06, 0.971);
}
68.75% {
transform: translateX(calc(var(--_d) * 0.067)) scale(1.133, 0.939);
}
70% {
transform: translateX(calc(var(--_d) * 0.173)) scale(1.347, 0.862);
}
71.25% {
transform: translateX(calc(var(--_d) * 0.35)) scale(1.7, 0.767);
}
72.5% {
transform: translateX(calc(var(--_d) * 0.111)) scale(1.223, 0.904);
}
73.75% {
transform: translateX(calc(var(--_d) * 0.051)) scale(1.102, 0.953);
}
75% {
transform: translateX(calc(var(--_d) * 0.025)) scale(1.05, 0.976);
}
77.5%,
100% {
transform: none;
}
}
.token.ghost {
display: none;
}
@media (prefers-reduced-motion: reduce) {
/* Without travel there is no speed, and without speed a stretch is a
lie. The token crossfades between the two sockets instead. */
.x {
animation: none;
}
.token {
animation: seat-a calc(var(--t) * 1.6) ease infinite;
}
.token.ghost {
display: block;
left: auto;
right: 0;
animation-name: seat-b;
}
@keyframes seat-a {
0%,
15% {
opacity: 1;
}
27.5%,
65% {
opacity: 0;
}
77.5%,
100% {
opacity: 1;
}
}
@keyframes seat-b {
0%,
15% {
opacity: 0;
}
27.5%,
65% {
opacity: 1;
}
77.5%,
100% {
opacity: 0;
}
}
}
</style>
</head>
<body>
<div
class="stage"
role="img"
aria-label="A dot crosses between two sockets, stretching into a short pill behind itself at the fastest moment of the move and arriving round"
>
<div class="track">
<span class="rail"></span>
<span class="socket a"></span>
<span class="socket b"></span>
<div class="x"><span class="token"></span></div>
<span class="token ghost"></span>
</div>
<p class="cap">stretch = speed · leading edge pinned</p>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.