keep mobile landscape in the compact nav layout

This commit is contained in:
nayan9617
2026-04-02 23:59:34 +05:30
parent c882198206
commit 0e98b14789
3 changed files with 48 additions and 34 deletions
+10
View File
@@ -245,6 +245,16 @@
@apply content-sizing content-padding-x content-padding-y; @apply content-sizing content-padding-x content-padding-y;
} }
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 800px) {
.compact-landscape-hidden {
display: none !important;
}
.compact-landscape-flex {
display: flex !important;
}
}
.heading { .heading {
@apply text-center text-2xl; @apply text-center text-2xl;
} }
+37 -33
View File
@@ -29,47 +29,51 @@
const anySpaceNotifications = $derived($userSpaceUrls.some(p => $notifications.has(p))) const anySpaceNotifications = $derived($userSpaceUrls.some(p => $notifications.has(p)))
</script> </script>
<div <div class="flex h-full min-h-[100dvh] overflow-hidden">
class="ml-sai mt-sai mb-sai relative z-nav hidden w-14 flex-shrink-0 bg-base-200 pt-4 md:block"> <div
<div class="flex h-full flex-col" class:justify-between={PLATFORM_RELAYS.length === 0}> class="ml-sai mt-sai mb-sai relative z-nav hidden w-14 flex-shrink-0 bg-base-200 pt-4 md:block compact-landscape-hidden">
<PrimaryNavSpaces /> <div class="flex h-full flex-col" class:justify-between={PLATFORM_RELAYS.length === 0}>
{#if PLATFORM_RELAYS.length > 0} <PrimaryNavSpaces />
<Divider /> {#if PLATFORM_RELAYS.length > 0}
{/if} <Divider />
<div> {/if}
<PrimaryNavItem <div>
title="Settings" <PrimaryNavItem
href="/settings/profile" title="Settings"
prefix="/settings" href="/settings/profile"
class="tooltip-right"> prefix="/settings"
{#if $userProfile?.picture} class="tooltip-right">
<ImageIcon alt="Settings" src={$userProfile?.picture} class="rounded-full" size={10} /> {#if $userProfile?.picture}
{:else} <ImageIcon alt="Settings" src={$userProfile?.picture} class="rounded-full" size={10} />
<ImageIcon alt="Settings" src={UserRounded} class="rounded-full" size={8} /> {:else}
{/if} <ImageIcon alt="Settings" src={UserRounded} class="rounded-full" size={8} />
</PrimaryNavItem> {/if}
<PrimaryNavItem </PrimaryNavItem>
title="Messages" <PrimaryNavItem
onclick={chatHandler} title="Messages"
class="tooltip-right" onclick={chatHandler}
notification={$notifications.has("/chat")}> class="tooltip-right"
<ImageIcon alt="Messages" src={Letter} size={8} /> notification={$notifications.has("/chat")}>
</PrimaryNavItem> <ImageIcon alt="Messages" src={Letter} size={8} />
<PrimaryNavItem title="Search" href="/people" class="tooltip-right"> </PrimaryNavItem>
<ImageIcon alt="Search" src={Magnifier} size={8} /> <PrimaryNavItem title="Search" href="/people" class="tooltip-right">
</PrimaryNavItem> <ImageIcon alt="Search" src={Magnifier} size={8} />
</PrimaryNavItem>
</div>
</div> </div>
</div> </div>
<div class="min-w-0 flex-1 overflow-hidden">
{@render children?.()}
</div>
</div> </div>
{@render children?.()}
<!-- a little extra something for ios --> <!-- a little extra something for ios -->
<div <div
class="bottom-nav hide-on-keyboard fixed bottom-0 left-0 right-0 z-nav h-[var(--saib)] bg-base-100 md:hidden"> class="bottom-nav hide-on-keyboard fixed bottom-0 left-0 right-0 z-nav h-[var(--saib)] bg-base-100 md:hidden compact-landscape-flex">
</div> </div>
<div <div
class="bottom-nav hide-on-keyboard border-top bottom-sai fixed left-0 right-0 z-nav h-14 border border-base-200 bg-base-100 md:hidden"> class="bottom-nav hide-on-keyboard border-top bottom-sai fixed left-0 right-0 z-nav h-14 border border-base-200 bg-base-100 md:hidden compact-landscape-flex">
<div class="content-padding-x content-sizing flex justify-between px-2"> <div class="content-padding-x content-sizing flex justify-between px-2">
<div class="flex gap-2 sm:gap-6"> <div class="flex gap-2 sm:gap-6">
<PrimaryNavItem title="Search" href="/people"> <PrimaryNavItem title="Search" href="/people">
+1 -1
View File
@@ -12,7 +12,7 @@
<div <div
class={cx( class={cx(
"ml-sai mt-sai mb-sai max-h-screen w-60 sm:flex-shrink-0 flex-col gap-1 bg-base-300 z-nav hidden md:flex", "ml-sai mt-sai mb-sai max-h-screen w-60 sm:flex-shrink-0 flex-col gap-1 bg-base-300 z-nav hidden md:flex compact-landscape-hidden",
props.class, props.class,
)}> )}>
{@render children?.()} {@render children?.()}