wave = svg`<svg viewBox="0 0 ${segments.reduce((a, b) => a + b)} 100">
<path id="wave" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="bevel" stroke-width="1" stroke-dasharray="1" stroke-dashoffset="1" pathLength="1" />
<animate xlink:href="#wave" attributeName="d" dur="150ms" repeatCount="indefinite" from="M ${origin} L ${path(
from
).join(" ")}" to="M ${origin} L ${path(to).join(" ")}" />
<style>
path[id="wave"] {
animation: dash ${segments.length}s steps(${
path(from).length
}, jump-none) alternate infinite;
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
</style>
</svg>`