diff --git a/layers/assets/css/components/_layout.css b/layers/assets/css/components/_layout.css index ce44e87..e9dadb2 100644 --- a/layers/assets/css/components/_layout.css +++ b/layers/assets/css/components/_layout.css @@ -5,7 +5,13 @@ } .section-content { - @apply relative h-full flex flex-col items-center justify-center gap-4 text-center px-[20px] sm:px-[40px] md:gap-5; + @apply relative h-full flex flex-col items-center justify-center text-center px-[20px] sm:px-[40px]; + } + + .border-line { + @apply overflow-hidden relative rounded-[4px] md:rounded-lg + after:content-[''] after:absolute after:top-0 after:left-0 after:w-full after:h-full + after:border after:border-white/10 after:rounded-[4px] after:md:rounded-lg; } /* Title Utility Classes */ diff --git a/layers/components/blocks/VisualContent.vue b/layers/components/blocks/VisualContent.vue index c464952..629fec7 100644 --- a/layers/components/blocks/VisualContent.vue +++ b/layers/components/blocks/VisualContent.vue @@ -3,14 +3,18 @@ import type { PageDataResourceGroup } from '#layers/types/api/pageData' interface Props { resourcesData?: PageDataResourceGroup + objectFit?: 'contain' | 'cover' + alt?: string } -const props = defineProps() +const props = withDefaults(defineProps(), { + objectFit: 'contain', +}) + +const breakpoints = useResponsiveBreakpointsReliable() -// 텍스트 데이터 추출 -// [TODO] txt 대신 text 사용 const displayText = computed(() => { - return props.resourcesData?.display?.txt || '' + return props.resourcesData?.display?.text || 'image' }) const imageSrc = computed(() => { return getResponsiveSrc(props.resourcesData?.res_path) @@ -21,12 +25,17 @@ const colorName = computed(() => { const colorCode = computed(() => { return props.resourcesData?.display?.color_code }) +const currentImageSrc = computed(() => { + if (!imageSrc.value) return '' + return breakpoints.value.isMobile + ? imageSrc.value.mobileSrc || '' + : imageSrc.value.pcSrc || '' +}) // HTML 콘텐츠 정리 (줄바꿈 처리) const sanitizedContent = computed(() => { return displayText.value?.replace(/\n/g, '
') || '' }) - // 이미지가 있는지 확인 const hasImage = computed(() => { return imageSrc.value && (imageSrc.value.mobileSrc || imageSrc.value.pcSrc) @@ -34,25 +43,16 @@ const hasImage = computed(() => {