Undraw — rubbed out
Variant: Rubbed out
A pencil underline in a library book, scrubbed out before the book goes back — the one variant in the family that leaves something behind. The cleared patch is a masked zigzag keyed to the eraser’s own stops, so the rubber is always exactly where the graphite is going. Nine strokes at 120ms each whatever their length, because a hand scrubs to a rhythm, not a speed; each eases both ways like a wrist reversing, and only the forward strokes advance the clearing, so it moves in steps the way rubbing does. A second copy of the mark sits underneath at 16% and is never masked. An eraser never gets all of it, and that dent is what makes this read as removed by hand rather than deleted. Reach for it for clearing scratch work, soft deletes and dismissed suggestions, wherever the history of a mark is worth keeping faintly in view.
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>Undraw — rubbed out</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 — 4.8s, shared by the whole undraw family (1% = 48ms).
576ms of pencil, an 864ms hold, 240ms for the eraser to land, nine
120ms strokes (1.08s), 240ms to lift away, and a long look at what
the eraser left behind before the page resets. */
--cycle: 4.8s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
/* A hand's stroke — the family's pen stroke, wherever one is drawn. */
--ease-accent: cubic-bezier(0.45, 0, 0.4, 1);
/* One scrub: a wrist reversing at each end, so it eases both ways. */
--_scrub: cubic-bezier(0.45, 0, 0.55, 1);
--_ink: color-mix(in srgb, var(--slate) 80%, transparent);
--_muted: color-mix(in srgb, var(--slate) 52%, transparent);
--_graphite: color-mix(in srgb, var(--slate) 62%, transparent);
--_rubber: color-mix(in oklch, var(--clay) 30%, var(--paper));
--_rubber-edge: color-mix(in oklch, var(--clay-d) 50%, var(--paper));
/* Mask luminance: white keeps the pencil, black takes it. */
--_keep: #ffffff;
--_take: #000000;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
padding: clamp(10px, 3vw, 28px);
background: var(--ivory);
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
}
.card {
width: min(380px, 92vw);
border: 1px solid var(--oat);
border-radius: calc(14px * var(--round));
background: var(--paper);
}
.card svg {
display: block;
width: 100%;
height: auto;
}
.body {
font-size: 13.5px;
fill: var(--_ink);
}
.folio {
font-size: 12px;
fill: var(--_muted);
text-anchor: end;
font-variant-numeric: tabular-nums;
}
.pencil,
.ghost {
fill: none;
stroke: var(--_graphite);
stroke-width: 1.6;
stroke-linecap: round;
stroke-dasharray: 100 200;
stroke-dashoffset: 102;
}
.pencil {
animation: pencil var(--t) infinite;
}
@keyframes pencil {
0%,
4% {
stroke-dashoffset: 102;
animation-timing-function: var(--ease-accent);
}
16%,
100% {
stroke-dashoffset: 0;
}
}
/* An eraser never gets all of it. A second copy of the mark sits under
the first at 16% and is never masked, so when the pencil is taken the
dent of it stays — which is the honest end state for an erased mark,
and the reason this variant reads as "removed by hand" rather than
"deleted". It leaves only on the loop reset. */
.ghost {
opacity: 0.16;
animation: ghost var(--t) infinite;
}
@keyframes ghost {
0%,
4% {
stroke-dashoffset: 102;
opacity: 0.16;
animation-timing-function: var(--ease-accent);
}
16%,
92% {
stroke-dashoffset: 0;
opacity: 0.16;
animation-timing-function: ease;
}
99%,
100% {
stroke-dashoffset: 0;
opacity: 0;
}
}
.keep {
fill: var(--_keep);
}
/* The erased area is a zigzag path in the mask, drawn on by the same
offset trick as the pencil. Its vertices are the eraser's stops, and
each offset below is 373 minus the path's length to that vertex, so
the bare patch and the eraser cross every segment on the same curve
and the rubber is always exactly where the pencil is disappearing.
Back-strokes revisit ground already cleared; only the forward strokes
advance, which is why the clearing moves in steps, as rubbing does. */
.take {
fill: none;
stroke: var(--_take);
stroke-width: 18;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dasharray: 373 800;
stroke-dashoffset: 384;
animation: take var(--t) infinite;
}
@keyframes take {
0%,
38.99% {
stroke-dashoffset: 384;
}
39% {
stroke-dashoffset: 373;
animation-timing-function: var(--_scrub);
}
41.5% {
stroke-dashoffset: 322.75;
animation-timing-function: var(--_scrub);
}
44% {
stroke-dashoffset: 298.01;
animation-timing-function: var(--_scrub);
}
46.5% {
stroke-dashoffset: 239.7;
animation-timing-function: var(--_scrub);
}
49% {
stroke-dashoffset: 214.96;
animation-timing-function: var(--_scrub);
}
51.5% {
stroke-dashoffset: 156.65;
animation-timing-function: var(--_scrub);
}
54% {
stroke-dashoffset: 131.91;
animation-timing-function: var(--_scrub);
}
56.5% {
stroke-dashoffset: 73.6;
animation-timing-function: var(--_scrub);
}
59% {
stroke-dashoffset: 48.86;
animation-timing-function: var(--_scrub);
}
61.5%,
100% {
stroke-dashoffset: 0.69;
}
}
.eraser {
opacity: 0;
animation: eraser var(--t) infinite;
}
.eraser rect {
fill: var(--_rubber);
stroke: var(--_rubber-edge);
stroke-width: 1;
rx: calc(4px * var(--round));
}
/* Every stroke takes the same 120ms whatever its length, because a hand
scrubs to a rhythm, not a speed — the long forward strokes simply
move faster. It lands and leaves on ease-out, up and to the right,
the way a right hand comes in and gets out of the way of the page. */
@keyframes eraser {
0%,
34% {
opacity: 0;
transform: translate(28px, 42px);
animation-timing-function: var(--ease-out);
}
39% {
opacity: 1;
transform: translate(16px, 66px);
animation-timing-function: var(--_scrub);
}
41.5% {
opacity: 1;
transform: translate(66px, 71px);
animation-timing-function: var(--_scrub);
}
44% {
opacity: 1;
transform: translate(42px, 65px);
animation-timing-function: var(--_scrub);
}
46.5% {
opacity: 1;
transform: translate(100px, 71px);
animation-timing-function: var(--_scrub);
}
49% {
opacity: 1;
transform: translate(76px, 65px);
animation-timing-function: var(--_scrub);
}
51.5% {
opacity: 1;
transform: translate(134px, 71px);
animation-timing-function: var(--_scrub);
}
54% {
opacity: 1;
transform: translate(110px, 65px);
animation-timing-function: var(--_scrub);
}
56.5% {
opacity: 1;
transform: translate(168px, 71px);
animation-timing-function: var(--_scrub);
}
59% {
opacity: 1;
transform: translate(144px, 65px);
animation-timing-function: var(--_scrub);
}
61.5% {
opacity: 1;
transform: translate(192px, 69px);
animation-timing-function: var(--ease-out);
}
66.5%,
100% {
opacity: 0;
transform: translate(206px, 45px);
}
}
@media (prefers-reduced-motion: reduce) {
/* The same score on a clock twice as slow: every keyframe scales
together, so the alignments the comments rely on still hold. */
:root {
--t: calc(var(--cycle) * 2 / var(--speed));
}
/* No pencil travel and no scrubbing. The mark is simply there, and on
the eraser's window it fades to the same 16% ghost — the residue is
the point of this variant, so it survives. */
.pencil {
stroke-dashoffset: 0;
animation: pencil-calm var(--t) infinite;
}
.ghost {
stroke-dashoffset: 0;
animation: none;
}
.take,
.eraser {
animation: none;
}
@keyframes pencil-calm {
0%,
39% {
opacity: 1;
animation-timing-function: ease;
}
61.5%,
92% {
opacity: 0;
}
99%,
100% {
opacity: 1;
}
}
}
</style>
</head>
<body>
<div class="card">
<svg
viewBox="0 0 300 150"
role="img"
aria-label="A pencil underline is drawn beneath a line of a library book, then an eraser scrubs along it in short back-and-forth strokes, leaving only a faint trace of the mark"
>
<defs>
<mask id="rub" maskUnits="userSpaceOnUse" x="0" y="0" width="300" height="150">
<rect class="keep" x="0" y="0" width="300" height="150" />
<path
class="take"
d="M 16 66 L 66 71 L 42 65 L 100 71 L 76 65 L 134 71 L 110 65 L 168 71 L 144 65 L 192 69"
/>
</mask>
</defs>
<text class="body" x="20" y="38">Of the twelve reading rooms</text>
<text class="body" x="20" y="62">listed in the 1911 survey,</text>
<text class="body" x="20" y="94">only four still open daily.</text>
<text class="folio" x="282" y="140">214</text>
<path
class="ghost"
pathLength="100"
d="M 22 68 C 60 66.5, 100 70, 136 67.8 S 174 66.8, 186 68.6"
/>
<g mask="url(#rub)">
<path
class="pencil"
pathLength="100"
d="M 22 68 C 60 66.5, 100 70, 136 67.8 S 174 66.8, 186 68.6"
/>
</g>
<g class="eraser">
<rect x="-13" y="-5" width="26" height="10" transform="rotate(-16)" />
</g>
</svg>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.