feat: add panel mode and allow shifting of dock
This commit is contained in:
1 parent
91c5a88509
commit
6ffd3ceb99
9 files changed
+148
-14
No files matched your search
@@ -6,6 +6,35 @@
|
||||
export let route: { id: string | null } | undefined = undefined
|
||||
|
||||
$: title = route ? routes[(route.id as keyof typeof routes) ?? ''] : ''
|
||||
|
||||
const calculatePadding = (
|
||||
panel: boolean,
|
||||
top: boolean,
|
||||
content: boolean
|
||||
): string => {
|
||||
if (panel) {
|
||||
if (top) return '!pt-22'
|
||||
else return '!pb-22'
|
||||
} else {
|
||||
if (!content) return ''
|
||||
|
||||
if (top) return '!pt-24'
|
||||
else return '!pb-24'
|
||||
}
|
||||
|
||||
return 'hi this is easter egg, my code broke'
|
||||
}
|
||||
|
||||
$: contentPadding = calculatePadding(
|
||||
$userSettings.dock.noGap,
|
||||
$userSettings.dock.top,
|
||||
true
|
||||
)
|
||||
$: sidePadding = calculatePadding(
|
||||
$userSettings.dock.noGap,
|
||||
$userSettings.dock.top,
|
||||
false
|
||||
)
|
||||
</script>
|
||||
|
||||
<div class="shell {$$props.class}" style={colorsToVars($colors)}>
|
||||
@@ -17,28 +46,41 @@
|
||||
>
|
||||
<slot
|
||||
name="sidebar"
|
||||
class="hidden md:flex sticky top-0 left-0 w-full max-w-full bg-slate-50 dark:bg-zinc-950"
|
||||
class="hidden md:flex sticky top-0 left-0 w-full max-w-full bg-slate-50 dark:bg-zinc-950
|
||||
{sidePadding}"
|
||||
style="grid-area: sidebar; width: 100% !important;"
|
||||
/>
|
||||
<slot
|
||||
name="main"
|
||||
class="w-full bg-slate-25 dark:bg-zinc-925 justify-self-center shadow-sm !pb-24"
|
||||
class="w-full bg-slate-25 dark:bg-zinc-925 justify-self-center shadow-sm
|
||||
{contentPadding}"
|
||||
style="grid-area: main"
|
||||
/>
|
||||
<slot
|
||||
name="suffix"
|
||||
class="max-xl:hidden w-full sticky top-0 left-0 h-max bg-slate-50 dark:bg-zinc-950"
|
||||
class="max-xl:hidden w-full sticky top-0 left-0 h-max bg-slate-50 dark:bg-zinc-950
|
||||
{sidePadding}"
|
||||
style="grid-area: suffix;"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="p-4 w-full fixed bottom-0 z-50 max-w-3xl left-1/2 -translate-x-1/2"
|
||||
class="
|
||||
{$userSettings.dock.noGap ? '' : 'p-4 max-w-3xl left-1/2 -translate-x-1/2'}
|
||||
{$userSettings.dock.top ? 'top-0' : 'bottom-0'}
|
||||
w-full fixed z-50 pointer-events-none"
|
||||
style="grid-area: navbar;"
|
||||
>
|
||||
<slot
|
||||
name="navbar"
|
||||
class="border rounded-full border-slate-200 dark:border-zinc-800 shadow-2xl
|
||||
backdrop-blur-xl dark:backdrop-brightness-[25%] bg-[#ffffff]/75 dark:bg-transparent transition-colors duration-500"
|
||||
class="
|
||||
{$userSettings.dock.noGap
|
||||
? $userSettings.dock.top
|
||||
? 'border-b'
|
||||
: 'border-t'
|
||||
: 'border rounded-full'}
|
||||
border-slate-200 dark:border-zinc-800 shadow-2xl
|
||||
backdrop-blur-xl dark:backdrop-brightness-[25%] bg-[#ffffff]/75 dark:bg-transparent transition-colors duration-500
|
||||
pointer-events-auto"
|
||||
style="grid-area: navbar"
|
||||
{title}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user