-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
293 lines (274 loc) · 9.19 KB
/
index.html
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Faithful Web Application</title>
<meta name="theme-color" content="#76C945" />
<link
rel="icon"
href="https://raw.githubusercontent.com/Faithful-Resource-Pack/Branding/main/site/favicon.ico"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- HTML Meta Tags -->
<meta name="description" content="The official web application for the Faithful website." />
<!-- Open Graph Meta Tags -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Faithful Web Application" />
<meta
property="og:description"
content="The official web application for the Faithful website."
/>
<meta
property="og:image"
content="https://database.faithfulpack.net/images/branding/site/banners/universal_banner.png"
/>
<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:description"
content="The official web application for the Faithful website."
/>
<meta
name="twitter:image"
content="https://database.faithfulpack.net/images/branding/site/banners/universal_banner.png"
/>
<!-- PWA -->
<link rel="manifest" href="/manifest.json" />
<!-- these should probably be moved to the image database -->
<link rel="icon" sizes="192x192" href="https://faithfulpack.net/image/pwa/app-192x192.png" />
<link rel="icon" sizes="512x512" href="https://faithfulpack.net/image/pwa/app-512x512.png" />
<!-- CSS -->
<link rel="stylesheet" href="https://database.faithfulpack.net/fonts/Roboto/stylesheet.css" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/vuetify@2.6.14/dist/vuetify.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/vue-prism-editor@1.3.0/dist/prismeditor.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/prismjs@1.27.0/themes/prism-tomorrow.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/vue-calendar-heatmap@0.8.4/dist/vue-calendar-heatmap.min.css"
/>
<link rel="stylesheet" href="./resources/css/webapp.css" />
</head>
<body>
<!-- HTML parsing rules apply here; no auto-closing tags -->
<v-app id="app" ref="app">
<v-app-bar flat dense bar app class="small-app-bar">
<span class="mr-2 d-flex noselect">
<v-app-bar-nav-icon small @click="drawerOpen = !drawerOpen" />
</span>
<v-spacer></v-spacer>
<v-menu left offset-y open-on-hover transition="slide-y-transition">
<template #activator="{ on, attrs }">
<v-btn min-width="0" class="px-1 ms-2" v-bind="attrs" v-on="on" elevation="0">
<v-icon>mdi-theme-light-dark</v-icon>
<v-icon small>mdi-chevron-down</v-icon>
</v-btn>
</template>
<v-list class="pt-0" dense nav>
<v-subheader
class="font-weight-black text-uppercase text-center justify-center text--primary"
>
{{ $root.lang().global.snackbar_system_theme.themes.title }}
</v-subheader>
<v-list-item
v-for="(icon, key) in themes"
:key="key"
:class="{ 'v-list-item--active': theme == key, 'text-left': true }"
@click="theme = key"
style="cursor: pointer"
dense
>
<v-list-item-icon class="me-4">
<v-icon>{{ icon }}</v-icon>
</v-list-item-icon>
<v-list-item-title>
{{ $root.lang().global.snackbar_system_theme.themes[key] }}
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<v-menu right offset-y open-on-hover transition="slide-y-transition">
<template #activator="{ on, attrs }">
<v-btn min-width="0" class="px-1 ms-2" v-bind="attrs" v-on="on" elevation="0">
<v-icon>mdi-translate</v-icon>
<v-icon small>mdi-chevron-down</v-icon>
</v-btn>
</template>
<v-list class="pt-0" dense nav>
<v-subheader
class="font-weight-black text-uppercase text-center justify-center text--primary"
>
{{ $root.lang().global.translations }}
</v-subheader>
<v-list-item
v-for="lang in availableLangs"
:key="lang.bcp47"
:class="{ 'v-list-item--active': lang.id === selectedLang, 'text-center': true }"
@click="
() => {
selectedLang = lang.id;
}
"
style="cursor: pointer"
dense
>
<v-list-item-avatar
min-width="24"
:width="24"
max-width="24"
:height="18"
class="rounded-0"
>
<v-img
:src="`https://flagcdn.com/24x18/${lang.iso3166}.png`"
:srcset="`
https://flagcdn.com/32x24/${lang.iso3166}.png 2x,
https://flagcdn.com/48x36${lang.iso3166}.png 3x`"
width="24"
height="18"
/>
</v-list-item-avatar>
<v-list-item-title class="uppercase">{{ lang.id }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<span class="monochrome-logo mx-2 d-flex noselect">
<a href="https://faithfulpack.net" title="Return to main site">
<img
src="https://database.faithfulpack.net/images/branding/logos/transparent/512/plain_logo.png?w=60"
width="30"
alt="logo"
/>
</a>
</span>
</v-app-bar>
<v-navigation-drawer width="320" fixed app v-model="drawerOpen">
<v-card :style="bannerStyles" class="rounded-t-0">
<div v-if="isLoggedIn" class="py-2">
<v-card-title class="pl-2">
<v-avatar size="48" style="margin-right: 10px">
<img
v-if="user.avatar"
style="line-height: 48px"
:alt="user.username.charAt(0)"
:src="user.avatar"
/>
<span v-else class="text-center primary font-weight-bold">
{{ user.username[0] }}
</span>
</v-avatar>
<span class="white--text clean-shadow">{{ shortUsername }}</span>
</v-card-title>
<v-card-actions class="mt-n1">
<v-btn small color="red white--text" width="40%" @click="logout">
{{ $root.lang().global.logout }}
</v-btn>
</v-card-actions>
</div>
<div v-else class="px-5 py-5">
<v-btn
block
class="blurple"
:href="$root.discordAuth.discordAuthURL"
:style="{
color: '#FFF',
}"
>
{{ $root.lang().global.login }}
</v-btn>
</div>
</v-card>
<div v-for="(tab, tabIndex) in availableTabs" :key="tab.label">
<v-list
dense
nav
v-if="
isLoggedIn ||
(tab.subtabs && tab.subtabs.reduce((acc, cur) => acc + (cur.public || 0), 0)) > 0
"
>
<v-list-item>
<v-list-item-title class="uppercase-unsized">
{{ tab.labelText }}
</v-list-item-title>
</v-list-item>
<v-list-item
link
v-if="tab.subtabs && (isLoggedIn || subtab.public)"
v-for="(subtab, subtabIndex) in tab.subtabs"
:key="subtab.label"
:to="subtab.to"
:disabled="subtab.disabled"
class="uppercase-unsized"
>
<v-list-item-icon v-if="subtab.icon" style="margin-right: 5px">
<v-icon small style="color: inherit">{{ subtab.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-title class="uppercase">{{ subtab.labelText }}</v-list-item-title>
<v-list-item-action class="nav-badge" v-if="subtab.badge && badgeData[subtab.label]">
<span class="nav-badge-inner error">{{ badgeData[subtab.label] }}</span>
</v-list-item-action>
</v-list-item>
<v-list-item
link
v-if="tab.to"
:to="tab.to"
:disabled="tab.disabled"
class="uppercase-unsized"
>
<v-list-item-icon v-if="tab.icon" style="margin-right: 5px">
<v-icon small style="color: inherit">{{ tab.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-title class="uppercase">{{ tab.labelText }}</v-list-item-title>
<v-list-item-action class="nav-badge" v-if="tab.badge && badges[tab.badge]">
<span class="nav-badge-inner error">{{ badges[tab.badge] }}</span>
</v-list-item-action>
</v-list-item>
</v-list>
<v-divider
style="margin-bottom: 10px"
v-if="
isLoggedIn ||
(tab.subtabs && tab.subtabs.reduce((acc, cur) => acc + (cur.public || 0), 0)) > 0
"
>
</v-divider>
</div>
<!-- Fix problem on firefox on mobile where bar disappears and fixed elements are hidden -->
<div class="py-8" v-if="!$vuetify.breakpoint.lgAndUp"></div>
</v-navigation-drawer>
<v-main>
<router-view></router-view>
<v-bottom-navigation id="bottom" style="box-shadow: none" height="auto" class="mb-2">
<span> © {{ new Date().getFullYear() }} Faithful Resource Pack </span>
</v-bottom-navigation>
</v-main>
<v-snackbar
v-model="snackbar.show"
:timeout="snackbar.timeout"
:color="snackbar.color"
multi-line
bottom
right
>
<div>{{ snackbar.message }}</div>
<div>{{ snackbar.submessage }}</div>
<pre v-if="snackbar.json" class="mt-2">{{ JSON.stringify(snackbar.json, null, 2) }}</pre>
</v-snackbar>
</v-app>
<!-- main script -->
<script async src="./index.js" type="module"></script>
</body>
</html>