diff options
| author | Adam Soltys <[email protected]> | 2023-02-22 19:38:55 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-23 00:31:21 -0800 |
| commit | 50b270db6fda60b5b3e39a9dbada5c27a14cbad1 (patch) | |
| tree | 6cc2ce81bd703aab912f3594d8c1c2086fcc731d /src/components | |
| parent | c1c019beae03bbebde70557e1d0a9e064a48927c (diff) | |
| download | coinos-ui-50b270db6fda60b5b3e39a9dbada5c27a14cbad1.tar.gz coinos-ui-50b270db6fda60b5b3e39a9dbada5c27a14cbad1.zip | |
fee slider wip
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Slider.svelte | 56 | ||||
| -rw-r--r-- | src/components/index.js | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/src/components/Slider.svelte b/src/components/Slider.svelte new file mode 100644 index 00000000..84482c9d --- /dev/null +++ b/src/components/Slider.svelte @@ -0,0 +1,56 @@ +<script> + export let value, + handle, + min = 0, + max = 100; +</script> + +<input + id="slider" + type="range" + {min} + {max} + bind:value={value} + class="px-0 py-0 my-5" + style="--bgPercent: {(value - min) * 100/(max - min)}%;" + on:input={handle} +/> + +<style> + #slider { + -webkit-appearance: none; + width: 100%; + height: 6px; + border-radius: 5px; + background: linear-gradient( + to right, + black 0%, + black var(--bgPercent), + #f5f7fa var(--bgPercent), + #f5f7fa 100% + ); + outline: none; + } + + #slider:active { + background-color: black; + } + + #slider::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 30px; + height: 30px; + border-radius: 50%; + background: black; + cursor: pointer; + } + + #slider::-moz-range-thumb { + width: 30px; + height: 30px; + border-radius: 50%; + background: black; + cursor: pointer; + } +</style> diff --git a/src/components/index.js b/src/components/index.js index ab54e09f..0d1d8d1d 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,3 +1,4 @@ +export { default as Slider } from './Slider.svelte'; export { default as Pinpad } from './Pinpad.svelte'; export { default as Balance } from './Balance.svelte'; export { default as Lnurlp } from './Lnurlp.svelte'; |
