-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
100 lines (97 loc) · 2.2 KB
/
app.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<script setup lang="ts">
const { $ogTitle } = useNuxtApp();
useHead({
link: [{ rel: "icon", type: "image/png", href: "/favicon.webp" }],
});
useSeoMeta({
themeColor: "#e8a946",
ogTitle: $ogTitle(),
ogImage: "/favicon.webp",
});
const config = useRuntimeConfig().public;
const user = ref();
function logout() {
const cookie = useCookie("auth_session");
cookie.value = null;
user.value = null;
}
user.value = await GqlGetMe().catch(() => {});
const route = useRoute();
const navs: { name: string; path: string }[] = [
{ name: "home", path: "/" },
// { name: "minecraft", path: "/minecraft" },
{ name: "about", path: "https://greasymac.fandom.com/wiki/GreasyMac_Wiki" },
];
</script>
<template>
<div>
<Notivue v-slot="item" class="font-poppins">
<Notification :item="item" />
</Notivue>
<nav
class="absolute w-full mx-auto flex items-center justify-between font-bebas p-4 text-lg"
>
<NuxtImg :src="$ContentImage('/gg.png')" class="size-11"></NuxtImg>
<div class="flex gap-x-3">
<NuxtLink
v-for="nav in navs"
:key="nav.path"
:to="nav.path"
:class="{
underline: nav.path === route.path,
'hover:scale-110': nav.path !== route.path,
}"
class="text-white text-xl transition-(transform color) underline-offset-6"
>{{ nav.name }}</NuxtLink
>
</div>
<div class="flex my-auto">
<NuxtLink
v-if="!user"
:href="
config.apiBase +
'/login/twitch?scopes=user:read:email&redirect=' +
$route.fullPath
"
class="bg-secondary hover:bg-button text-white h-min px-5 py-1 rounded-lg text-white"
>Login</NuxtLink
>
<NuxtImg
v-if="user"
:src="user.me.avatar"
class="size-11 rounded-full"
@click="logout"
></NuxtImg>
</div>
</nav>
<NuxtPage :user="user" />
</div>
</template>
<style>
:root {
--primary: theme(colors.primary);
}
* {
border: none;
}
.font-bebas {
font-family: "Bebas Neue";
}
.font-poppins {
font-family: "Poppins";
}
.font-ibm {
font-family: "IBM Plex Sans";
}
body {
background-color: var(--primary);
background-image: url(/GoopRepeat.png);
background-size: 80rem;
background-position: center;
background-repeat: repeat;
}
a {
text-decoration: none;
color: white;
}
</style>