refactor: 💄 Add max width to settings pages

This commit is contained in:
Jesse Wierzbinski 2024-07-21 17:58:40 +02:00
parent ddfa3b050d
commit 4e370cd056
No known key found for this signature in database
2 changed files with 32 additions and 28 deletions

View file

@ -1,31 +1,35 @@
<template> <template>
<div class="w-full px-8 py-4 bg-dark-700 hover:bg-dark-500 duration-100"> <div class="w-full px-8 py-4 bg-dark-700 hover:bg-dark-500 duration-100 h-full">
<Switch.Root v-model:checked="checked" class="grid grid-cols-[1fr_auto] gap-x-4" <div class="max-w-7xl mx-auto h-full">
@click="setting.notImplemented ? $event.preventDefault() : undefined" <Switch.Root v-model:checked="checked" class="grid grid-cols-[1fr_auto] gap-x-4"
v-if="setting.type === SettingType.Boolean" @update:checked="c => checked = c"> @click="setting.notImplemented ? $event.preventDefault() : undefined"
<Switch.Label :data-disabled="setting.notImplemented ? '' : undefined" v-if="setting.type === SettingType.Boolean" @update:checked="c => checked = c">
class="row-start-1 select-none text-base/6 data-[disabled]:opacity-50 sm:text-sm/6 text-white font-semibold"> <Switch.Label :data-disabled="setting.notImplemented ? '' : undefined"
{{ class="row-start-1 select-none text-base/6 data-[disabled]:opacity-50 sm:text-sm/6 text-white font-semibold">
setting.title {{
}}</Switch.Label> setting.title
<p v-if="setting.notImplemented" class="text-xs mt-1 row-start-3 text-red-300 font-semibold">Not implemented }}</Switch.Label>
</p> <p v-if="setting.notImplemented" class="text-xs mt-1 row-start-3 text-red-300 font-semibold">Not
<p v-else :data-disabled="setting.notImplemented ? '' : undefined" implemented
class="text-base/6 row-start-2 data-[disabled]:opacity-50 sm:text-sm/6 text-gray-300">{{ </p>
setting.description }} <p v-else :data-disabled="setting.notImplemented ? '' : undefined"
</p> class="text-base/6 row-start-2 data-[disabled]:opacity-50 sm:text-sm/6 text-gray-300">{{
<Switch.Control :data-disabled="setting.notImplemented ? '' : undefined" setting.description }}
:data-checked="checked ? '' : undefined" </p>
class="group col-start-2 relative isolate inline-flex h-6 w-10 cursor-default rounded-full p-[3px] sm:h-5 sm:w-8 transition duration-0 ease-in-out data-[changing]:duration-200 forced-colors:outline forced-colors:[--switch-bg:Highlight] ring-1 ring-inset bg-white/5 ring-white/15 data-[checked]:bg-[--switch-bg] data-[checked]:ring-[--switch-bg-ring] focus:outline-none focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-500 hover:data-[checked]:ring-[--switch-bg-ring] hover:ring-white/25 data-[disabled]:bg-zinc-200 data-[disabled]:data-[checked]:bg-zinc-200 data-[disabled]:opacity-50 data-[disabled]:bg-white/15 data-[disabled]:data-[checked]:bg-white/15 data-[disabled]:data-[checked]:ring-white/15 [--switch-bg-ring:transparent] [--switch-bg:theme(colors.primary.600/25%)] [--switch-shadow:theme(colors.black/10%)] [--switch:white] [--switch-ring:theme(colors.white/10%)]"> <Switch.Control :data-disabled="setting.notImplemented ? '' : undefined"
<Switch.Thumb :data-checked="checked ? '' : undefined"
class="pointer-events-none relative inline-block size-[1.125rem] rounded-full sm:size-3.5 translate-x-0 transition duration-200 ease-in-out border border-transparent bg-white shadow ring-1 ring-black/5 group-data-[checked]:bg-[--switch] group-data-[checked]:shadow-[--switch-shadow] group-data-[checked]:ring-[--switch-ring] group-data-[checked]:translate-x-4 sm:group-data-[checked]:translate-x-3 group-data-[disabled]:group-data-[checked]:bg-white group-data-[disabled]:group-data-[checked]:shadow group-data-[disabled]:group-data-[checked]:ring-black/5" /> class="group col-start-2 relative isolate inline-flex h-6 w-10 cursor-default rounded-full p-[3px] sm:h-5 sm:w-8 transition duration-0 ease-in-out data-[changing]:duration-200 forced-colors:outline forced-colors:[--switch-bg:Highlight] ring-1 ring-inset bg-white/5 ring-white/15 data-[checked]:bg-[--switch-bg] data-[checked]:ring-[--switch-bg-ring] focus:outline-none focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-500 hover:data-[checked]:ring-[--switch-bg-ring] hover:ring-white/25 data-[disabled]:bg-zinc-200 data-[disabled]:data-[checked]:bg-zinc-200 data-[disabled]:opacity-50 data-[disabled]:bg-white/15 data-[disabled]:data-[checked]:bg-white/15 data-[disabled]:data-[checked]:ring-white/15 [--switch-bg-ring:transparent] [--switch-bg:theme(colors.primary.600/25%)] [--switch-shadow:theme(colors.black/10%)] [--switch:white] [--switch-ring:theme(colors.white/10%)]">
</Switch.Control> <Switch.Thumb
<Switch.HiddenInput /> class="pointer-events-none relative inline-block size-[1.125rem] rounded-full sm:size-3.5 translate-x-0 transition duration-200 ease-in-out border border-transparent bg-white shadow ring-1 ring-black/5 group-data-[checked]:bg-[--switch] group-data-[checked]:shadow-[--switch-shadow] group-data-[checked]:ring-[--switch-ring] group-data-[checked]:translate-x-4 sm:group-data-[checked]:translate-x-3 group-data-[disabled]:group-data-[checked]:bg-white group-data-[disabled]:group-data-[checked]:shadow group-data-[disabled]:group-data-[checked]:ring-black/5" />
</Switch.Root> </Switch.Control>
<div v-else class="grid grid-cols-[1fr_auto] gap-x-4"> <Switch.HiddenInput />
<h4 class="row-start-1 select-none text-base/6 sm:text-sm/6 text-white font-semibold">{{ setting.title }} </Switch.Root>
</h4> <div v-else class="grid grid-cols-[1fr_auto] gap-x-4">
<p class="text-xs mt-1 row-start-3 text-red-300 font-semibold">Not implemented</p> <h4 class="row-start-1 select-none text-base/6 sm:text-sm/6 text-white font-semibold">{{ setting.title
}}
</h4>
<p class="text-xs mt-1 row-start-3 text-red-300 font-semibold">Not implemented</p>
</div>
</div> </div>
</div> </div>
</template> </template>

View file

@ -1,6 +1,6 @@
<template> <template>
<aside <aside
class="fixed h-dvh z-10 md:flex hidden flex-col p-4 bg-dark-800 gap-10 max-w-20 hover:max-w-72 w-full duration-200 group ring-1 ring-dark-500" class="fixed h-dvh z-10 md:flex hidden flex-col p-4 bg-dark-800 gap-10 max-w-[80px] hover:max-w-72 w-full duration-200 group ring-1 ring-dark-500"
aria-label="Navigation" role="complementary"> aria-label="Navigation" role="complementary">
<NuxtLink href="/"> <NuxtLink href="/">
<img crossorigin="anonymous" class="size-11 rounded ring-1 ring-white/10 hover:scale-105 duration-200" <img crossorigin="anonymous" class="size-11 rounded ring-1 ring-white/10 hover:scale-105 duration-200"