fix. [SWV-865] 영상재생 버튼 개선

Made-with: Cursor
This commit is contained in:
clkim
2026-02-27 15:14:16 +09:00
parent a21c4127f6
commit 9208aae87f
13 changed files with 81 additions and 32 deletions

View File

@@ -3,7 +3,7 @@ interface props {
type?: 'button' | 'link'
to?: string
target?: '_self' | '_blank'
bgColor?: string
backgroundColor?: string
srOnly?: string
}
@@ -11,7 +11,7 @@ const props = withDefaults(defineProps<props>(), {
type: 'button',
to: '',
target: '_self',
bgColor: '',
backgroundColor: '',
srOnly: '',
})
@@ -34,8 +34,8 @@ const componentProps = computed(() => {
const buttonStyle = computed(() => {
const style: Record<string, string> = {}
if (props.bgColor) {
style.backgroundColor = props.bgColor
if (props.backgroundColor) {
style.backgroundColor = props.backgroundColor
}
return style
})

View File

@@ -2,27 +2,33 @@
import type { TrackingObject } from '#layers/types/api/common'
interface Props {
bgColor?: string
category?: 'system' | 'image'
backgroundColor?: string
tracking: TrackingObject
}
const props = defineProps<Props>()
const props = withDefaults(defineProps<Props>(), { category: 'system' })
const { locale } = useI18n()
const { sendLog } = useAnalytics()
const handlePlayClick = () => {
sendLog(locale.value, props.tracking)
}
const buttonClasses = computed(() => [
'btn-play',
props.category === 'system' ? 'play-icon' : 'play-image',
])
const buttonStyle = computed(() =>
props.category === 'system' && props.backgroundColor
? { backgroundColor: props.backgroundColor }
: {}
)
const onClick = () => sendLog(locale.value, props.tracking)
</script>
<template>
<button
class="btn-play"
:style="{ backgroundColor: props.bgColor }"
@click="handlePlayClick"
>
<span class="icon">
<button :class="buttonClasses" :style="buttonStyle" @click="onClick">
<span v-if="props.category === 'system'" class="icon">
<AtomsIconsArrowRightFill />
</span>
<span class="sr-only">Play</span>
@@ -31,15 +37,35 @@ const handlePlayClick = () => {
<style scoped>
.btn-play {
@apply relative flex items-center justify-center rounded-full w-[60px] h-[60px] md:w-[80px] md:h-[80px]
@apply relative flex items-center justify-center;
}
.play-icon {
@apply w-[60px] h-[60px] md:w-[80px] md:h-[80px] rounded-full
before:content-[''] before:absolute before:top-0 before:left-0 before:w-full before:h-full before:border before:border-[rgba(255,255,255,0.5)] before:rounded-full
after:content-[''] after:absolute after:top-0 after:left-0 after:w-full after:h-full after:bg-white after:rounded-[50%] after:opacity-0 after:transition-opacity after:duration-300 after:ease-in-out
hover:after:opacity-10;
}
.btn-play:hover .icon {
.play-icon:hover .icon {
@apply scale-[1.08];
}
.icon {
@apply transition-transform duration-300 ease-spring;
}
.play-image {
@apply w-[69px] h-[69px] md:w-[110px] md:h-[110px];
}
.play-image::before {
@apply content-[''] absolute inset-0 z-0 bg-no-repeat bg-center bg-cover bg-[url(/images/common/btn_play/btn_default.png)] transition-opacity duration-300 ease-out;
}
.play-image::after {
@apply content-[''] absolute inset-0 z-0 bg-no-repeat bg-center bg-cover bg-[url(/images/common/btn_play/btn_hover.png)] opacity-0 transition-opacity duration-300 ease-out;
}
.play-image:hover::before {
@apply opacity-0;
}
.play-image:hover::after {
@apply opacity-100;
}
</style>

View File

@@ -17,7 +17,7 @@ const analytics = {
type="link"
to="/home"
class="btn-home"
bg-color="rgb(0 0 0 / 0.2)"
background-color="rgb(0 0 0 / 0.2)"
@click="sendLog(locale, analytics)"
>
<AtomsIconsHomeFill />

View File

@@ -34,7 +34,7 @@ const handleScrollToTop = () => {
v-show="showBtn"
class="btn-top"
sr-only="top"
:bg-color="backgroundColor"
:background-color="backgroundColor"
@click="handleScrollToTop"
>
<AtomsIconsArrowControlTopLine />

View File

@@ -32,7 +32,7 @@ const handleArrowClick = (direction: 'prev' | 'next') => {
<AtomsButtonCircle
sr-only="Previous"
class="splide-arrow splide__arrow--prev"
:bg-color="getArrowBgColor('prev')"
:background-color="getArrowBgColor('prev')"
@click="handleArrowClick('prev')"
>
<AtomsIconsArrowRightLine color="#ffffff" />
@@ -40,7 +40,7 @@ const handleArrowClick = (direction: 'prev' | 'next') => {
<AtomsButtonCircle
sr-only="Next"
class="splide-arrow splide__arrow--next"
:bg-color="getArrowBgColor('next')"
:background-color="getArrowBgColor('next')"
@click="handleArrowClick('next')"
>
<AtomsIconsArrowRightLine color="#ffffff" />

View File

@@ -48,7 +48,7 @@ const handleCopy = async () => {
v-show="!showSnsList"
class="btn-more"
sr-only="sns"
:bg-color="snsBackgroundColor"
:background-color="snsBackgroundColor"
@click="handleControlForce(true)"
>
<AtomsIconsShareLine class="icon-share" />

View File

@@ -72,7 +72,7 @@ onMounted(async () => {
<AtomsButtonCircle
sr-only="event navigation control"
class="btn-control"
bg-color="rgb(0 0 0 / 0.2)"
background-color="rgb(0 0 0 / 0.2)"
@click="toggleEventNavigation"
>
<AtomsIconsArrowRightLine color="#ffffff" />

View File

@@ -1,13 +1,16 @@
<script setup lang="ts">
import type { PageDataResourceGroup } from '#layers/types/api/pageData'
const props = defineProps<{
interface Props {
category?: 'system' | 'image'
resourcesData: PageDataResourceGroup
}>()
}
const props = defineProps<Props>()
const modalStore = useModalStore()
const bgColor = computed(() => {
const backgroundColor = computed(() => {
return getColorCodeFromData(props.resourcesData.display, 'none')
})
@@ -23,7 +26,8 @@ const handleVideoPlayClick = () => {
<template>
<AtomsButtonPlay
v-motion-stagger
:bg-color="bgColor"
:category="props.category"
:background-color="backgroundColor"
:tracking="props.resourcesData.tracking"
@click="handleVideoPlayClick"
/>