ANIMATION › SVG
SINCE 1.0.0

draw() 路径描边

把 SVG path/line/circle 变成“正在被画出来”的效果,做 Logo、Loading、强调线条都很香。

SVG draw() code example
xjs('#p1').draw({ duration: 900, easing: 'ease-out' }); xjs('#p2').draw({ duration: 1200, easing: [0.2, 0.8, 0.2, 1] });
<svg viewBox="0 0 240 120"> <path id="p1" d="M..." /> <path id="p2" d="M..." /> </svg>
.stroke-draw { fill: none; stroke: var(--accent-color); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
SQUIGGLE
STAR
← Previous Next →