-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
56 lines (50 loc) · 1.41 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
<script setup lang="ts">
import themesList from '~/assets/themes.json'
const user = useSupabaseUser()
const configStore = useConfigStore()
if (configStore.config.random_theme) {
const themes = JSON.parse(JSON.stringify(themesList)).sort((a: { name: string; }, b: { name: any; }) =>
a.name.localeCompare(b.name)
)
const randomTheme = themes[Math.floor(Math.random() * themes.length)]
setTheme(randomTheme.name)
} else {
if (configStore.config.theme) {
setTheme(configStore.config.theme)
} else {
setTheme('camping')
}
}
if (user.value) {
configStore.fetchConfig()
}
</script>
<template>
<div class="app-content content-grid">
<NuxtLoadingIndicator :color="'var(--main-color)'"/>
<AppHeader />
<NuxtPage />
<AppFooter />
<AppNotificationCenter />
</div>
</template>
<style scoped>
.app-content {
min-height: 100vh;
height: 100vh;
width: 100%;
justify-content: center;
display: grid;
grid-template-rows: [padding-start] auto [content-start] 1fr [content-end] auto [page-end];
}
.content-grid {
display: grid;
grid-template-columns:
[full-width-start] var(--gutter) [full-width-padding-start] var(
--narrow-width-gutter
)
[content-start] 1fr [content-end] var(--narrow-width-gutter)
[full-width-padding-end] var(--gutter)
[full-width-end];
}
</style>