let steps = 3; console.clear(); const rules = { "A": "+BF-AFA-FB+", "B": "-AF+BFB+FA-", }; let s = "A"; for(let i=0;i { const dt = (new Date() - 0) / scale / period; const m = dt % (pips); const t = dt; const l = (Math.floor(m) + easeInOutSine(m % 1))*length/pips; const n = Math.max(0,easeInOutSine(t))*l; //document.getElementById('debug').textContent = `${m.toFixed(4)} ${length} ${pips}` curve.setAttribute('stroke-dasharray',`${l-n} ${length}`); curve.setAttribute('stroke-dashoffset',-n); curve.setAttribute('stroke-width',width*(easeInOutSine(t)*0.1+0.9)/2**(i+1)); scale *= pips; }) requestAnimationFrame(frame); } frame();