summaryrefslogtreecommitdiff
path: root/app.vue
blob: 84169b9a40b3c1de292f9b8dd88d69f67bb5b8d1 (plain)
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
<template>
	<v-app>
		<v-app-bar>
			<v-app-bar-nav-icon
				@click="drawer == true ? (drawer = false) : (drawer = true)"
			></v-app-bar-nav-icon>
			<v-toolbar-title>Freach</v-toolbar-title>
			<v-spacer></v-spacer>
			<v-btn icon @click="toggletheme">
				<v-icon :icon="themeicon"></v-icon>
			</v-btn>
		</v-app-bar>
		<v-navigation-drawer v-model="drawer">
			<v-list nav color="primary">
				<v-list-item
					prepend-icon="mdi-home-outline"
					title="Home"
					:to="{ path: '/' }"
				></v-list-item>
				<v-list-item
					prepend-icon="mdi-gift-outline"
					title="Projects"
					:to="{ path: '/projects' }"
				></v-list-item>
				<v-list-item
					prepend-icon="mdi-post-outline"
					title="Blog"
					:to="{ path: '/blog' }"
				></v-list-item>
				<v-list-item
					prepend-icon="mdi-account-outline"
					title="About"
					:to="{ path: '/about' }"
				></v-list-item>
			</v-list>
		</v-navigation-drawer>
		<v-main>
			<nuxt-page></nuxt-page>
		</v-main>
		<a href="/javascript.html" data-jslicense="1" style="display: none"
			>JavaScript license information</a
		>
	</v-app>
</template>

<script setup lang="ts">
import { ref, computed } from "vue";
import { useTheme } from "vuetify";
import { onMounted } from "vue";
const drawer = ref(null);
const theme = useTheme();
const toggletheme = () => {
	if (theme.global.name.value == "hxlight") {
		theme.global.name.value = "hxdark";
	} else {
		theme.global.name.value = "hxlight";
	}
};
const themeicon = computed(() => {
	if (theme.global.current.value.dark == true) {
		return "mdi-weather-night";
	} else {
		return "mdi-weather-sunset-up";
	}
});

onMounted(() => {
	if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
		console.log(window.matchMedia("(prefers-color-scheme: dark)").matches);
		theme.global.name.value = "hxdark";
	}
});

useHead({
	title: "Freach",
	meta: [{ name: "description", content: "Freach's Website" }],
});
</script>