|
1 | 1 | <template> |
2 | 2 | <header |
3 | 3 | v-if="data" |
4 | | - class="fixed inset-x-0 w-[90vw] mx-auto bg-white/30 rounded-full mt-4 backdrop-blur-sm z-50 shadow-lg" |
| 4 | + class="fixed inset-x-0 w-[90vw] mx-auto bg-white/70 md:bg-white/50 rounded-full mt-4 backdrop-blur-xs z-50 shadow-lg" |
5 | 5 | > |
6 | 6 | <nav class="flex items-center justify-between p-4"> |
7 | 7 | <NuxtLink |
8 | 8 | :to="data.title.link" |
9 | 9 | :aria-label="data.title.ariaLabel" |
10 | | - class="font-heading text-2xl flex items-center gap-2" |
| 10 | + class="font-heading text-xl lg:text-2xl flex items-center gap-2" |
11 | 11 | > |
12 | 12 | <UIcon name="fluent-emoji-high-contrast:leaf-fluttering-in-wind" /> |
13 | 13 | {{ data.title.text }} |
14 | 14 | </NuxtLink> |
15 | | - <div class="flex items-center gap-6"> |
| 15 | + <div class="hidden md:flex items-center text-sm lg:text-base gap-6 lg:gap-9"> |
16 | 16 | <NuxtLink |
17 | 17 | v-for="page in data.pages" |
18 | 18 | :key="page.text" |
19 | 19 | :to="page.link" |
20 | 20 | :aria-label="page.text" |
21 | | - class="" |
22 | 21 | > |
23 | 22 | {{ page.text }} |
24 | 23 | </NuxtLink> |
25 | 24 | </div> |
26 | 25 | <NuxtLink |
27 | 26 | :to="data.contact.link" |
28 | 27 | :aria-label="data.contact.ariaLabel" |
29 | | - class="flex items-center gap-1 rounded-full px-8 py-2 bg-black text-white" |
| 28 | + class="hidden md:flex items-center text-xs rounded-full px-4 py-1 bg-black text-white lg:text-sm lg:px-6 hover:bg-gray-600 transition-colors" |
30 | 29 | > |
31 | | - <!-- <UIcon name="line-md:chat-round-dots-filled" /> --> |
32 | 30 | {{ data.contact.text }} |
33 | 31 | </NuxtLink> |
| 32 | + |
| 33 | + <UDrawer |
| 34 | + v-model:open="isOpen" |
| 35 | + direction="right" |
| 36 | + :handle="false" |
| 37 | + should-scale-background |
| 38 | + set-background-color-on-scale |
| 39 | + > |
| 40 | + <UButton |
| 41 | + color="neutral" |
| 42 | + variant="ghost" |
| 43 | + size="xl" |
| 44 | + trailing-icon="line-md:align-justify" |
| 45 | + class="mr-2 md:hidden h-10 w-10 hover:bg-black/10 hover:text-black transition-colors" |
| 46 | + /> |
| 47 | + |
| 48 | + <template #content> |
| 49 | + <div class="min-w-75 min-h-96 size-full m-4"> |
| 50 | + <UButton |
| 51 | + color="neutral" |
| 52 | + variant="ghost" |
| 53 | + size="xl" |
| 54 | + trailing-icon="line-md:close" |
| 55 | + class="pt-4 h-10 w-10 hover:bg-black/10 hover:text-black transition-colors" |
| 56 | + @click="closeDrawer" |
| 57 | + /> |
| 58 | + <div class="flex flex-col items-center text-l gap-12 pt-12"> |
| 59 | + <NuxtLink |
| 60 | + :to="data.title.link" |
| 61 | + :aria-label="data.title.ariaLabel" |
| 62 | + class="font-heading text-2xl flex items-center gap-2" |
| 63 | + @click="closeDrawer" |
| 64 | + > |
| 65 | + <UIcon name="fluent-emoji-high-contrast:leaf-fluttering-in-wind" /> |
| 66 | + {{ data.title.text }} |
| 67 | + </NuxtLink> |
| 68 | + <NuxtLink |
| 69 | + v-for="page in data.pages" |
| 70 | + :key="page.text" |
| 71 | + :to="page.link" |
| 72 | + :aria-label="page.text" |
| 73 | + class="w-full text-center text-l" |
| 74 | + @click="closeDrawer" |
| 75 | + > |
| 76 | + {{ page.text }} |
| 77 | + </NuxtLink> |
| 78 | + <NuxtLink |
| 79 | + :to="data.contact.link" |
| 80 | + :aria-label="data.contact.ariaLabel" |
| 81 | + class="flex items-center w-full rounded-full bg-black hover:bg-gray-600 transition-colors" |
| 82 | + @click="closeDrawer" |
| 83 | + > |
| 84 | + <p class="text-white text-l mx-6 my-2 w-full text-center"> |
| 85 | + {{ data.contact.text }} |
| 86 | + </p> |
| 87 | + </NuxtLink> |
| 88 | + </div> |
| 89 | + </div> |
| 90 | + </template> |
| 91 | + </UDrawer> |
34 | 92 | </nav> |
35 | 93 | </header> |
36 | 94 | </template> |
37 | 95 |
|
38 | 96 | <script setup lang="ts"> |
39 | 97 | const { data } = await useAsyncData('header', () => queryCollection('header').first()) |
| 98 | +
|
| 99 | + const isOpen = ref(false) |
| 100 | +
|
| 101 | + const closeDrawer = () => { |
| 102 | + isOpen.value = false |
| 103 | + } |
40 | 104 | </script> |
0 commit comments