fix: make settings page usable
This commit is contained in:
1 parent
0718c8e0c6
commit
d670f39f0a
11 files changed
+47
-60
No files matched your search
@@ -1,41 +1,45 @@
|
||||
<script lang="ts">
|
||||
export let defaultValue: boolean = false
|
||||
export let checked: boolean = defaultValue
|
||||
export let defaultValue: boolean = false
|
||||
export let checked: boolean = defaultValue
|
||||
|
||||
export let labelClass: string = ''
|
||||
export let labelClass: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<label class="font-normal cursor-pointer flex flex-row items-start gap-4 group {class}">
|
||||
<div
|
||||
class="w-11 h-6 rounded-full relative z-[inherit] cursor-pointer flex flex-row transition-colors shadow-sm
|
||||
{checked ? 'bg-primary-900 dark:bg-primary-100' : 'bg-slate-200 dark:bg-zinc-800'}
|
||||
<label
|
||||
class="font-normal cursor-pointer flex flex-row items-start gap-4 group {clazz}"
|
||||
>
|
||||
<div
|
||||
class="w-11 h-6 rounded-full relative z-[inherit] cursor-pointer flex flex-row transition-colors shadow-sm
|
||||
{checked
|
||||
? 'bg-primary-900 dark:bg-primary-100'
|
||||
: 'bg-slate-200 dark:bg-zinc-800'}
|
||||
p-0.5 flex-shrink-0"
|
||||
>
|
||||
<input
|
||||
bind:checked
|
||||
type="checkbox"
|
||||
class="peer appearance-none absolute top-0 left-0 w-full h-full cursor-pointer z-10"
|
||||
/>
|
||||
<div
|
||||
class="box-border w-5 h-full bg-white peer-checked:dark:bg-black rounded-full shadow-sm
|
||||
>
|
||||
<input
|
||||
bind:checked
|
||||
type="checkbox"
|
||||
class="peer appearance-none absolute top-0 left-0 w-full h-full cursor-pointer z-10"
|
||||
/>
|
||||
<div
|
||||
class="box-border w-5 h-full bg-white peer-checked:dark:bg-black rounded-full shadow-sm
|
||||
group-active:w-6 transition peer-checked:translate-x-5 group-active:peer-checked:translate-x-4
|
||||
rtl:peer-checked:-translate-x-5 rtl:group-active:peer-checked:-translate-x-4"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col {labelClass}">
|
||||
<slot />
|
||||
{#if $$slots.description}
|
||||
<span class="font-normal text-sm text-slate-700 dark:text-zinc-300">
|
||||
<slot name="description" />
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col {labelClass}">
|
||||
<slot />
|
||||
{#if $$slots.description}
|
||||
<span class="font-normal text-sm text-slate-700 dark:text-zinc-300">
|
||||
<slot name="description" />
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<style>
|
||||
.transition {
|
||||
transition: all 500ms cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
}
|
||||
.transition {
|
||||
transition: all 500ms cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user