feat: new centered layout
This commit is contained in:
1 parent
0d08df2ad5
commit
f617f54334
11 files changed
+179
-70
No files matched your search
@@ -30,9 +30,15 @@
|
||||
slot="prefix"
|
||||
/>
|
||||
</div>
|
||||
<span class="max-w-full break-words" class:hidden={!expanded}>
|
||||
{follow.title}
|
||||
</span>
|
||||
<div
|
||||
class="flex flex-col max-w-full break-words"
|
||||
class:hidden={!expanded}
|
||||
>
|
||||
<span>{follow.title}</span>
|
||||
<span class="text-xs text-slate-600 dark:text-zinc-400">
|
||||
{new URL(follow.actor_id).hostname}
|
||||
</span>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
{/each}
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {
|
||||
ArrowLeftOnRectangle,
|
||||
ChevronDoubleLeft,
|
||||
Cog6Tooth,
|
||||
GlobeAlt,
|
||||
Home,
|
||||
@@ -18,16 +17,19 @@
|
||||
import { flip } from 'svelte/animate'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
import { Button } from 'mono-svelte'
|
||||
|
||||
export let route = ''
|
||||
</script>
|
||||
|
||||
<nav
|
||||
class="hidden sm:flex flex-col pl-4 pr-4 py-4 overflow-auto sticky top-16 bottom-0
|
||||
gap-1 max-h-[calc(100svh-4rem)] w-full bg-slate-50 dark:bg-black
|
||||
class="flex flex-col pl-4 pr-4 py-4 overflow-auto
|
||||
gap-1 max-h-[calc(100svh-4rem)]
|
||||
{$userSettings.expandSidebar
|
||||
? 'max-w-[25%] resize-x min-w-[12rem]'
|
||||
? ''
|
||||
: 'w-max max-w-max min-w-max'} {$$props.class}"
|
||||
style={$$props.style}
|
||||
>
|
||||
<Button
|
||||
<!-- <Button
|
||||
on:click={() =>
|
||||
($userSettings.expandSidebar = !$userSettings.expandSidebar)}
|
||||
class="w-max !p-2"
|
||||
@@ -42,18 +44,23 @@
|
||||
: 'rotate-180'}"
|
||||
title="Toggle Sidebar"
|
||||
/>
|
||||
</Button>
|
||||
</Button> -->
|
||||
<SidebarButton href="/" expanded={$userSettings.expandSidebar}>
|
||||
<Icon src={Home} mini size="20" title="Frontpage" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Frontpage</span>
|
||||
<Icon src={Home} mini={route == '/'} size="20" title="Frontpage" />
|
||||
<span>Frontpage</span>
|
||||
</SidebarButton>
|
||||
<SidebarButton href="/settings" expanded={$userSettings.expandSidebar}>
|
||||
<Icon src={Cog6Tooth} mini size="20" title="Settings" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Settings</span>
|
||||
<Icon
|
||||
src={Cog6Tooth}
|
||||
mini={route == '/settings'}
|
||||
size="20"
|
||||
title="Settings"
|
||||
/>
|
||||
<span>Settings</span>
|
||||
</SidebarButton>
|
||||
<SidebarButton expanded={$userSettings.expandSidebar} href="/communities">
|
||||
<Icon mini src={GlobeAlt} size="20" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Communities</span>
|
||||
<Icon mini={route == '/communities'} src={GlobeAlt} size="20" />
|
||||
<span>Communities</span>
|
||||
</SidebarButton>
|
||||
{#if $profileData.profiles.length >= 1}
|
||||
<hr class="border-slate-300 dark:border-zinc-800 my-1" />
|
||||
@@ -64,7 +71,7 @@
|
||||
{/each}
|
||||
<SidebarButton href="/accounts" expanded={$userSettings.expandSidebar}>
|
||||
<Icon src={UserGroup} mini size="20" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Accounts</span>
|
||||
<span>Accounts</span>
|
||||
</SidebarButton>
|
||||
{/if}
|
||||
<hr class="border-slate-300 dark:border-zinc-800 my-1" />
|
||||
@@ -90,7 +97,7 @@
|
||||
title="Log In"
|
||||
>
|
||||
<Icon mini src={ArrowLeftOnRectangle} size="20" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Log In</span>
|
||||
<span>Log In</span>
|
||||
</Button>
|
||||
<Button
|
||||
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}"
|
||||
@@ -100,7 +107,7 @@
|
||||
title="Sign Up"
|
||||
>
|
||||
<Icon mini src={Identification} size="20" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Sign Up</span>
|
||||
<span>Sign Up</span>
|
||||
</Button>
|
||||
<Button
|
||||
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}"
|
||||
@@ -110,7 +117,7 @@
|
||||
title="Change Instance"
|
||||
>
|
||||
<Icon mini src={ServerStack} size="20" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Change instance</span>
|
||||
<span>Change instance</span>
|
||||
</Button>
|
||||
{/if}
|
||||
</nav>
|
||||
Reference in new issue
Block a user