-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.vue
163 lines (142 loc) · 3.09 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<script setup lang="ts">
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
const { seo } = useAppConfig()
const route = useRoute()
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
default: () => [],
server: false
})
useHead({
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'baidu-site-verification', content: 'codeva-SWZsd8tNWV' }
],
link: [
{ rel: 'icon', href: '/favicon.ico' }
],
htmlAttrs: {
lang: 'zh-cn'
}
})
useSeoMeta({
ogSiteName: seo?.siteName,
twitterCard: 'summary_large_image'
})
provide('navigation', navigation)
</script>
<template>
<div id="app-content" :data-full-path="route?.fullPath">
<Header id="app-header" />
<UMain id="app-main">
<NuxtLayout id="app-layout">
<NuxtPage id="app-page" />
</NuxtLayout>
</UMain>
<Footer id="app-footer" />
<ClientOnly>
<LazyUDocsSearch id="app-search" :files="files" :navigation="navigation" />
</ClientOnly>
<UNotifications id="app-notification" />
</div>
</template>
<style lang="stylus">
@import "./styles/index.styl";
img {
&[src*='w=30'] {
width: 30%;
}
&[src*='w=40'] {
width: 40%;
}
&[src*='w=50'] {
width: 50%;
}
&[src*='w=60'] {
width: 60%;
}
&[src*='w=62'] {
width: 62%;
}
&[src*='w=g'] {
width: 62%;
}
&[src*='w=70'] {
width: 70%;
}
&[src*='w=80'] {
width: 80%;
}
&[src*='type=win11'] {
border: none !important;
border-radius: 8px;
}
&[src*='type=draw'] {
border: none !important;
}
&[src*='type=win11-square'] {
border: none !important;
}
}
#app-page > div:first-child {
padding-left: 12px;
padding-right: 12px;
}
@media screen and (max-width: 888px) {
#app-page > div:first-child {
padding-left: 0;
padding-right: 0;
}
}
main aside::-webkit-scrollbar {
width: 0 !important;
}
nav[class^="sticky top-"] > div > ul {
max-height: 60vh;
overflow: auto;
}
header, footer {
max-width: 100%;
}
mark {
@apply bg-primary/20;
}
kbd {
margin: 0 .2em;
word-break: keep-all;
}
// 移动端的 Header 会被快链撑开,直接隐藏
@media screen and (max-width: 888px) {
header > div > div:last-child a {
width: 0;
overflow: hidden;
display: none;
}
[data-headlessui-portal] div:has(> button[aria-label="Close Menu"]) a {
width: 0;
overflow: hidden;
display: none;
}
}
// 不好看,隐藏侧边栏滚动条
// main aside:hover::-webkit-scrollbar {
// width: 4px !important;
// }
// 移动端将 toc 移动到底部并固定
@media screen and (max-width: 888px) {
footer {
margin-bottom: 50px;
}
:not(aside div) div:has(> nav[class^="sticky"]) {
position: fixed;
bottom: 0;
width: 100%;
max-width: 100vw;
left: 0;
padding: 0 12px;
z-index: 9;
border-color: var(--color-gray-300);
border-top-width: 1px;
}
}
</style>