|
1 |
| -<script setup lang="ts"> |
2 |
| -import IconGnoland from '@/components/icons/IconGnoland.vue' |
3 |
| -</script> |
4 |
| - |
5 | 1 | <template>
|
6 |
| - <header class="flex w-full max-w-[110rem] mx-auto px-4 md:px-14 lg:px-20 pt-8 pb-4 mb-8 md:mb-16"> |
7 |
| - <IconGnoland class="m-auto md:m-0" /> |
| 2 | + <header class="min-h-28 w-full max-w-[110rem] mx-auto px-8 md:px-14 lg:px-20 pt-8 pb-4 mb-8 md:mb-16"> |
| 3 | + <div class="relative w-full"> |
| 4 | + <nav class="absolute justify-between md:flex p-4 pb-8 md:p-0 z-2 w-full top-0 before:absolute before:z-30 before:top-0 before:left-0 before:bg-grey-500 before:w-full before:rounded before:h-0 before:duration-700 before:delay-50" :class="[menuIsOpen === true && 'before:!h-full before:!delay-0 before:!duration-500']"> |
| 5 | + <div class="top-0 left-0 right-0 bottom-0 bg-darkblur backdrop-blur-sm" :class="menuIsOpen ? 'fixed' : 'hidden'" @click="toggleMenu"></div> |
| 6 | + <IconGnoland class="relative z-40 justify-start" /> |
| 7 | + |
| 8 | + <button id="menubutton" class="group absolute z-40 md:hidden w-7 h-5 block right-4 top-6 focus:outline-0" :aria-expanded="menuIsOpen" aria-haspopup="true" aria-label="Toggle menu" aria-controls="menu" tabindex="0" @click="toggleMenu"> |
| 9 | + <span class="absolute rounded h-px w-full origin-right left-0 top-0 bg-light duration-200" :class="[menuIsOpen === true && '-rotate-45 translate-y-0']"></span> |
| 10 | + <span class="absolute rounded h-px w-full scale-x-75 origin-right left-0 top-1/2 -translate-y-1/2 bg-light duration-200 group-hover:scale-x-100 group-focus:scale-x-100" :class="[menuIsOpen === true && 'opacity-0']"></span> |
| 11 | + <span class="absolute rounded h-px w-full scale-x-50 origin-right left-0 bottom-0 bg-light duration-200 group-hover:scale-x-100 group-focus:scale-x-100" :class="[menuIsOpen === true && 'rotate-45 !scale-x-100']"></span> |
| 12 | + </button> |
| 13 | + |
| 14 | + <ul class="relative z-40 md:flex mt-8 md:mt-0 justify-end items-center space-y-5 md:space-x-8 md:space-y-0" :aria-hidden="!menuIsOpen" id="menu" role="menu" aria-labelledby="menubutton"> |
| 15 | + <li v-for="item in navItems" :key="item.title" class="opacity-0 md:opacity-100 duration-150 delay-0" :class="[menuIsOpen === true && 'opacity-100 !delay-300 !duration-300']" role="presentation"> |
| 16 | + <a :href="item.link" class="text-link" role="menuitem">{{ item.title }}</a> |
| 17 | + </li> |
| 18 | + </ul> |
| 19 | + </nav> |
| 20 | + </div> |
8 | 21 | </header>
|
9 | 22 | </template>
|
| 23 | + |
| 24 | +<script setup lang="ts"> |
| 25 | +import { ref } from 'vue' |
| 26 | +import IconGnoland from '@/components/icons/IconGnoland.vue' |
| 27 | +
|
| 28 | +const menuIsOpen = ref(false) |
| 29 | +
|
| 30 | +interface NavItem { |
| 31 | + title: string |
| 32 | + link: string |
| 33 | +} |
| 34 | +
|
| 35 | +const navItems: NavItem[] = [ |
| 36 | + { |
| 37 | + title: 'Gno.land', |
| 38 | + link: 'https://gno.land/', |
| 39 | + }, |
| 40 | + { |
| 41 | + title: 'Docs', |
| 42 | + link: 'https://docs.gno.land/', |
| 43 | + }, |
| 44 | + { |
| 45 | + title: 'Playground', |
| 46 | + link: 'https://play.gno.land/', |
| 47 | + }, |
| 48 | +] |
| 49 | +
|
| 50 | +const toggleMenu = () => (menuIsOpen.value = !menuIsOpen.value) |
| 51 | +</script> |
0 commit comments