v1.4.6: 사이트 설정 이미지 저장 흐름·홈 커버 라이트/다크 분리
- 로고 업로드는 파일 URL만 폼에 반영하고 기타 설정 저장 시 DB에 반영 - 메인 화면 커버 라이트·다크 이미지 필드 추가 및 테마별 HomeHero 교체 - home_cover_dark_image_url 마이그레이션 및 미디어 사용 현황 보정
This commit is contained in:
@@ -5,6 +5,11 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
/** 다크모드 커버 이미지 URL */
|
||||
darkImageUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
/** 오버레이 제목 */
|
||||
title: {
|
||||
type: String,
|
||||
@@ -19,18 +24,32 @@ const props = defineProps({
|
||||
|
||||
/** @type {import('vue').ComputedRef<boolean>} */
|
||||
const hasOverlay = computed(() => Boolean(props.title?.trim() || props.text?.trim()))
|
||||
/** @type {import('vue').ComputedRef<boolean>} */
|
||||
const lightImageUrl = computed(() => props.imageUrl?.trim() || props.darkImageUrl?.trim() || '')
|
||||
/** @type {import('vue').ComputedRef<boolean>} */
|
||||
const hasDarkImage = computed(() => Boolean(props.imageUrl?.trim() && props.darkImageUrl?.trim()))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section
|
||||
v-if="imageUrl"
|
||||
v-if="lightImageUrl"
|
||||
class="home-hero relative mx-auto w-full max-w-[720px] overflow-hidden"
|
||||
data-home-hero
|
||||
>
|
||||
<div class="home-hero__frame relative aspect-[720/215] w-full bg-[var(--site-panel)]">
|
||||
<img
|
||||
class="home-hero__cover absolute inset-0 h-full w-full object-cover"
|
||||
:src="imageUrl"
|
||||
:class="[
|
||||
'home-hero__cover home-hero__cover--light absolute inset-0 h-full w-full object-cover',
|
||||
hasDarkImage ? '' : 'home-hero__cover--single'
|
||||
]"
|
||||
:src="lightImageUrl"
|
||||
alt=""
|
||||
loading="eager"
|
||||
>
|
||||
<img
|
||||
v-if="hasDarkImage"
|
||||
class="home-hero__cover home-hero__cover--dark absolute inset-0 h-full w-full object-cover"
|
||||
:src="darkImageUrl"
|
||||
alt=""
|
||||
loading="eager"
|
||||
>
|
||||
@@ -56,3 +75,35 @@ const hasOverlay = computed(() => Boolean(props.title?.trim() || props.text?.tri
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.home-hero__cover--dark {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.home-hero__cover--light:not(.home-hero__cover--single) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.home-hero__cover--dark {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
html[data-theme='light'] .home-hero__cover--light {
|
||||
display: block;
|
||||
}
|
||||
|
||||
html[data-theme='light'] .home-hero__cover--dark {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .home-hero__cover--light:not(.home-hero__cover--single) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .home-hero__cover--dark {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -56,7 +56,7 @@ const showAboutSection = false
|
||||
<div class="right-sidebar__scroll site-sidebar-scroll min-h-0 flex-1">
|
||||
<div class="right-sidebar__block site-sidebar-section py-5 pl-5 pr-0 max-lg:px-0">
|
||||
<div class="right-sidebar__profile flex items-center gap-3">
|
||||
<div class="right-sidebar__logo grid h-12 w-12 place-items-center overflow-hidden rounded-2xl bg-[var(--site-invert)] text-2xl font-bold text-[var(--site-invert-text)]">
|
||||
<div class="right-sidebar__logo grid h-12 w-12 place-items-center overflow-hidden rounded-2xl text-2xl font-bold text-[var(--site-invert-text)]">
|
||||
<img
|
||||
v-if="siteSettings.logoUrl"
|
||||
class="h-full w-full object-cover"
|
||||
|
||||
Reference in New Issue
Block a user