From 767dc06aaeb21c5e8d5150e71a3bbf3c7eba7523 Mon Sep 17 00:00:00 2001 From: vnau <20983143+vnau@users.noreply.github.com> Date: Sat, 7 Dec 2024 02:37:55 +0100 Subject: [PATCH] add class property, angles in degree, fix styles --- src/lib/Gauge.scss | 33 ++++------ src/lib/Gauge.svelte | 139 +++++++++++++++++++++++-------------------- src/lib/util.ts | 73 ++++++++++++++--------- 3 files changed, 130 insertions(+), 115 deletions(-) diff --git a/src/lib/Gauge.scss b/src/lib/Gauge.scss index 0b088cc..97444d6 100644 --- a/src/lib/Gauge.scss +++ b/src/lib/Gauge.scss @@ -11,7 +11,7 @@ } .gauge-circle { - fill: white; + fill: none; stroke: var(--stroke-color, lightgray); opacity: 0.3; stroke-width: var(--gauge-stroke); @@ -39,35 +39,22 @@ transition: r 0.3s ease-out; } -.gauge-title-curve { - fill: none; - stroke: none; -} - .titles-container { - color: currentColor; - font-family: "Calibri", sans-serif; - font-size: 20px; - font-weight: 200; - - text:not(:first-of-type) { - color: lightslategray; - font-size: 14px; - } + fill: currentcolor; } .slot-container { - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - position: relative; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + margin: calc(var(--gauge-stroke) + var(--gauge-border)); line-height: normal; text-align: center; - padding: calc(var(--gauge-stroke) + var(--gauge-border)) } .slot-content { - font-size: calc((var(--gauge-radius) - 2 * (var(--gauge-stroke) - var(--gauge-border)))/2); - font-family: 'Calibri'; - font-weight: 100; + fill: currentColor; + font-size: calc((var(--gauge-radius) - 2 * (var(--gauge-stroke) - var(--gauge-border)))/3); } \ No newline at end of file diff --git a/src/lib/Gauge.svelte b/src/lib/Gauge.svelte index c67d01d..45159fd 100644 --- a/src/lib/Gauge.svelte +++ b/src/lib/Gauge.svelte @@ -1,26 +1,26 @@