diff --git a/packages/bbui/src/ProgressCircle/ProgressCircle.svelte b/packages/bbui/src/ProgressCircle/ProgressCircle.svelte index c3c0fb39d6..f5ecccde79 100644 --- a/packages/bbui/src/ProgressCircle/ProgressCircle.svelte +++ b/packages/bbui/src/ProgressCircle/ProgressCircle.svelte @@ -4,10 +4,29 @@ import { tweened } from "svelte/motion" import { cubicOut } from "svelte/easing" - export let value = false export let small export let large + export let value = false + export let minValue = 0 + export let maxValue = 0 + + let subMask1Style + let subMask2Style + if (!value) { + let percentage = ((value - minValue) / (maxValue - minValue)) * 100 + let angle + if (percentage > 0 && percentage <= 50) { + angle = -180 + (percentage / 50) * 180 + subMask1Style = `rotate(${angle}deg)` + subMask2Style = "rotate(-180deg)" + } else if (percentage > 50) { + angle = -180 + ((percentage - 50) / 50) * 180 + subMask1Style = "rotate(0deg)" + subMask2Style = `rotate(${angle}deg)` + } + } + export let overBackground @@ -20,12 +39,12 @@
-
+
-
+