misc: add slider

This commit is contained in:
Xylight committed 2024-08-04 20:54:26 -07:00
1 parent 6f23672278
commit cb9e1a62e4
4 files changed
+44 -2

No files matched your search

+37
View File
@@ -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>
+4 -2
View File
@@ -1,4 +1,6 @@
<script lang="ts">
import { userSettings } from '$lib/settings'
export let width = 48
const monthColors: {
@@ -18,7 +20,7 @@
12: '--hover-color-1: #228B22; --hover-color-2: #FFFFFF;',
}
const getMonthColor = () => monthColors[new Date().getMonth() + 1]
$: monthColor = monthColors[new Date().getMonth() + 1]
</script>
<svg
@@ -28,7 +30,7 @@
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="inline"
style={getMonthColor()}
style={monthColor}
>
<linearGradient
gradientTransform="rotate(315, 0.5, 0.5)"
+2
View File
@@ -101,6 +101,7 @@ interface Settings {
tagRules: {
[key: string]: 'hide' | 'blur'
}
logoColorMonth: number | null
}
export const defaultSettings: Settings = {
@@ -181,6 +182,7 @@ export const defaultSettings: Settings = {
nsfl: 'blur',
nsfw: 'blur',
},
logoColorMonth: null,
}
export const userSettings = writable(defaultSettings)
+1
View File
@@ -44,6 +44,7 @@
import { locale, locales, t } from '$lib/translations'
import { defaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import Slider from '$lib/components/input/Slider.svelte'
let pin: string = ''
let importing = false