Skip to content

Commit

Permalink
update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
vnau committed Dec 23, 2024
1 parent f788bba commit cfd029d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/Clock.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
stop={60}
stroke={10}
segments={Array.from(Array(12), (_, i) => [5 * i, 5 * i])}
labels={Array.from(Array(13), (_, i) => (((i + 11) % 12) + 1).toString())}
labels={["I","II","III","IIII","IV","V","VI","VII","IIX","IX","X","XI",""]}
color={palette[0]}
>
<Gauge
Expand Down
6 changes: 3 additions & 3 deletions src/components/Indicator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
value = Math.min(100, Math.round((Date.now() % 12000) / 100));
}, 500);
const palette = ["#ffffff", "#e41376", "#01c8ee"];
const palette = ["#ffffff", "#e41376", "#01c8eec0"];
</script>

<Gauge
Expand Down Expand Up @@ -41,8 +41,8 @@
<div>☀</div>
</div>
</div>
</Gauge></Gauge
>
</Gauge>
</Gauge>

<style lang="scss">
.slider-content {
Expand Down
30 changes: 24 additions & 6 deletions src/components/Progress.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
/>

<Gauge
class="progress"
stroke={10}
displayValue={(v) => v.formattedValue + "%"}
labels={["", "who knows, maybe it will take forever", ""]}
color="#d43008"
class="segmented"
stroke={15}
startAngle={40}
stopAngle={320}
displayValue={""}
segments={[
{ start: 0, stop: 33, color: "#f6a944", label: "Low" },
{ start: 33, stop: 66, color: "#8a9305", label: "Medium" },
{ start: 66, stop: 100, color: "#e62f48", label: "High" },
]}
color="white"
{value}
/>
</div>
Expand All @@ -33,8 +39,20 @@
:global(.gauge-slot-content) {
color: var(--stroke-color);
}
:global(.gauge-indicator) {
:global(.gauge-pointer) {
display: none;
}
}
:global(.segmented) {
width: 125px;
:global(.gauge-progress) {
display: none;
}
:global(.gauge-pointer) {
fill: white;
}
}
</style>
4 changes: 2 additions & 2 deletions src/components/Speedometer.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import Gauge from "$lib/Gauge.svelte";
import { cubicIn, cubicOut } from "svelte/easing";
const palette = ["#ffffff", "#d43008", "#666666"];
const palette = ["#ffffff", "#d43008", "#666666c0"];
let speed = 0;
let rpm = 0;
Expand Down Expand Up @@ -29,7 +29,7 @@
startAngle={45}
stopAngle={360 - 45}
stroke={10}
segments={[{ start: 8000, stop: 10000, color: "#d4300850" }]}
segments={[{ start: 8000, stop: 10000, color: "#d43008" }]}
displayValue={Math.round(speed).toString()}
value={rpm}
color={palette[2]}
Expand Down

0 comments on commit cfd029d

Please sign in to comment.