diff --git a/src/lib/Arc.svelte b/src/lib/Arc.svelte new file mode 100644 index 0000000..ff5a25e --- /dev/null +++ b/src/lib/Arc.svelte @@ -0,0 +1,168 @@ + + +
+ + + + {#each items as { c, progress, level }} + + + {/each} + + + +
+ + diff --git a/src/lib/svg-path.ts b/src/lib/svg-path.ts new file mode 100644 index 0000000..e045a35 --- /dev/null +++ b/src/lib/svg-path.ts @@ -0,0 +1,31 @@ +export default function () { + const commands: string[] = []; + return { + stringify() { + return `${commands.join("\n")}`; + }, + arcTo( + ry: number, + rx: number, + long: boolean, + cw: boolean, + y: number, + x: number, + ) { + commands.push(`A ${rx} ${ry} 0 ${long ? 1 : 0} ${cw ? 1 : 0} ${x} ${y}`); + return this; + }, + moveTo(y: number, x: number) { + commands.push(`M ${x} ${y}`); + return this; + }, + lineTo(y: number, x: number) { + commands.push(`L ${x} ${y}`); + return this; + }, + close() { + commands.push("z"); + return this; + }, + }; +}