Skip to content

Commit 49874de

Browse files
committed
wip: improve menu
1 parent 7b4a394 commit 49874de

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

‎web/layouts/default.vue‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const copyrightFooter = `${new Date().getUTCFullYear()} erikb.dev, All rights re
88
99
useHead({
1010
titleTemplate(title) {
11-
return title ? `${title} | ` : "" + "erikb.dev";
11+
return (title ? `${title} | ` : "") + "erikb.dev";
1212
},
1313
meta: [
1414
{ name: "charset", content: "utf-8" },
@@ -50,8 +50,8 @@ function closeMenu() {
5050
}
5151
</script>
5252
<template>
53-
<BlockSection as="header" fill :divider="false" class="fixed! top-0 z-50 bg-base/80! backdrop-blur-sm! h-(--header-height)">
54-
<nav class="flex flex-none justify-between py-3 px-6 text-sm md:max-w-2xl mx-auto md:border-border md:border-x">
53+
<BlockSection as="header" fill :divider="false" class="fixed! flex flex-col top-0 z-50" :class="{ 'bg-base/80! backdrop-blur-sm!': !showMenuDialog, 'h-full': showMenuDialog }">
54+
<nav class="w-full h-(--header-height) flex flex-none justify-between py-3 px-6 text-sm md:max-w-2xl mx-auto md:border-border md:border-x">
5555
<NuxtLink to="/" class="self-center" @click="closeMenu">
5656
<code class="text-white font-bold">erikb.dev()</code>
5757
</NuxtLink>
@@ -60,10 +60,23 @@ function closeMenu() {
6060
<code v-else>{{ "close x" }}</code>
6161
</button>
6262
</nav>
63+
64+
<template v-if="showMenuDialog">
65+
<BlockSection :divider="false" class="w-full flex-1 flex flex-col">
66+
<ul class="grow">
67+
<li v-for="item in menuItems" class="text-[3rem] leading-none font-bold mb-2.5 *:hover:underline *:hover:decoration-2 *:hover:underline-offset-3" :class="{ 'text-primary': route.path === item.path }">
68+
<NuxtLink :to="item.path" @click="closeMenu">{{ item.name }}</NuxtLink>
69+
</li>
70+
</ul>
71+
</BlockSection>
72+
<BlockSection as="footer" :divider="false" class="border-b-0">
73+
<code class="text-sm text-neutral-300"><span class="size-[1em] inline-block mr-0.5 *:mt-0.5" v-html="PhCopyrightSVG"></span>{{ copyrightFooter }}</code>
74+
</BlockSection>
75+
</template>
6376
</BlockSection>
6477
<main class="relative pt-[100lvh]">
65-
<BlockSection fill class="h-screen mt-[-100lvh] fixed! border-0 -z-10" :divider="false">
66-
<TresCanvas class="bg-base">
78+
<BlockSection fill class="fixed! h-screen mt-[-100lvh] border-0 -z-10" :divider="false">
79+
<TresCanvas class="bg-base" shadows>
6780
<HorizonWorld />
6881
</TresCanvas>
6982
</BlockSection>
@@ -72,17 +85,4 @@ function closeMenu() {
7285
<BlockSection as="footer" :divider="false" class="border-b-0">
7386
<code class="text-sm text-neutral-300"><span class="size-[1em] inline-block mr-0.5 *:mt-0.5" v-html="PhCopyrightSVG"></span>{{ copyrightFooter }}</code>
7487
</BlockSection>
75-
76-
<div v-if="showMenuDialog" class="fixed top-0 left-0 pt-13 bg-base w-full h-screen overscroll-y-auto">
77-
<BlockSection :divider="false" class="w-full h-full flex flex-col">
78-
<ul class="grow">
79-
<li v-for="item in menuItems" class="text-[3rem] leading-none font-bold mb-2.5 hover:underline hover:decoration-2 hover:underline-offset-3" :class="{ 'text-primary': route.path === item.path }">
80-
<NuxtLink :to="item.path" @click="closeMenu">{{ item.name }}</NuxtLink>
81-
</li>
82-
</ul>
83-
<footer>
84-
<code class="text-sm text-neutral-300"><span class="size-[1em] inline-block mr-0.5 *:mt-0.5" v-html="PhCopyrightSVG"></span>{{ copyrightFooter }}</code>
85-
</footer>
86-
</BlockSection>
87-
</div>
8888
</template>

0 commit comments

Comments
 (0)