fix. 액션 버튼 그라데이션 수정

This commit is contained in:
clkim
2026-01-26 11:20:19 +09:00
5 changed files with 53 additions and 5 deletions

View File

@@ -10,6 +10,7 @@ interface props {
backgroundColor?: string
textColor?: string
disabled?: boolean
gradient?: boolean
}
const props = withDefaults(defineProps<props>(), {
@@ -19,6 +20,7 @@ const props = withDefaults(defineProps<props>(), {
target: '_self',
textColor: 'var(--alternative-02)',
disabled: false,
gradient: false,
})
const componentTag = computed((): string => {
@@ -85,6 +87,7 @@ const componentProps = computed(() => {
}"
:disabled="props.disabled"
>
<i v-if="props.gradient" class="btn-gradient"></i>
<span class="btn-content">
<slot />
<AtomsIconsLongArrowRightLine
@@ -146,4 +149,13 @@ const componentProps = computed(() => {
.btn-base.size-extra-small .btn-content {
@apply gap-0.5;
}
.btn-gradient {
@apply absolute top-0 left-0 w-full h-full opacity-[0.7] mix-blend-soft-light;
background: radial-gradient(
68.19% 81.25% at 50.35% 100%,
#fff 20%,
rgba(255, 255, 255, 0) 100%
);
}
</style>

View File

@@ -17,8 +17,10 @@ const OBSERVER_OPTIONS = {
rootMargin: '-20% 0px -60% 0px', // 상단 20%, 하단 60% 마진
threshold: 0,
} as const
const AUTO_HIDE_MS = 5000
const isShowLnbWithScroll = ref(false)
let autoHideTimer: ReturnType<typeof setTimeout> | null = null
const isShowLnbWithScroll = ref(true)
const activeSection = ref<string>('')
const lnbList = computed<Record<string, PageDataLnbMenu>>(
@@ -72,6 +74,20 @@ const handleIntersection = (entries: IntersectionObserverEntry[]) => {
const observer = new IntersectionObserver(handleIntersection, OBSERVER_OPTIONS)
const clearAutoHide = () => {
if (autoHideTimer) {
clearTimeout(autoHideTimer)
autoHideTimer = null
}
}
const scheduleAutoHide = () => {
clearAutoHide()
autoHideTimer = setTimeout(() => {
isShowLnbWithScroll.value = false
}, AUTO_HIDE_MS)
}
// 요소 관찰 헬퍼 함수
const observeElement = (elementId: string) => {
const element = document.getElementById(elementId)
@@ -112,15 +128,28 @@ const handleLnbClick = (lnbItem: PageDataLnbMenu) => {
}
watch(directions, newVal => {
// 스크롤 업일 때만 표시, 다운이거나 멈춘 상태에서는 숨김
isShowLnbWithScroll.value = newVal.top === true
// 스크롤 위로: 즉시 노출 + 5초 후 자동 숨김
if (newVal.top === true) {
isShowLnbWithScroll.value = true
scheduleAutoHide()
return
}
// 스크롤 아래로: 즉시 숨김 (딜레이 없음)
if (newVal.bottom === true) {
clearAutoHide()
isShowLnbWithScroll.value = false
}
})
onMounted(() => {
observeSections()
isShowLnbWithScroll.value = true
scheduleAutoHide()
})
onUnmounted(() => {
clearAutoHide()
observer.disconnect()
})
</script>
@@ -193,7 +222,7 @@ onUnmounted(() => {
z-index: -1;
}
.lnb-wrap.is-hidden {
@apply translate-x-[110%] delay-[5s];
@apply translate-x-[110%];
}
.lnb-main {
@apply flex flex-col gap-4 items-end;

View File

@@ -7,8 +7,8 @@ import type {
const { locale } = useI18n()
const { sendLog } = useAnalytics()
const gameDomain = getGameDomain()
const breakpoints = useResponsiveBreakpoints()
const analytics = {
action_type: 'click',
@@ -54,6 +54,9 @@ const toggleEventNavigation = () => {
onMounted(async () => {
eventNavigationList.value = await getEventNavigation()
if (breakpoints.value.isMobile) {
isEventNavigationOpen.value = false
}
})
</script>

View File

@@ -174,6 +174,9 @@ onMounted(() => {
// 화면 크기 변경 시 오버플로우 재계산
watch(width, () => {
throttledCalculateOverflow()
if (isMenuOpen.value && breakpoints.value.isDesktop) {
handleMenuClose()
}
})
})
</script>

View File

@@ -148,6 +148,7 @@ const handleButtonClick = (button: PageDataResourceGroup) => {
:background-color="getColorCodeFromData(button.btn_info, 'btn')"
:text-color="getColorCodeFromData(button.btn_info, 'txt')"
:disabled="button.btn_info?.detail?.btn_type === 'DEACTIVE'"
:gradient="true"
@click="handleButtonClick(button)"
>
{{ button.btn_info?.txt_btn_name }}