Skip to content

Commit f8336bb

Browse files
committed
fix: UI, a11y and cleanning
1 parent f689fbb commit f8336bb

File tree

5 files changed

+52
-92
lines changed

5 files changed

+52
-92
lines changed

src/components/layout/Footer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ const socials = [
3939
link: 'https://www.linkedin.com/company/gnoland/',
4040
},
4141
]
42-
</script>
42+
</script>

src/components/layout/Header.vue

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
11
<template>
2-
<header class="flex w-full items-center justify-between max-w-[110rem] mx-auto px-4 md:px-14 lg:px-20 pt-8 pb-4 mb-8 md:mb-16 relative">
3-
<IconGnoland class="cursor-pointer" />
4-
<HamburgerMenu :navItems="navItems"/>
5-
<div class="md:flex justify-end items-center gap-5 hidden">
6-
<a class="cursor-pointer link-with-animation" v-for="item, i in navItems" :key="i" href="item.link" target="_blank">{{item.title}}</a>
7-
<a class="cursor-pointer px-2 py-1 bg-grey-100 rounded-sm hover:scale-105 transition-transform duration-300">Connect Wallet</a>
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>
820
</div>
921
</header>
1022
</template>
1123

1224
<script setup lang="ts">
25+
import { ref } from 'vue'
1326
import IconGnoland from '@/components/icons/IconGnoland.vue'
14-
import { NavItem } from '@/types';
15-
import HamburgerMenu from '../ui/HamburgerMenu.vue';
16-
const navItems: NavItem[] = [
17-
{
18-
title: 'Home',
19-
link: 'https://gno.land/'
20-
},
21-
{
22-
title: 'Docs',
23-
link: 'https://docs.gno.land/'
24-
},
25-
{
26-
title: 'Playground',
27-
link: 'https://play.gno.land/'
28-
}
29-
]
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)
3051
</script>

src/components/ui/HamburgerMenu.vue

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/style.css

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ html {
130130
@apply list-decimal;
131131
}
132132

133+
@layer components {
134+
.text-link {
135+
@apply inline-block no-underline focus:outline-0
136+
after:block after:w-full after:bg-current after:h-px after:duration-200 after:transition-transform after:scale-x-0 after:origin-right
137+
hover:after:origin-left hover:after:scale-x-100 focus:after:origin-left focus:after:scale-x-100;
138+
}
139+
}
140+
133141
@layer utilities {
134142
/* Hide scrollbar for Chrome, Safari and Opera */
135143
.no-scrollbar::-webkit-scrollbar {
@@ -141,16 +149,3 @@ html {
141149
scrollbar-width: none; /* Firefox */
142150
}
143151
}
144-
145-
.link-with-animation::after {
146-
content: '';
147-
display: block;
148-
width: 0;
149-
height: 2px;
150-
background-color: currentColor;
151-
transition: width 0.2s ease-in-out;
152-
}
153-
154-
.link-with-animation:hover::after {
155-
width: 100%;
156-
}

src/types/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,3 @@ export interface Faucet {
99
recaptcha: string // the recaptcha site key, if any
1010
token?: string // token name: default $GNOT
1111
}
12-
13-
export interface NavItem {
14-
title: string
15-
link: string
16-
}

0 commit comments

Comments
 (0)