-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
76 lines (68 loc) · 1.75 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
<script setup lang="ts">
import { SITE_TITLE, SITE_DESCRIPTION } from "@/utils/config";
type Theme = "dark" | "light";
const options: { [k: string]: Theme } = {
dark: "dark",
light: "light",
}
const theme = useState<Theme>('theme', () => options.light)
const changeTheme = () => {
theme.value = theme.value === options.light ? options.dark : options.light;
if (document) {
document.documentElement.setAttribute("data-theme", options[theme.value]);
document.documentElement.className = theme.value;
}
}
useHead({
title: SITE_TITLE,
meta: [
{ name: "title", content: SITE_TITLE },
{ name: "description", content: SITE_DESCRIPTION },
],
// script: [
// {
// src: "https://platform.twitter.com/widgets.js",
// crossorigin: "anonymous",
// defer: true,
// async: true,
// },
// ],
link: [
{ rel: "alternate", type: "application/rss+xml", href: "/rss.xml" },
{ rel: "icon", type: "image/png", href: "/static/favicons/favicon.ico" },
{
rel: "icon",
type: "image/png",
sizes: "16x16",
href: "/static/favicons/favicon-16x16.png",
},
{
rel: "icon",
type: "image/png",
sizes: "32x32",
href: "/static/favicons/favicon-32x32.png",
},
],
htmlAttrs: {
lang: "it-IT",
"data-theme": options[theme.value],
class: theme.value,
}
});
//updateDocument(current.value);
</script>
<template>
<Header :dark="theme === options.dark" @change-theme="changeTheme" />
<main>
<Container>
<NuxtPage />
</Container>
<Footer />
</main>
</template>
<style>
@import 'node_modules/modern-normalize/modern-normalize.css';
@import './styles/spacing.css';
@import './styles/themes/default.css';
@import './styles/typography.css';
</style>