misc: add slider
This commit is contained in:
1 parent
6f23672278
commit
cb9e1a62e4
4 files changed
+44
-2
No files matched your search
@@ -0,0 +1,37 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let value: number
|
||||||
|
export let min: number = 0
|
||||||
|
export let max: number = 100
|
||||||
|
export let step: number = 1
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="range"
|
||||||
|
bind:value
|
||||||
|
{min}
|
||||||
|
{max}
|
||||||
|
{step}
|
||||||
|
on:change
|
||||||
|
on:click
|
||||||
|
on:keydown
|
||||||
|
on:keypress
|
||||||
|
class="w-full appearance-none h-2 cursor-pointer bg-slate-100 dark:bg-zinc-800
|
||||||
|
rounded-full range"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<style lang="postcss">
|
||||||
|
.range::-moz-range-thumb {
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
@apply border-4 bg-white dark:bg-zinc-900 border-primary-900 dark:border-primary-100;
|
||||||
|
transition: all 0.25s cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.range:hover::-moz-range-thumb {
|
||||||
|
transform: scale(125%);
|
||||||
|
}
|
||||||
|
.range:active::-moz-range-thumb {
|
||||||
|
transform: scale(90%);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { userSettings } from '$lib/settings'
|
||||||
|
|
||||||
export let width = 48
|
export let width = 48
|
||||||
|
|
||||||
const monthColors: {
|
const monthColors: {
|
||||||
@@ -18,7 +20,7 @@
|
|||||||
12: '--hover-color-1: #228B22; --hover-color-2: #FFFFFF;',
|
12: '--hover-color-1: #228B22; --hover-color-2: #FFFFFF;',
|
||||||
}
|
}
|
||||||
|
|
||||||
const getMonthColor = () => monthColors[new Date().getMonth() + 1]
|
$: monthColor = monthColors[new Date().getMonth() + 1]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svg
|
<svg
|
||||||
@@ -28,7 +30,7 @@
|
|||||||
fill="none"
|
fill="none"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
class="inline"
|
class="inline"
|
||||||
style={getMonthColor()}
|
style={monthColor}
|
||||||
>
|
>
|
||||||
<linearGradient
|
<linearGradient
|
||||||
gradientTransform="rotate(315, 0.5, 0.5)"
|
gradientTransform="rotate(315, 0.5, 0.5)"
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ interface Settings {
|
|||||||
tagRules: {
|
tagRules: {
|
||||||
[key: string]: 'hide' | 'blur'
|
[key: string]: 'hide' | 'blur'
|
||||||
}
|
}
|
||||||
|
logoColorMonth: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export const defaultSettings: Settings = {
|
export const defaultSettings: Settings = {
|
||||||
@@ -181,6 +182,7 @@ export const defaultSettings: Settings = {
|
|||||||
nsfl: 'blur',
|
nsfl: 'blur',
|
||||||
nsfw: 'blur',
|
nsfw: 'blur',
|
||||||
},
|
},
|
||||||
|
logoColorMonth: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const userSettings = writable(defaultSettings)
|
export const userSettings = writable(defaultSettings)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
import { locale, locales, t } from '$lib/translations'
|
import { locale, locales, t } from '$lib/translations'
|
||||||
import { defaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
|
import { defaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
import Slider from '$lib/components/input/Slider.svelte'
|
||||||
|
|
||||||
let pin: string = ''
|
let pin: string = ''
|
||||||
let importing = false
|
let importing = false
|
||||||
|
|||||||
Reference in new issue
Block a user