152bpm
32:146.2 km
Cardélys
Session in progress
Intervals 6 × 800 m
Rep 4 of 6 · 440 m to go
Pace4'05"/km
Max161 bpm
Rest1:12
Calories418
A broken SVG line that draws itself and then erases, on a loop, in pure CSS: swap the path to draw a pulse, a route or a gesture.
Updated
This effect is free — the SVG category contains 30 effects total, including 3 free. Effect.Labs has 840 vanilla effects. Explore the category →
152bpm
32:146.2 km
Cardélys
Session in progress
Intervals 6 × 800 m
Rep 4 of 6 · 440 m to go
Pace4'05"/km
Max161 bpm
Rest1:12
Calories418
Bike couriers
Pickup and drop-off anywhere downtown, Monday to Saturday, 8 am to 8 pm.
Clavendre
Draw your pattern
Watch, then do the same
Step 1 of 2
Password vault
The drawing is a single <path> (class .lnd-path) inside a 150×150-unit SVG. The pathLength="100" attribute rescales its length to 100 whatever its real size, so a 100-long dash (stroke-dasharray: 100) covers the whole path, and shifting that dash with stroke-dashoffset is enough to show or hide the stroke.
The lndDraw animation (3 s, looping, ease curve) moves the offset from 100 (nothing visible) to 0 (full stroke) during the first 45% of the cycle, holds it at 0 until 55%, then pushes it to −100: the stroke disappears from its starting point, in the direction it was drawn. The shipped path holds two broken lines (two M commands); the dash restarts at the beginning of each, so they draw together and the shorter one is complete before the other.
For your own shape, replace the d attribute (and the viewBox if it overflows 150×150) and keep pathLength="100": the cycle stays right whether the path is 40 or 4,000 units long. No JavaScript, no interaction; the .fx-0599-root frame is 250 px tall on a midnight-blue background, both adjustable through variables.
aria-hidden="true". If the line stands for data (a heart rate, a journey), write that data as text next to it: screen readers will read the text, not the line.prefers-reduced-motion: reduce, the animation is removed and the line stays fully drawn (measured in Chromium, Firefox and WebKit: no running animation, identical image 0.7 s apart).#6366f1 indigo reaches 3.9:1 on the shipped background and 4.5:1 on white, above the 3:1 minimum for a graphic element.Pure CSS. pathLength applies to dashes since Chrome 50, Firefox 6 and Safari 14; the reduced-motion rule needs Chrome 74, Firefox 63 and Safari 10.1. Measured in Chromium 151, Firefox 153 and WebKit 26.5: 0 errors, two independent copies, nothing overflowing at 390 px.
Before Safari 14, pathLength is ignored for dashes: the stroke draws in pieces. Without CSS animations, the line simply shows, complete.
Copy the two blocks (HTML and CSS) into your page. No JavaScript, no dependencies.
<div class="fx-0599-root">
<svg class="lnd-svg" viewBox="0 0 150 150" aria-hidden="true">
<path class="lnd-path" pathLength="100" d="M20,75 L50,30 L80,60 L110,20 L130,50 M20,130 L60,90 L100,110 L130,80"/>
</svg>
</div>
.fx-0599-root,.fx-0599-root *,.fx-0599-root *::before,.fx-0599-root *::after{box-sizing:border-box}
.fx-0599-root{--lnd-color:#6366f1;--lnd-stroke:3;--lnd-size:150px;--lnd-speed:3s;--lnd-repeat:infinite;--lnd-bg:rgb(26,26,36);--lnd-height:250px;display:flex;align-items:center;justify-content:center;width:100%;position:relative;color:#fff;font-family:sans-serif;height:var(--lnd-height);overflow:hidden;background:var(--lnd-bg)}
.fx-0599-root .lnd-svg{display:block;width:var(--lnd-size);max-width:100%;height:auto}
.fx-0599-root .lnd-path{fill:none;stroke:var(--lnd-color);stroke-width:var(--lnd-stroke);stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:100;stroke-dashoffset:0;animation:lndDraw var(--lnd-speed) ease var(--lnd-repeat) both}
@keyframes lndDraw{0%{stroke-dashoffset:100}45%,55%{stroke-dashoffset:0}to{stroke-dashoffset:-100}}
@media (prefers-reduced-motion:reduce){.fx-0599-root .lnd-path{animation:none}}
Pure CSS — no JavaScript needed.
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
Path d (and viewBox) |
two broken lines in 150×150 | The drawn shape. Keep pathLength="100" on the path so the cycle stays right. |
--lnd-color |
#6366f1 |
Stroke colour. |
--lnd-stroke |
3 |
Stroke width, in viewBox units (it grows with the drawing). |
--lnd-speed |
3s |
Length of a full cycle: draw, pause, erase. |
--lnd-repeat |
infinite |
Number of cycles. .5: the line draws once and stays on screen; 1: it draws, erases and does not come back. |
--lnd-size |
150px |
Drawing width; the height follows the viewBox proportions. 100% fills the frame. |
--lnd-height and --lnd-bg |
250px and rgb(26,26,36) |
Frame height and background; transparent to lay the line over your own artwork. |
Set --lnd-repeat: .5 on .fx-0599-root: the animation stops halfway through its cycle, when the line is complete, and it stays on screen. To replay it, hide then show the root again.
The dash restarts at the beginning of each subpath (each M): the lines start together and the shorter one finishes first. To make them follow each other, join them into one continuous stroke or use two paths with different durations.
Yes: copy the path's d attribute and its viewBox. The path must be an outline (not a filled shape); if the export holds several paths, give each one the lnd-path class and pathLength="100".