feat. GR_VISUAL_02 컴포넌트 제작

This commit is contained in:
clkim
2025-09-23 20:37:33 +09:00
parent 81bcca8e23
commit 34a8248731
13 changed files with 689 additions and 146 deletions

View File

@@ -1,84 +1,88 @@
<script setup lang="ts">
import { Swiper, SwiperSlide } from 'swiper/vue'
import { EffectFade, Navigation, Pagination } from 'swiper/modules'
import { getResponsiveClass, getResponsiveSrc } from '#layers/utils/dataUtil'
import {
getResponsiveClass,
getResponsiveSrc,
hasComponentGroup,
getComponentGroup,
getComponentGroupAry,
} from '#layers/utils/dataUtil'
interface Props {
components: Record<string, any>
pageVerTmplSeq: number
pageVerTmplSeq: string
}
const props = defineProps<Props>()
const arrow = computed(() => {
return props.components.arrow.groups
return getComponentGroupAry(props.components, 'arrow')
})
const modules = [EffectFade, Navigation, Pagination]
const swiperOptions = computed(() => ({
modules,
loop: true,
effect: 'fade',
pagination: {
el: '.slide-pagination',
clickable: true,
} as any,
navigation: {
nextEl: '.slide-next',
prevEl: '.slide-prev',
} as any,
class: 'h-full',
}))
</script>
<template>
<section class="relative h-[640px] md:h-[1000px]">
<Swiper
:modules="modules"
:loop="true"
effect="fade"
:pagination="
{
el: '.slide-pagination',
clickable: true,
} as any
"
:navigation="
{
nextEl: '.slide-next',
prevEl: '.slide-prev',
} as any
"
class="h-full"
>
<Swiper v-bind="swiperOptions">
<SwiperSlide
v-for="group in props.components.group_sets"
:key="group.set_order"
class="bg-black"
>
<WidgetsBackground
v-if="group?.background.groups"
:resources-data="group.background.groups[0]"
v-if="hasComponentGroup(group, 'background')"
:resources-data="getComponentGroup(group, 'background')"
/>
<div
class="relative h-full flex flex-col items-center justify-center gap-[14px] text-center md:gap-5"
>
<WidgetsSubTitle
v-if="group.subTitle && group.subTitle.groups"
:resources-data="group.subTitle.groups[0]"
v-if="hasComponentGroup(group, 'subTitle')"
:resources-data="getComponentGroup(group, 'subTitle')"
class="line-clamp-2 text-[16px] font-[500] leading-[24px] md:line-clamp-1 md:text-[24px] md:leading-[34px]"
/>
<WidgetsMainTitle
v-if="group.mainTitle && group.mainTitle.groups"
:resources-data="group.mainTitle.groups[0]"
v-if="hasComponentGroup(group, 'mainTitle')"
:resources-data="getComponentGroup(group, 'mainTitle')"
class="line-clamp-3 text-[24px] font-[700] leading-[34px] md:text-[50px] md:leading-[70px]"
/>
<WidgetsDescription
v-if="group.description && group.description.groups"
:resources-data="group.description.groups[0]"
v-if="hasComponentGroup(group, 'description')"
:resources-data="getComponentGroup(group, 'description')"
class="line-clamp-3 text-[15px] font-[400] leading-[24px] md:text-[20px] md:leading-[30px]"
/>
<WidgetsButtonList
v-if="group.buttonList && group.buttonList.groups"
:groups-data="group.buttonList.groups"
v-if="hasComponentGroup(group, 'buttonList')"
:groups-data="getComponentGroupAry(group, 'buttonList')"
/>
</div>
</SwiperSlide>
<div class="slide-pagination" />
<div class="slide-pagination position-absolute" />
<!-- Navigation buttons -->
<div
v-if="arrow.length > 0"
class="slide-prev hidden md:block"
:class="getResponsiveClass()"
:style="
getResponsiveSrc(arrow[0].res_path, {
getResponsiveSrc(arrow[0]?.res_path, {
resourcesType: 'bg',
})
"
@@ -86,10 +90,11 @@ const modules = [EffectFade, Navigation, Pagination]
<span class="sr-only">prev</span>
</div>
<div
v-if="arrow.length > 1"
class="slide-next hidden md:block"
:class="getResponsiveClass()"
:style="
getResponsiveSrc(arrow[1].res_path, {
getResponsiveSrc(arrow[1]?.res_path, {
resourcesType: 'bg',
})
"