feat(frontend): add ProgressRing component — SVG progress arc with percentage label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
26
frontend/src/lib/components/ProgressRing.svelte
Normal file
26
frontend/src/lib/components/ProgressRing.svelte
Normal file
@@ -0,0 +1,26 @@
|
||||
<script lang="ts">
|
||||
let { percentage }: { percentage: number } = $props();
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<svg width="36" height="36" viewBox="0 0 20 20">
|
||||
<circle cx="10" cy="10" r="7" fill="none" stroke="var(--c-line)" stroke-width="2" />
|
||||
<circle
|
||||
class="fill-arc"
|
||||
cx="10"
|
||||
cy="10"
|
||||
r="7"
|
||||
fill="none"
|
||||
stroke="var(--c-accent)"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
transform="rotate(-90 10 10)"
|
||||
stroke-dasharray="{(percentage / 100) * 43.98} 43.98"
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
class="block text-center font-sans text-[10px] font-bold {percentage > 0 ? 'text-accent' : 'text-gray-400'}"
|
||||
>
|
||||
{percentage}%
|
||||
</span>
|
||||
</div>
|
||||
Reference in New Issue
Block a user