also called stroke-dashoffset scrub · line draw · SVG path reveal
The robustness trick is pathLength="1": it normalises any path to a length of one, so the same two lines of CSS draw any shape without measuring it in JavaScript first. Nothing is redrawn: the bands are Minard’s lithograph. Each starts under a veil the colour of the paper, blended so that it lifts only ink, and a pen, one stroke-dashoffset in the veil’s mask, takes the veil away along the line. The black band keeps his calendar: the dates in his table of the cold, each tied to a place on the retreat by one of his thin vertical lines, set its pace, and the thermometer draws itself in step. Étienne-Jules Marey praised the map’s “brutal eloquence, which seems to defy the pen of the historian”.
How it is built
.veil { background: #BAAE99; mix-blend-mode: lighten; mask: url(#veil-advance) } /* lifts only the ink */
<mask id="veil-advance"> <path d="…" stroke="#fff"/> <!-- the band, veiled -->
<path class="pen" d="…" stroke="#000" pathLength="1"/> </mask> <!-- the pen takes the veil away -->
.pen { stroke-dasharray: 1; animation: draw linear both; animation-timeline: --march }
@keyframes draw { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }In full, on GitHub index.html showcase.css
Map — Carte figurative des pertes successives en hommes de l’Armée Française dans la campagne de Russie 1812–1813, drawn by Charles Joseph Minard, Paris, 20 November 1869 (printed with its companion, Hannibal’s march); Bibliothèque nationale de France, via Gallica; public domain, via Wikimedia Commons. The figures, places and readings are Minard’s, as written on the map. Facts — Charles Joseph Minard; French invasion of Russia.