fix. [SWV-826] TOP 버튼 배경 컬러 관리
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { TrackingObject } from '#layers/types/api/common'
|
import type { ColorObject, TrackingObject } from '#layers/types/api/common'
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
color: ColorObject
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
const { locale } = useI18n()
|
const { locale } = useI18n()
|
||||||
const { y: windowY } = useWindowScroll({ behavior: 'smooth' })
|
const { y: windowY } = useWindowScroll({ behavior: 'smooth' })
|
||||||
@@ -12,6 +18,9 @@ const analytics = {
|
|||||||
} as TrackingObject
|
} as TrackingObject
|
||||||
|
|
||||||
const showBtn = computed(() => windowY.value > 0)
|
const showBtn = computed(() => windowY.value > 0)
|
||||||
|
const backgroundColor = computed(() =>
|
||||||
|
getColorCodeFromData(props.color, 'none')
|
||||||
|
)
|
||||||
|
|
||||||
const handleScrollToTop = () => {
|
const handleScrollToTop = () => {
|
||||||
windowY.value = 0
|
windowY.value = 0
|
||||||
@@ -25,6 +34,7 @@ const handleScrollToTop = () => {
|
|||||||
v-show="showBtn"
|
v-show="showBtn"
|
||||||
class="btn-top"
|
class="btn-top"
|
||||||
sr-only="top"
|
sr-only="top"
|
||||||
|
:style="{ backgroundColor: backgroundColor }"
|
||||||
@click="handleScrollToTop"
|
@click="handleScrollToTop"
|
||||||
>
|
>
|
||||||
<AtomsIconsArrowControlTopLine />
|
<AtomsIconsArrowControlTopLine />
|
||||||
@@ -39,4 +49,7 @@ const handleScrollToTop = () => {
|
|||||||
.btn-top:hover :deep(.icon) {
|
.btn-top:hover :deep(.icon) {
|
||||||
@apply -translate-y-[3px];
|
@apply -translate-y-[3px];
|
||||||
}
|
}
|
||||||
|
.btn-top:hover :deep(.icon svg) {
|
||||||
|
fill-opacity: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -104,7 +104,10 @@ onMounted(() => {
|
|||||||
<ClientOnly>
|
<ClientOnly>
|
||||||
<BlocksLnb v-if="isShowLnb" />
|
<BlocksLnb v-if="isShowLnb" />
|
||||||
<div v-if="isShowTopBtn" class="utile-wrap">
|
<div v-if="isShowTopBtn" class="utile-wrap">
|
||||||
<BlocksButtonScrollTop v-if="isShowTopBtn" />
|
<BlocksButtonScrollTop
|
||||||
|
v-if="isShowTopBtn"
|
||||||
|
:color="pageData?.top_btn_color_json"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ClientOnly>
|
</ClientOnly>
|
||||||
<BlocksSns v-if="isShowSnsBtn" />
|
<BlocksSns v-if="isShowSnsBtn" />
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export interface PageDataValue {
|
|||||||
is_login_required: number
|
is_login_required: number
|
||||||
meta_tag_type: number
|
meta_tag_type: number
|
||||||
use_top_btn: boolean
|
use_top_btn: boolean
|
||||||
|
top_btn_color_json?: ColorObject
|
||||||
use_sns_btn: boolean
|
use_sns_btn: boolean
|
||||||
use_lnb: boolean
|
use_lnb: boolean
|
||||||
lnb_text_color_code_active?: string
|
lnb_text_color_code_active?: string
|
||||||
|
|||||||
Reference in New Issue
Block a user