-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
122 lines (112 loc) · 3.58 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<script setup lang="ts">
import { useDark, useToggle } from '@vueuse/core'
const pageBackground = ref("bg-stone-100 dark:bg-neutral-900");
const isDark = useDark()
const toggleDark = useToggle(isDark)
useHead({
title: "finxol's blog",
meta: [
{
name: "description",
content: "finxol's blog",
},
{
name: "viewport",
content: "width=device-width, initial-scale=1",
},
{
name: "fediverse:creator",
content: "@[email protected]",
},
],
bodyAttrs: {
class: pageBackground,
},
});
const nav = ref([
{
title: "About",
to: "/about",
},
]);
const links = ref([
{
icon: "ant-design:github-filled",
title: "GitHub",
href: "https://github.com/finxol",
},
{
icon: "ri:mastodon-fill",
title: "Mastodon",
href: "https://mas.to/@finxol",
},
{
icon: "ri:bluesky-fill",
title: "BlueSky",
href: "https://bsky.app/profile/finxol.io",
},
].reverse());
const date: Date = new Date();
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: "smooth",
});
}
</script>
<template>
<div :class="`min-h-screen min-w-screen ${pageBackground}`">
<div :class="[
pageBackground,
'text-gray-800 dark:text-gray-300',
'min-h-screen max-w-4xl',
'flex flex-col justify-between',
'mx-auto px-6',
]">
<header :class="[
'border-b-2 border-stone-200 dark:border-stone-800',
'py-8',
'flex justify-between align-center',
]">
<div class="flex items-center gap-4 sm:gap-6">
<img src="/logo.png" alt="Logo" class="h-8" />
<NuxtLink to="/" class="text-xl leading-5 sm:text-2xl font-medium">finxol's blog</NuxtLink>
</div>
<div class="flex items-center gap-4 sm:gap-8">
<div
class="cursor-pointer"
@click="toggleDark()"
>
<Icon v-if="isDark" name="ri:sun-fill" size="1.5rem" mode="svg" />
<Icon v-else name="ri:moon-fill" size="1.5rem" mode="svg" />
</div>
<nav :class="['flex items-start gap-4', 'text-gray-800 dark:text-gray-200', 'font-semibold']">
<NuxtLink v-for="item in nav" :key="item.to" :to="item.to">
{{ item.title }}
</NuxtLink>
</nav>
<div class="flex items-center gap-2">
<NuxtLink v-for="link in links" :key="link.title" :to="link.href" target="_blank" :aria-label="link.title">
<Icon :name="link.icon" size="2rem" :title="link.title" />
</NuxtLink>
</div>
</div>
</header>
<NuxtPage />
<footer :class="[
'border-t-2 border-stone-200 dark:border-stone-800',
'p-4',
'flex justify-between',
]">
<p>
©
{{ date.getFullYear() }}
finxol
</p>
<button :class="['text-gray-600 dark:text-gray-300', 'font-light']" @click="scrollToTop">
Back to top
</button>
</footer>
</div>
</div>
</template>