-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
74 lines (66 loc) · 1.67 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
<script setup>
const { loggedIn } = useUserSession();
const colorMode = useColorMode();
watch(loggedIn, () => {
if (!loggedIn.value) {
navigateTo("/");
}
});
function toggleColorMode() {
colorMode.preference = colorMode.preference === "dark" ? "light" : "dark";
}
useHead({
htmlAttrs: { lang: "en" },
link: [{ rel: "icon", href: "/icon.png" }],
});
useSeoMeta({
viewport: "width=device-width, initial-scale=1, maximum-scale=1",
title: "Nuxt Todos Edge",
description:
"A Nuxt demo hosted with Edge-side rendering, authentication and queyring a SQLite database",
ogImage: "/social-image.png",
twitterImage: "/social-image.png",
twitterCard: "summary_large_image",
});
</script>
<template>
<UContainer class="min-h-screen flex flex-col justify-center">
<div class="mb-2 text-right">
<UButton
square
variant="ghost"
color="black"
:icon="
$colorMode.preference === 'dark'
? 'i-heroicons-moon'
: 'i-heroicons-sun'
"
@click="toggleColorMode"
/>
</div>
<NuxtPage />
<footer class="text-center mt-2">
<NuxtLink
href="https://github.com/atinux/nuxt-todos-edge"
target="_blank"
class="text-sm text-gray-500 hover:text-gray-700"
>
GitHub
</NuxtLink>
·
<NuxtLink
href="https://twitter.com/Atinux"
target="_blank"
class="text-sm text-gray-500 hover:text-gray-700"
>
Twitter
</NuxtLink>
</footer>
</UContainer>
<UNotifications />
</template>
<style lang="postcss">
body {
@apply font-sans text-gray-950 bg-gray-50 dark:bg-gray-950 dark:text-gray-50;
}
</style>