59 lines
1.6 KiB
Vue
59 lines
1.6 KiB
Vue
<script setup>
|
|
import { DEFAULT_BRAND_COLOR, normalizeBrandColor } from './lib/brand-color.js'
|
|
|
|
const { data: appSiteSettings } = await usePublicSiteSettings()
|
|
|
|
const siteAccentColor = computed(() => normalizeBrandColor(appSiteSettings.value?.brandColor || DEFAULT_BRAND_COLOR))
|
|
|
|
const siteAccentStyle = computed(() => ({
|
|
'--site-accent': siteAccentColor.value
|
|
}))
|
|
|
|
const isSitePageNavigating = useState('site-page-veil', () => false)
|
|
|
|
useHead(() => ({
|
|
titleTemplate: (titleChunk) => titleChunk || appSiteSettings.value.title,
|
|
link: appSiteSettings.value.faviconUrl
|
|
? [
|
|
{
|
|
rel: 'icon',
|
|
type: 'image/png',
|
|
href: appSiteSettings.value.faviconUrl
|
|
}
|
|
]
|
|
: []
|
|
}))
|
|
</script>
|
|
|
|
<template>
|
|
<div class="site-app" :style="siteAccentStyle">
|
|
<div
|
|
v-show="isSitePageNavigating"
|
|
class="site-page-loading pointer-events-none fixed inset-0 z-[2147483647] grid place-items-center text-[var(--site-text)]"
|
|
role="status"
|
|
aria-live="polite"
|
|
aria-busy="true"
|
|
>
|
|
<div class="site-page-loading__panel grid place-items-center gap-3 text-center">
|
|
<span class="site-page-loading__spinner size-8 rounded-full border-2 border-[var(--site-line)] border-t-[var(--site-accent)]" aria-hidden="true" />
|
|
<span class="text-xs font-semibold uppercase tracking-[0.18em] opacity-70">Loading</span>
|
|
</div>
|
|
</div>
|
|
<NuxtLayout>
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.site-page-loading__spinner {
|
|
animation: site-page-loading-spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes site-page-loading-spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
</style>
|