feat: switch to grid layout

This commit is contained in:
Xyphyn committed 2023-09-22 15:50:30 -07:00
1 parent 3adc9c4d7d
commit 969abeec9d
12 files changed
+104 -24

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
<div
class="fixed opacity-30 isolate inset-x-0 transform-gpu overflow-hidden
blur-3xl -top-80 pointer-events-none"
>
<svg
class="relative left-[calc(50%-11rem)] -z-10 h-[21.1875rem] max-w-none -translate-x-1/2 rotate-[30deg] sm:left-[calc(50%-30rem)] sm:h-[42.375rem]"
viewBox="0 0 1155 678"
>
<path
fill="url(#45de2b6b-92d5-4d68-a6a0-9b9b2abad533)"
fill-opacity=".3"
d="M317.219 518.975L203.852 678 0 438.341l317.219 80.634 204.172-286.402c1.307 132.337 45.083 346.658 209.733 145.248C936.936 126.058 882.053-94.234 1031.02 41.331c119.18 108.451 130.68 295.337 121.53 375.223L855 299l21.173 362.054-558.954-142.079z"
/>
<defs>
<linearGradient
id="45de2b6b-92d5-4d68-a6a0-9b9b2abad533"
x1="1155.49"
x2="-78.208"
y1=".177"
y2="474.645"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#9089FC" />
<stop offset="1" stop-color="#FF80B5" />
</linearGradient>
</defs>
</svg>
</div>
+4 -2
View File
@@ -43,8 +43,10 @@
</script>
<nav
class="flex flex-row gap-2 items-center sticky top-0 bg-slate-50/80
dark:bg-black/80 backdrop-blur-3xl w-full mx-auto px-4 py-2 z-50 box-border h-16"
class="flex flex-row gap-2 items-center sticky top-0 bg-slate-50
dark:bg-black backdrop-blur-3xl w-full mx-auto px-4 py-2 z-10 box-border h-16
{$$props.class}"
style="grid-area: a;"
>
<div class="flex flex-row gap-2 items-center mr-auto">
<a href="/" class="flex flex-row items-center gap-2 logo group">
+1 -1
View File
@@ -1,5 +1,5 @@
<aside
class="sticky top-16 break-words flex
class="sticky break-words flex h-full
flex-col gap-4 p-6 max-w-full 2xl:w-96 w-80 max-h-[calc(100svh-4rem)]
overflow-auto text-sm border-slate-200 dark:border-zinc-800 {$$props.class}"
>
+25 -5
View File
@@ -3,9 +3,11 @@
ArrowLeftOnRectangle,
ChevronDoubleLeft,
Cog6Tooth,
ComputerDesktop,
GlobeAlt,
Home,
Icon,
ServerStack,
UserGroup,
} from 'svelte-hero-icons'
import { profile, profileData } from '$lib/auth.js'
@@ -16,14 +18,16 @@
import { flip } from 'svelte/animate'
import { expoOut } from 'svelte/easing'
import { Button } from 'mono-svelte'
import { site } from '$lib/lemmy.js'
</script>
<nav
class="hidden sm:flex flex-col pl-4 pr-4 py-4 overflow-auto sticky top-16 bottom-0
<aside
class="hidden sm:flex flex-col pl-4 pr-4 py-4 overflow-auto top-16 bottom-0
gap-1 max-h-[calc(100svh-4rem)] w-full bg-slate-50 dark:bg-black
{$userSettings.expandSidebar
? 'max-w-[25%] resize-x min-w-[12rem]'
: 'w-max max-w-max min-w-max'}"
? 'max-w-[35vw] w-[25vw] resize-x min-w-[12rem]'
: 'w-max max-w-max min-w-max'} {$$props.class}"
style="grid-area: b;"
>
<Button
on:click={() =>
@@ -90,4 +94,20 @@
<span class:hidden={!$userSettings.expandSidebar}>Log in</span>
</Button>
{/if}
</nav>
{#if $userSettings.expandSidebar}
<div
class="mt-4 text-slate-600 dark:text-zinc-400 text-sm flex flex-row
items-center gap-4 flex-wrap"
>
<span class="flex gap-1 items-center" title="Lemmy version">
<Icon src={ServerStack} size="16" mini />
{$site?.version}
</span>
<!-- svelte-ignore missing-declaration -->
<span class="flex gap-1 items-center" title="Photon version">
<Icon src={ComputerDesktop} size="16" mini />
{__VERSION__}
</span>
</div>
{/if}
</aside>
+2
View File
@@ -61,6 +61,7 @@ interface Settings {
font: 'inter' | 'system' | 'browser'
leftAlign: boolean
hidePhoton: boolean
glow: boolean
}
export const defaultSettings: Settings = {
@@ -101,6 +102,7 @@ export const defaultSettings: Settings = {
font: 'system',
leftAlign: false,
hidePhoton: toBool(env.PUBLIC_REMOVE_CREDIT) ?? false,
glow: true
}
export const userSettings = writable(defaultSettings)