- 게시물 상세를 default 레이아웃으로 통합해 홈↔게시물 레이아웃 교체 제거 - CSS 전환 베일·스크롤 정리 플러그인으로 이동 중 깜빡임 완화 Co-authored-by: Cursor <cursoragent@cursor.com>
68 lines
1.8 KiB
Vue
68 lines
1.8 KiB
Vue
<script setup>
|
|
import { DEFAULT_BRAND_COLOR, normalizeBrandColor } from './lib/brand-color.js'
|
|
|
|
const { data: appSiteSettings } = await useFetch('/api/site-settings', {
|
|
key: 'site-settings-public',
|
|
default: () => ({
|
|
title: 'sori.studio',
|
|
faviconUrl: '',
|
|
logoUrl: '',
|
|
logoText: '井',
|
|
brandColor: DEFAULT_BRAND_COLOR
|
|
})
|
|
})
|
|
|
|
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>
|