-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMobileMenu.vue
50 lines (47 loc) · 1.25 KB
/
MobileMenu.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<script setup lang="ts">
interface Props {
active: boolean
links: { text: string; link: string }[]
}
defineProps<Props>()
defineEmits(['navigate'])
</script>
<template>
<Transition name="transition-content">
<div
v-if="active"
class="mobile-nav fixed inset-x-0 top-0 z-40 grid grid-cols-12 h-full"
>
<div class="col-span-10 col-start-2 flex flex-col py-8">
<div class="flex flex-grow flex-col justify-center">
<nav>
<h1 v-for="{ text, link } in links" :key="link" class="mb-3">
<AppLink
class="mobile-nav-link"
:href="link"
@click="$emit('navigate')"
>
{{ text }}
</AppLink>
</h1>
</nav>
</div>
<SocialLinks class="flex" @navigate="$emit('navigate')" />
</div>
</div>
</Transition>
</template>
<style lang="postcss" scoped>
.mobile-nav-link {
position: relative;
@apply text-3xl leading-normal font-sans;
}
.transition-content-enter-active,
.transition-content-leave-active {
@apply transition transform duration-300 ease-in-out opacity-100 scale-100;
}
.transition-content-enter-from,
.transition-content-leave-to {
@apply opacity-0 scale-105;
}
</style>