diff --git a/src/lib/ElegantKnob.svelte b/src/lib/ElegantKnob.svelte new file mode 100644 index 0000000..d2956fe --- /dev/null +++ b/src/lib/ElegantKnob.svelte @@ -0,0 +1,109 @@ + + +
+
+ +
+ + + {#if value >= min && value <= max} + + {/if} + + {#each ticks as {angle}} + + {/each} + + + {#if label} +
+ {label} +
+ {/if} +
+ + diff --git a/src/lib/MinimalKnob.svelte b/src/lib/MinimalKnob.svelte index e40c054..b0a367f 100644 --- a/src/lib/MinimalKnob.svelte +++ b/src/lib/MinimalKnob.svelte @@ -16,7 +16,7 @@ export let size = '5rem'; export let strokeWidth = 8; export let bgColor = '#fff'; - export let fgColor = '#7f9fff'; + export let valueColor = '#7f9fff'; export let label: string | undefined = undefined; @@ -31,7 +31,7 @@ use:knobdrag="{knobParams}" /> - import MinimalKnob from '$lib/MinimalKnob.svelte'; + import Knob from '$lib/ElegantKnob.svelte'; import Options from '$lib/Options.svelte'; import Color from 'colorjs.io'; import {browser} from '$app/env'; @@ -12,11 +12,13 @@ let value = writable(0); let darkMode = true; let color = 'rebeccapurple'; - let fontColor = '#fff'; + let textColor = '#fff'; + let inverseTextColor = '#000'; value.subscribe($value => { color = gradient($value / 100); darkMode = $value < 66; - fontColor = darkMode ? '#fff' : '#000'; + textColor = darkMode ? '#fff' : '#000'; + inverseTextColor = darkMode ? '#000' : '#fff'; if (browser) document.body.style.background = color; }); @@ -30,22 +32,23 @@ -
+
-

A knob with usable controls similar to those in DJ software

-
+
Options