Merge branch 'feature/202501107-all' into feature/20251001-gil
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
<LayoutsStoveHeader />
|
||||
|
||||
<Transition name="fade">
|
||||
<div v-if="!isLoading" class="flex-1 flex items-center justify-center p-25">
|
||||
<div
|
||||
v-if="!isLoading"
|
||||
class="flex-1 flex items-center justify-center p-25"
|
||||
>
|
||||
<div class="flex flex-col items-center gap-6 w-full">
|
||||
<!-- Stove Logo -->
|
||||
<div class="flex items-center justify-center h-7">
|
||||
@@ -27,10 +30,15 @@
|
||||
|
||||
<!-- Error Text -->
|
||||
<div class="flex flex-col items-center gap-2 w-full">
|
||||
<h1 class="font-medium text-xl md:text-2xl leading-[1.5] tracking-[-0.03em] text-center text-[#1F1F1F] m-0">
|
||||
<h1
|
||||
class="font-medium text-xl md:text-2xl leading-[1.5] tracking-[-0.03em] text-center text-[#1F1F1F] m-0"
|
||||
>
|
||||
<span v-dompurify-html="errorTitle"></span>
|
||||
</h1>
|
||||
<p v-dompurify-html="errorMsg" class="font-normal text-sm md:text-base leading-[1.7] md:leading-[1.625] tracking-[-0.03em] text-center text-[#666666] m-0"></p>
|
||||
<p
|
||||
v-dompurify-html="errorMsg"
|
||||
class="font-normal text-sm md:text-base leading-[1.7] md:leading-[1.625] tracking-[-0.03em] text-center text-[#666666] m-0"
|
||||
></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -50,7 +58,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
interface ErrorProps {
|
||||
error?: {
|
||||
@@ -62,7 +69,7 @@ interface ErrorProps {
|
||||
|
||||
const { tm } = useI18n()
|
||||
const props = withDefaults(defineProps<ErrorProps>(), {
|
||||
error: () => ({})
|
||||
error: () => ({}),
|
||||
})
|
||||
const nuxtError = useError()
|
||||
const currentError = computed(() => props.error || nuxtError.value)
|
||||
@@ -78,7 +85,6 @@ const localePath = useLocalePath()
|
||||
// const handleError = () => clearError({ redirect: '/' })
|
||||
const handleError = () => {
|
||||
window.location.href = localePath('/')
|
||||
// clearError({ redirect: `${localePath('/brand')}` })
|
||||
}
|
||||
const handleBack = () => {
|
||||
// 에러 상태를 클리어하고 이전 페이지로 이동
|
||||
@@ -90,15 +96,16 @@ const handleBack = () => {
|
||||
|
||||
// 백스페이스 키 처리
|
||||
const handleKeydown = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Backspace' &&
|
||||
!['INPUT', 'TEXTAREA'].includes((e.target as HTMLElement).tagName)) {
|
||||
if (
|
||||
e.key === 'Backspace' &&
|
||||
!['INPUT', 'TEXTAREA'].includes((e.target as HTMLElement).tagName)
|
||||
) {
|
||||
e.preventDefault()
|
||||
handleBack()
|
||||
}
|
||||
}
|
||||
// 500 에러 발생 시 /error 페이지로 리다이렉트
|
||||
onMounted(() => {
|
||||
|
||||
const statusCode = currentError.value?.statusCode
|
||||
|
||||
if (statusCode === 500) {
|
||||
@@ -113,14 +120,11 @@ onMounted(() => {
|
||||
isLoading.value = false
|
||||
})
|
||||
|
||||
|
||||
window.addEventListener('keydown', handleKeydown)
|
||||
window.addEventListener('popstate', handleBack)
|
||||
|
||||
})
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('keydown', handleKeydown)
|
||||
window.removeEventListener('popstate', handleBack)
|
||||
})
|
||||
|
||||
</script>
|
||||
@@ -1,7 +1,9 @@
|
||||
@import './base/_theme.css';
|
||||
@import './base/_reset.css';
|
||||
@import './base/_theme.css';
|
||||
@import './base/_font.css';
|
||||
@import './base/_transition.css';
|
||||
|
||||
@import './components/_scrollbar.css';
|
||||
@import './components/_button.css';
|
||||
@import './components/_layout.css';
|
||||
@import './components/_modal.css';
|
||||
|
||||
92
layers/assets/css/base/_font.css
Normal file
92
layers/assets/css/base/_font.css
Normal file
@@ -0,0 +1,92 @@
|
||||
@import url(https://static-cdn.onstove.com/0.0.1/font/SpoqaSans/StoveUIFont-KR.css);
|
||||
@import url(https://static-cdn.onstove.com/0.0.4/font/Inter/StoveFont-Global.css);
|
||||
@import url(https://static-cdn.onstove.com/0.0.4/font-icon/StoveFont-Icon.css);
|
||||
/* @import url(https://static-cdn.onstove.com/0.0.1/font/SpoqaSans/StoveFont-KR.css); */
|
||||
|
||||
:lang(ko) {
|
||||
font-family:
|
||||
Spoqa Han Sans Neo KR,
|
||||
-apple-system,
|
||||
Segoe UI,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
Apple Color Emoji,
|
||||
Segoe UI Emoji;
|
||||
}
|
||||
|
||||
:lang(en) {
|
||||
font-family:
|
||||
inter Global,
|
||||
-apple-system,
|
||||
Segoe UI,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
Apple Color Emoji,
|
||||
Segoe UI Emoji;
|
||||
}
|
||||
|
||||
:lang(zh),
|
||||
:lang(zh-cn) {
|
||||
font-family:
|
||||
Microsoft YaHei UI,
|
||||
-apple-system,
|
||||
Segoe UI,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
Apple Color Emoji,
|
||||
Segoe UI Emoji;
|
||||
}
|
||||
|
||||
:lang(zh-tw) {
|
||||
font-family:
|
||||
Microsoft JhengHei UI,
|
||||
-apple-system,
|
||||
Segoe UI,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
Apple Color Emoji,
|
||||
Segoe UI Emoji;
|
||||
}
|
||||
|
||||
:lang(ja) {
|
||||
font-family:
|
||||
Meiryo Yu Gothic UI,
|
||||
-apple-system,
|
||||
Segoe UI,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
Apple Color Emoji,
|
||||
Segoe UI Emoji;
|
||||
}
|
||||
|
||||
:lang(de),
|
||||
:lang(es),
|
||||
:lang(fr),
|
||||
:lang(pt) {
|
||||
font-family:
|
||||
inter Global,
|
||||
-apple-system,
|
||||
Segoe UI,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
Apple Color Emoji,
|
||||
Segoe UI Emoji;
|
||||
}
|
||||
|
||||
:lang(th) {
|
||||
font-family:
|
||||
Leelawadee UI,
|
||||
-apple-system,
|
||||
Segoe UI,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
Apple Color Emoji,
|
||||
Segoe UI Emoji;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
@layer base {
|
||||
body {
|
||||
@apply min-w-[320px] bg-black;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
body.scroll-lock {
|
||||
@apply overflow-hidden;
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
.use-base th {
|
||||
@apply font-semibold bg-gray-50;
|
||||
}
|
||||
.use-base tbody tr:nth-child(even) {
|
||||
@apply bg-gray-50;
|
||||
}
|
||||
|
||||
.use-base blockquote {
|
||||
@apply border-l-4 border-gray-300 pl-4 italic text-gray-700;
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
/* 표준형 Title Classes */
|
||||
.title-xlg {
|
||||
@apply line-clamp-4 text-[24px] font-[700] leading-[34px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:line-clamp-3 md:text-[50px] md:leading-[70px];
|
||||
@apply line-clamp-4 text-[24px] font-[700] tracking-[-0.82px] leading-[34px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:tracking-[-1.5px] md:line-clamp-3 md:text-[50px] md:leading-[70px];
|
||||
}
|
||||
.title-lg {
|
||||
@apply line-clamp-4 text-[20px] font-[700] leading-[30px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:line-clamp-3 md:text-[42px] md:leading-[56px];
|
||||
@apply line-clamp-4 text-[20px] font-[700] tracking-[-0.6px] leading-[30px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:tracking-[-1.26px] md:line-clamp-3 md:text-[42px] md:leading-[56px];
|
||||
}
|
||||
.title-md {
|
||||
@apply line-clamp-2 text-[16px] font-[500] leading-[24px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:line-clamp-1 md:text-[24px] md:leading-[34px];
|
||||
@apply line-clamp-2 text-[16px] font-[500] tracking-[-0.48px] leading-[24px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:tracking-[-0.72px] md:line-clamp-1 md:text-[24px] md:leading-[34px];
|
||||
}
|
||||
.title-sm {
|
||||
@apply text-[15px] font-[500] leading-[24px] tracking-[-0.45px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:text-[20px] md:leading-[30px] md:tracking-[-0.6px];
|
||||
|
||||
14
layers/assets/css/components/_scrollbar.css
Normal file
14
layers/assets/css/components/_scrollbar.css
Normal file
@@ -0,0 +1,14 @@
|
||||
body ::-webkit-scrollbar-track {
|
||||
@apply bg-transparent;
|
||||
}
|
||||
body ::-webkit-scrollbar {
|
||||
@apply w-5;
|
||||
}
|
||||
|
||||
body ::-webkit-scrollbar-thumb {
|
||||
@apply w-1 bg-[#D9D9D9] rounded-full bg-clip-padding border-solid border-transparent border-8;
|
||||
}
|
||||
|
||||
.custom-theme-scrollbar::-webkit-scrollbar-thumb {
|
||||
@apply bg-[var(--foreground-reversal-15)];
|
||||
}
|
||||
@@ -1,26 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
const scrollStore = useScrollStore()
|
||||
|
||||
const { isPassedStoveGnb } = storeToRefs(scrollStore)
|
||||
</script>
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
<AtomsButtonCircle
|
||||
sr-only="home"
|
||||
type="link"
|
||||
to="/"
|
||||
:class="['btn-home', { 'is-fixed': isPassedStoveGnb }]"
|
||||
>
|
||||
<AtomsButtonCircle sr-only="home" type="link" to="/" class="btn-home">
|
||||
<AtomsIconsHomeFill />
|
||||
</AtomsButtonCircle>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.btn-home {
|
||||
@apply absolute top-3 right-3 mt-[48px] bg-black/20 shadow-[0_1.667px_3.333px_0_rgba(0,0,0,0.06)] backdrop-blur-[12.5px] z-[100]
|
||||
sm:top-5 md:top-6 md:right-8 md:mt-[64px];
|
||||
}
|
||||
.btn-home.is-fixed {
|
||||
@apply fixed;
|
||||
@apply fixed top-3 right-3 mt-[calc(var(--scroll-position,48px)+48px)] bg-black/20 shadow-[0_1.667px_3.333px_0_rgba(0,0,0,0.06)] backdrop-blur-[12.5px] z-[100]
|
||||
sm:top-5 md:top-6 md:right-8 md:mt-[calc(var(--scroll-position,64px)+64px)];
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import type { PageDataLnbMenu } from '#layers/types/api/pageData'
|
||||
|
||||
const { y: windowY } = useWindowScroll({ behavior: 'smooth' })
|
||||
const { y: windowY, directions } = useWindowScroll({ behavior: 'smooth' })
|
||||
const pageDataStore = usePageDataStore()
|
||||
const breakpoints = useResponsiveBreakpoints()
|
||||
|
||||
const { pageData } = storeToRefs(pageDataStore)
|
||||
|
||||
const observerOptions = {
|
||||
// 상수 정의
|
||||
const HEADER_HEIGHT = 64
|
||||
const OBSERVER_OPTIONS = {
|
||||
root: null,
|
||||
rootMargin: '-20% 0px -60% 0px', // 상단 20%, 하단 60% 마진
|
||||
threshold: 0,
|
||||
}
|
||||
} as const
|
||||
|
||||
const isShowLnbWithScroll = ref(false)
|
||||
const activeSection = ref<string>('')
|
||||
|
||||
const lnbList = computed<Record<string, PageDataLnbMenu>>(
|
||||
@@ -39,8 +43,9 @@ const is1DepthActive = (lnbItem: PageDataLnbMenu): boolean => {
|
||||
}
|
||||
|
||||
// children 중 하나가 활성화된 경우
|
||||
if (lnbItem.children && Object.keys(lnbItem.children).length > 0) {
|
||||
return Object.values(lnbItem.children).some(
|
||||
const children = lnbItem.children
|
||||
if (children && Object.keys(children).length > 0) {
|
||||
return Object.values(children).some(
|
||||
child => activeSection.value === child.page_ver_tmpl_name_en
|
||||
)
|
||||
}
|
||||
@@ -48,54 +53,73 @@ const is1DepthActive = (lnbItem: PageDataLnbMenu): boolean => {
|
||||
return false
|
||||
}
|
||||
|
||||
const observer = new IntersectionObserver(entries => {
|
||||
// IntersectionObserver 콜백: 교차하는 섹션들 중 가장 위에 있는 것을 활성화
|
||||
const handleIntersection = (entries: IntersectionObserverEntry[]) => {
|
||||
if (import.meta.server) return
|
||||
// 교차하는 섹션들 중 가장 위에 있는 것을 활성화
|
||||
|
||||
const visibleEntries = entries
|
||||
.filter(entry => entry.isIntersecting)
|
||||
.sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)
|
||||
|
||||
if (visibleEntries.length > 0) {
|
||||
activeSection.value = visibleEntries[0].target.id
|
||||
const topEntry = visibleEntries[0]
|
||||
activeSection.value = topEntry.target.id
|
||||
}
|
||||
}, observerOptions)
|
||||
}
|
||||
|
||||
const observer = new IntersectionObserver(handleIntersection, OBSERVER_OPTIONS)
|
||||
|
||||
// 요소 관찰 헬퍼 함수
|
||||
const observeElement = (elementId: string) => {
|
||||
const element = document.getElementById(elementId)
|
||||
if (element) {
|
||||
observer.observe(element)
|
||||
}
|
||||
}
|
||||
|
||||
// 섹션들을 관찰 시작
|
||||
const observeSections = () => {
|
||||
if (import.meta.server) return
|
||||
|
||||
Object.values(lnbList.value).forEach(lnbItem => {
|
||||
// 1depth 관찰
|
||||
const el = document.getElementById(lnbItem.page_ver_tmpl_name_en)
|
||||
if (el) {
|
||||
observer.observe(el)
|
||||
}
|
||||
observeElement(lnbItem.page_ver_tmpl_name_en)
|
||||
|
||||
// 2depth 관찰
|
||||
if (lnbItem.children && Object.keys(lnbItem.children).length > 0) {
|
||||
Object.values(lnbItem.children).forEach(childItem => {
|
||||
const childEl = document.getElementById(childItem.page_ver_tmpl_name_en)
|
||||
if (childEl) {
|
||||
observer.observe(childEl)
|
||||
}
|
||||
const children = lnbItem.children
|
||||
if (children && Object.keys(children).length > 0) {
|
||||
Object.values(children).forEach(childItem => {
|
||||
observeElement(childItem.page_ver_tmpl_name_en)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// LNB 클릭 핸들러: 해당 섹션으로 스크롤
|
||||
const handleLnbClick = (lnbItem: PageDataLnbMenu) => {
|
||||
if (import.meta.server) return
|
||||
|
||||
const id = lnbItem.page_ver_tmpl_name_en
|
||||
const el = document.getElementById(id)
|
||||
if (!el) return
|
||||
const targetId =
|
||||
lnbItem.page_ver_tmpl_name_en === ''
|
||||
? lnbItem?.children?.['1']?.page_ver_tmpl_name_en
|
||||
: lnbItem.page_ver_tmpl_name_en
|
||||
|
||||
const elementTop = el.getBoundingClientRect().top
|
||||
const targetElement = document.getElementById(targetId)
|
||||
if (!targetElement) return
|
||||
|
||||
// 헤더 높이를 고려한 스크롤 위치 계산
|
||||
const elementTop = targetElement.getBoundingClientRect().top
|
||||
const currentScrollY = window.scrollY
|
||||
const headerHeight = 64
|
||||
const targetScrollY = currentScrollY + elementTop - headerHeight
|
||||
const targetScrollY = currentScrollY + elementTop - HEADER_HEIGHT
|
||||
|
||||
windowY.value = targetScrollY
|
||||
}
|
||||
|
||||
watch(directions, newVal => {
|
||||
// 스크롤 업일 때만 표시, 다운이거나 멈춘 상태에서는 숨김
|
||||
isShowLnbWithScroll.value = newVal.top === true
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
observeSections()
|
||||
})
|
||||
@@ -106,15 +130,15 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="isShowLnb">
|
||||
<div
|
||||
v-if="isShowLnb"
|
||||
class="lnb-wrap"
|
||||
:class="['lnb-wrap', { 'is-hidden': !isShowLnbWithScroll }]"
|
||||
:style="{
|
||||
'--lnb-active-color': activeColor,
|
||||
'--lnb-disable-color': disableColor,
|
||||
}"
|
||||
>
|
||||
<ul class="main-list">
|
||||
<ul class="lnb-main">
|
||||
<li v-for="lnbItem in lnbList" :key="lnbItem.path_code">
|
||||
<button
|
||||
v-dompurify-html="lnbItem.menu_name"
|
||||
@@ -124,7 +148,7 @@ onUnmounted(() => {
|
||||
></button>
|
||||
<ul
|
||||
v-if="Object.keys(lnbItem.children || {}).length > 0"
|
||||
class="sub-list"
|
||||
class="lnb-sub"
|
||||
>
|
||||
<li v-for="subItem in lnbItem.children" :key="subItem.path_code">
|
||||
<button
|
||||
@@ -133,7 +157,8 @@ onUnmounted(() => {
|
||||
:class="[
|
||||
'btn-2depth',
|
||||
{
|
||||
'is-active': activeSection === subItem.page_ver_tmpl_name_en,
|
||||
'is-active':
|
||||
activeSection === subItem.page_ver_tmpl_name_en,
|
||||
},
|
||||
]"
|
||||
@click="handleLnbClick(subItem)"
|
||||
@@ -143,42 +168,71 @@ onUnmounted(() => {
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.lnb-wrap {
|
||||
@apply fixed top-1/2 right-0 py-12 pr-[42px] text-right -translate-y-1/2 bg-[radial-gradient(100%_50%_at_100%_50%,rgba(0,0,0,0.5)_25%,rgba(0,0,0,0)_100%)] z-50;
|
||||
@apply fixed top-0 right-0 mt-[calc(var(--scroll-position,48px)+64px)] py-8 pr-10 bg-[radial-gradient(100%_50%_at_100%_50%,rgba(0,0,0,0.4)_25%,rgba(0,0,0,0)_100%)] transition-transform duration-[400ms] ease-in-out z-50;
|
||||
}
|
||||
.main-list {
|
||||
.lnb-wrap:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -5%;
|
||||
width: 105%;
|
||||
height: 100%;
|
||||
backdrop-filter: blur(5px);
|
||||
mask-image: radial-gradient(
|
||||
circle at right center,
|
||||
#000 0%,
|
||||
#000 40%,
|
||||
transparent 80%
|
||||
);
|
||||
mask-size: 100% 100%;
|
||||
mask-repeat: no-repeat;
|
||||
z-index: -1;
|
||||
}
|
||||
.lnb-wrap.is-hidden {
|
||||
@apply translate-x-[110%] delay-[800ms];
|
||||
}
|
||||
.lnb-main {
|
||||
@apply flex flex-col gap-4 items-end;
|
||||
}
|
||||
.lnb-main > li {
|
||||
@apply flex flex-col items-end;
|
||||
}
|
||||
.btn-1depth {
|
||||
@apply text-[15px] leading-[26px] tracking-[-0.54px];
|
||||
}
|
||||
.sub-list {
|
||||
@apply flex flex-col gap-2 items-end mt-4 mb-1 pr-[46px];
|
||||
.lnb-sub {
|
||||
@apply flex flex-col gap-2 items-end mt-4 mb-1 pr-[16px];
|
||||
}
|
||||
.btn-2depth {
|
||||
@apply text-[14px] leading-[20px] tracking-[-0.42px];
|
||||
}
|
||||
|
||||
button {
|
||||
@apply relative font-[500] text-[var(--lnb-disable-color)] transition-all duration-300 ease-in-out;
|
||||
@apply flex items-center font-[500] text-[var(--lnb-disable-color)] transition-all duration-300 ease-in-out;
|
||||
}
|
||||
button:hover,
|
||||
button.is-active {
|
||||
@apply text-[var(--lnb-active-color)];
|
||||
}
|
||||
button::before {
|
||||
@apply content-[''] absolute top-1/2 rounded-full -translate-y-1/2 bg-transparent transition-all duration-300 ease-in-out;
|
||||
button::after {
|
||||
@apply content-[''] rounded-full ml-2 bg-[var(--lnb-disable-color)] transition-all duration-300 ease-in-out;
|
||||
}
|
||||
button.is-active::before {
|
||||
button.is-active::after {
|
||||
@apply bg-[var(--lnb-active-color)];
|
||||
}
|
||||
.btn-1depth::before {
|
||||
.btn-1depth::after {
|
||||
@apply -right-4 w-1.5 h-1.5;
|
||||
}
|
||||
.btn-2depth::before {
|
||||
.btn-2depth::after {
|
||||
@apply -right-3.5 w-1 h-1;
|
||||
}
|
||||
|
||||
.main-promotion .lnb-wrap {
|
||||
@apply mt-[calc(var(--scroll-position,48px)+64px+72px)];
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -28,7 +28,7 @@ const loadGnb = (locale: string) => {
|
||||
const gnbOption = {
|
||||
wrapper: '#stove-wrap',
|
||||
isResponsive: true,
|
||||
skin: stoveGnbData?.skin_type || 'gnb-dark-mini',
|
||||
skin: 'gnb-dark-mini',
|
||||
widget: {
|
||||
gameListAndService: false,
|
||||
languageSelect: false,
|
||||
|
||||
@@ -22,8 +22,8 @@ onMounted(() => {
|
||||
mobile: '',
|
||||
},
|
||||
widget: {
|
||||
notification: true,
|
||||
stoveDownload: true,
|
||||
notification: stoveGnbData?.notify_icon_visible || true,
|
||||
stoveDownload: stoveGnbData?.stove_install_button_visible || true,
|
||||
languageSelect: false,
|
||||
themeSelect: false,
|
||||
stoveMenu: {
|
||||
@@ -40,9 +40,8 @@ onMounted(() => {
|
||||
},
|
||||
mode: {
|
||||
theme: {
|
||||
support: ['light', 'dark'],
|
||||
support: designTheme === 1 ? ['light'] : ['dark'],
|
||||
default: designTheme === 1 ? 'light' : 'dark',
|
||||
// support: designTheme === 1 ? ['light'] : ['dark'],
|
||||
},
|
||||
mini: true,
|
||||
layout: 'wide',
|
||||
@@ -54,7 +53,7 @@ onMounted(() => {
|
||||
stoveGnbOptions
|
||||
)
|
||||
}
|
||||
if(mountedInstance){
|
||||
if (mountedInstance) {
|
||||
//Stove GNB에서도 쿠키를 굽고 있어 소문자로 통일
|
||||
//LOCALE 쿠키를 가져온 후 소문자로 변경해서 다시 LOCALE 쿠키를 설정
|
||||
nextTick(() => {
|
||||
@@ -66,10 +65,8 @@ onMounted(() => {
|
||||
localeCookie.value = localeCookie.value.toLowerCase()
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (mountedInstance && typeof mountedInstance.destroy === 'function') {
|
||||
mountedInstance.destroy()
|
||||
|
||||
@@ -93,7 +93,7 @@ watch(isOpen, newVal => {
|
||||
:class="[
|
||||
'content-tex',
|
||||
'use-base',
|
||||
{ 'is-visible': isVisible(index) },
|
||||
{ 'is-hidden': !isVisible(index) },
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
@@ -153,13 +153,4 @@ watch(isOpen, newVal => {
|
||||
.content-tex {
|
||||
@apply overflow-y-auto mb-4 px-6 sm:mb-6 sm:px-8;
|
||||
}
|
||||
.content-tex::-webkit-scrollbar-track {
|
||||
@apply bg-transparent;
|
||||
}
|
||||
.content-tex::-webkit-scrollbar {
|
||||
@apply w-5;
|
||||
}
|
||||
.content-tex::-webkit-scrollbar-thumb {
|
||||
@apply w-1 bg-[#D9D9D9] rounded-full bg-clip-padding border-solid border-transparent border-8;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -50,7 +50,6 @@ const mainOptions = computed<Options>(() => ({
|
||||
const thumbOptions = computed<Options>(() => ({
|
||||
type: 'slide',
|
||||
rewind: true,
|
||||
// focus: 'center',
|
||||
autoWidth: true,
|
||||
perMove: 1,
|
||||
arrows: true,
|
||||
|
||||
@@ -6,9 +6,6 @@ import type {
|
||||
|
||||
const { locale } = useI18n()
|
||||
const gameDomain = useGetGameDomain()
|
||||
const scrollStore = useScrollStore()
|
||||
|
||||
const { isPassedStoveGnb } = storeToRefs(scrollStore)
|
||||
|
||||
const isEventNavigationOpen = ref(true)
|
||||
const eventNavigationList = ref<Record<string, EventNavigation>>({})
|
||||
@@ -52,7 +49,6 @@ onMounted(async () => {
|
||||
class="event-navigation"
|
||||
:class="{
|
||||
'is-closed': !isEventNavigationOpen,
|
||||
'is-fixed': isPassedStoveGnb,
|
||||
}"
|
||||
>
|
||||
<div class="navigation-wrapper">
|
||||
@@ -90,10 +86,7 @@ onMounted(async () => {
|
||||
|
||||
<style scoped>
|
||||
.event-navigation {
|
||||
@apply absolute top-0 left-0 bottom-0 mt-[48px] md:mt-[64px] z-[100] transition-transform duration-300 ease-in-out;
|
||||
}
|
||||
.event-navigation.is-fixed {
|
||||
@apply fixed;
|
||||
@apply fixed top-0 left-0 bottom-0 mt-[calc(var(--scroll-position,48px)+48px)] md:mt-[calc(var(--scroll-position,64px)+64px)] z-[100] transition-transform duration-300 ease-in-out;
|
||||
}
|
||||
.navigation-wrapper {
|
||||
@apply relative h-full p-3 sm:p-5 sm:pr-3
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { onClickOutside, useWindowSize } from '@vueuse/core'
|
||||
import { useGameDataStore } from '#layers/stores/useGameDataStore'
|
||||
import type {
|
||||
GameDataMenu,
|
||||
@@ -9,6 +8,14 @@ import type {
|
||||
PlatformTransformType,
|
||||
} from '#layers/types/api/gameData'
|
||||
|
||||
const MORE_WIDTH = 72
|
||||
const START_WIDTH_MARGIN = 40
|
||||
const PLATFORM_LABEL_KEY: Record<PlatformTransformType, string> = {
|
||||
pc: 'PC',
|
||||
google_play: 'Google Play',
|
||||
app_store: 'App Store',
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
const { tm } = useI18n()
|
||||
const { width } = useWindowSize()
|
||||
@@ -21,21 +28,23 @@ const modalStore = useModalStore()
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
const { isPassedStoveGnb } = storeToRefs(scrollStore)
|
||||
|
||||
const navAreaRef = ref<HTMLElement>()
|
||||
const startRef = ref<HTMLElement>()
|
||||
const navAreaRef = ref<HTMLElement | null>(null)
|
||||
const startRef = ref<HTMLElement | null>(null)
|
||||
|
||||
const gnbData = gameData.value?.gnb
|
||||
const { width: startWidth } = useElementSize(startRef)
|
||||
|
||||
const isMounted = ref(false)
|
||||
const isMenuOpen = ref(false)
|
||||
const navWidth = ref(0)
|
||||
const startWidth = ref(0)
|
||||
const officialItemWidths = ref<number[]>([])
|
||||
const overflowNam = ref<number>(0)
|
||||
|
||||
const gnbData = computed(() => gameData.value?.gnb)
|
||||
const gnb1depthButtonData = computed(
|
||||
() => gnbData?.buttons[0]?.button_json as GameDataResourceGroup
|
||||
() => gnbData.value?.buttons[0]?.button_json as GameDataResourceGroup
|
||||
)
|
||||
const gnb2depthButtonData = computed(
|
||||
() => gnbData?.buttons[1]?.button_json as GameDataResourceGroupSet
|
||||
() => gnbData.value?.buttons[1]?.button_json as GameDataResourceGroupSet
|
||||
)
|
||||
const currentPath = computed(() => formatPathWithoutLocale(route.path))
|
||||
const supportedPlatforms = computed(
|
||||
@@ -47,7 +56,7 @@ const supportedPlatforms = computed(
|
||||
|
||||
const pathMatches = (base: string, current: string) => {
|
||||
if (!base || base === '/') return current === '/'
|
||||
return current === base || current.startsWith(base + '/')
|
||||
return current === base
|
||||
}
|
||||
|
||||
/** 자식 중 활성 링크 존재 여부 */
|
||||
@@ -76,20 +85,10 @@ const isNavItemActive = (gnbItem: GameDataMenu): boolean => {
|
||||
|
||||
// navAreaRef의 넓이를 구하는 함수
|
||||
const calculateNavWidth = () => {
|
||||
if (!navAreaRef.value || !gnbData) return 0
|
||||
if (!navAreaRef.value || !gnbData.value) return 0
|
||||
|
||||
const navAreaWidth = navAreaRef.value.offsetWidth
|
||||
const moreWidth = 72 // 더보기 버튼 넓이 + 마진
|
||||
return navAreaWidth + moreWidth
|
||||
}
|
||||
|
||||
// startRef의 넓이를 구하는 함수
|
||||
const calculateStartWidth = () => {
|
||||
if (!startRef.value || !gnbData) return 0
|
||||
|
||||
const startWidth = startRef.value.offsetWidth
|
||||
const headerRightPadding = 40 // 헤더 오른쪽 마진
|
||||
return startWidth + headerRightPadding
|
||||
navWidth.value = navAreaWidth + MORE_WIDTH
|
||||
}
|
||||
|
||||
// official 자식들의 넓이를 구하는 함수
|
||||
@@ -108,24 +107,20 @@ const calculateOfficialItemWidths = () => {
|
||||
}
|
||||
|
||||
officialItemWidths.value = widths
|
||||
|
||||
// 해상도 체크 및 오버플로우 계산
|
||||
calculateOverflow()
|
||||
}
|
||||
|
||||
// 오버플로우 계산 함수
|
||||
const calculateOverflow = () => {
|
||||
if (!navAreaRef.value || !startRef.value) return
|
||||
|
||||
const totalNavWidth = navWidth.value + startWidth.value
|
||||
const screenWidth = width.value
|
||||
|
||||
// 모바일(1024px 미만)에서는 overflowNam을 0으로 설정
|
||||
if (screenWidth < 1024) {
|
||||
if (breakpoints.value.isMobile) {
|
||||
overflowNam.value = 0
|
||||
return
|
||||
}
|
||||
|
||||
const screenWidth = width.value
|
||||
const totalNavWidth = navWidth.value + startWidth.value + START_WIDTH_MARGIN
|
||||
|
||||
// 해상도가 navWidth + startWidth보다 작은 경우
|
||||
if (screenWidth < totalNavWidth) {
|
||||
let removedCount = 0
|
||||
@@ -166,12 +161,6 @@ const has2depthButton = (gnbItem: GameDataMenu) => {
|
||||
|
||||
const highlight = (text: string) => `<span class="highlight">${text}</span>`
|
||||
|
||||
const PLATFORM_LABEL_KEY: Record<PlatformTransformType, string> = {
|
||||
pc: 'PC',
|
||||
google_play: 'Google Play',
|
||||
app_store: 'App Store',
|
||||
}
|
||||
|
||||
const tmWithGameName = (key: string): string => {
|
||||
const raw = tm(key)
|
||||
if (typeof raw !== 'string') return ''
|
||||
@@ -215,7 +204,10 @@ const handleStartClick = () => {
|
||||
window.open(url, '_blank')
|
||||
}
|
||||
|
||||
const stopClickOutside = onClickOutside(navAreaRef, () => handleMenuClose())
|
||||
watchEffect(() => {
|
||||
if (!startWidth.value) return // 0, null, undefined면 스킵
|
||||
calculateOverflow()
|
||||
})
|
||||
|
||||
// 화면 크기 변경 시 오버플로우 재계산
|
||||
watch(width, () => {
|
||||
@@ -224,51 +216,47 @@ watch(width, () => {
|
||||
|
||||
onMounted(() => {
|
||||
overflowNam.value = 0
|
||||
isMounted.value = true
|
||||
|
||||
// 초기 계산 시도
|
||||
nextTick(() => {
|
||||
if (navAreaRef.value && startRef.value) {
|
||||
navWidth.value = calculateNavWidth()
|
||||
startWidth.value = calculateStartWidth()
|
||||
calculateNavWidth()
|
||||
calculateOfficialItemWidths()
|
||||
}
|
||||
calculateOverflow()
|
||||
})
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (stopClickOutside) {
|
||||
stopClickOutside()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="header">
|
||||
<BlocksStoveGnbNew class="h-[48px]" />
|
||||
<div :class="['game-wrap', { 'is-fixed': isPassedStoveGnb }]">
|
||||
<NuxtLinkLocale to="/brand" class="mx-auto md:hidden router-link-active router-link-exact-active">
|
||||
<AtomsLocaleLink to="/" class="mx-auto md:hidden">
|
||||
<img
|
||||
:src="getImageHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
class="h-[30px]"
|
||||
/>
|
||||
</NuxtLinkLocale>
|
||||
</atomslocalelink>
|
||||
<button class="btn-open" @click="handleMenuOpen">
|
||||
<AtomsIconsMenuBoldLine class="mx-auto" />
|
||||
<span class="sr-only">menu open</span>
|
||||
</button>
|
||||
<div :class="['nav-wrap', { 'is-open': isMenuOpen }]">
|
||||
<div ref="navAreaRef" class="nav-area">
|
||||
<div
|
||||
:class="['nav-wrap', { 'is-open': isMenuOpen }]"
|
||||
@click="handleMenuClose"
|
||||
>
|
||||
<div ref="navAreaRef" class="nav-area" @click.stop>
|
||||
<div class="nav-logo">
|
||||
<NuxtLinkLocale to="/brand" class="router-link-active router-link-exact-active" @click="handleMenuClose">
|
||||
<AtomsLocaleLink to="/" @click="handleMenuClose">
|
||||
<img
|
||||
:src="getImageHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
class="h-[30px]"
|
||||
/>
|
||||
</NuxtLinkLocale>
|
||||
</div>
|
||||
<nav class="nav-list">
|
||||
<div v-if="gnbData?.menus" class="official">
|
||||
</AtomsLocaleLink>
|
||||
<nav :class="['nav-list', { 'is-mounted': isMounted }]">
|
||||
<div v-if="gnbData?.menus" class="official custom-theme-scrollbar">
|
||||
<div
|
||||
v-for="(gnbItem, key) in gnbData?.menus"
|
||||
:key="key"
|
||||
@@ -376,17 +364,20 @@ onBeforeUnmount(() => {
|
||||
class="nav-1depth text-gradient-pink"
|
||||
>
|
||||
<AtomsIconsStarFill />
|
||||
<span>이벤트</span>
|
||||
<span>{{ tm('Gnb_Event') }}</span>
|
||||
<AtomsIconsStarFill />
|
||||
</AtomsLocaleLink>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div ref="startRef" class="btn-start">
|
||||
<ClientOnly>
|
||||
<div ref="startRef" class="btn-start">
|
||||
<template v-if="gnb1depthButtonData">
|
||||
<component
|
||||
:is="
|
||||
breakpoints.isDesktop ? 'BlocksButtonLauncher' : 'AtomsButton'
|
||||
breakpoints.isDesktop
|
||||
? 'BlocksButtonLauncher'
|
||||
: 'AtomsButton'
|
||||
"
|
||||
type="custom"
|
||||
platform="pc"
|
||||
@@ -400,7 +391,6 @@ onBeforeUnmount(() => {
|
||||
>
|
||||
{{ gnb1depthButtonData?.btn_info?.txt_btn_name }}
|
||||
</component>
|
||||
|
||||
<div
|
||||
v-if="breakpoints.isDesktop && gnb2depthButtonData"
|
||||
class="nav-2depth"
|
||||
@@ -413,8 +403,9 @@ onBeforeUnmount(() => {
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</ClientOnly>
|
||||
</template>
|
||||
</div>
|
||||
</ClientOnly>
|
||||
<button class="btn-close" @click="handleMenuClose">
|
||||
<AtomsIconsCloseLine
|
||||
size="24"
|
||||
@@ -426,12 +417,12 @@ onBeforeUnmount(() => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</div></header>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.header {
|
||||
@apply bg-theme-foreground text-theme-foreground-reversal relative z-[200];
|
||||
@apply bg-theme-foreground text-theme-foreground-reversal relative font-[500] tracking-[-0.48px] z-[200];
|
||||
}
|
||||
.game-wrap {
|
||||
@apply absolute flex w-full h-[48px] items-center whitespace-nowrap px-[52px] bg-theme-foreground sm:px-[72px] md:h-16 md:pl-0 md:pr-[40px]
|
||||
@@ -471,7 +462,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
.nav-area {
|
||||
@apply flex flex-col w-[100vw] max-w-[360px] min-w-[320px] bg-theme-foreground-10 translate-x-[-100%]
|
||||
md:inline-flex md:flex-row md:w-auto md:max-w-none md:h-full md:pl-[40px] md:items-center md:bg-transparent md:transform-none;
|
||||
md:inline-flex md:flex-row md:w-auto md:max-w-[100%] md:h-full md:pl-[40px] md:items-center md:bg-transparent md:transform-none;
|
||||
}
|
||||
|
||||
.nav-logo {
|
||||
@@ -480,7 +471,10 @@ onBeforeUnmount(() => {
|
||||
|
||||
.nav-list {
|
||||
@apply overflow-hidden flex flex-col order-1 h-full mt-2 mb-4 px-2
|
||||
md:flex-row md:order-none md:h-full md:my-0 md:ml-10 md:mr-6 md:px-0 md:overflow-visible;
|
||||
md:flex-row md:order-none md:h-full md:my-0 md:ml-10 md:mr-6 md:px-0;
|
||||
}
|
||||
.nav-list.is-mounted {
|
||||
@apply md:overflow-visible;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
@@ -528,6 +522,12 @@ onBeforeUnmount(() => {
|
||||
.official {
|
||||
@apply overflow-x-hidden overflow-y-auto pb-2 md:flex md:items-center md:space-x-8 md:pb-0 md:overflow-visible;
|
||||
}
|
||||
.custom-theme-scrollbar::-webkit-scrollbar {
|
||||
@apply w-1;
|
||||
}
|
||||
.custom-theme-scrollbar::-webkit-scrollbar-thumb {
|
||||
@apply border-0;
|
||||
}
|
||||
|
||||
.more {
|
||||
@apply relative hidden ml-[32px] pt-[11px] md:block;
|
||||
|
||||
@@ -14,6 +14,6 @@ const props = defineProps<{
|
||||
|
||||
<style scoped>
|
||||
.description {
|
||||
@apply line-clamp-4 text-[15px] font-[400] leading-[24px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:line-clamp-3 md:text-[20px] md:leading-[30px];
|
||||
@apply line-clamp-4 text-[15px] font-[400] tracking-[-0.45px] leading-[24px] drop-shadow-[0_2px_2px_rgba(0,0,0,0.6)] md:tracking-[-0.6px] md:line-clamp-3 md:text-[20px] md:leading-[30px];
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -41,13 +41,13 @@ const componentProps = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap items-end justify-between mb-[16px] md:mb-[24px]">
|
||||
<div class="flex items-end justify-between mb-[16px] md:mb-[24px]">
|
||||
<h3
|
||||
class="text-[#1F1F1F] text-[18px] font-bold leading-[26px] tracking-[-0.54px] md:text-[24px] md:leading-[34px] md:tracking-[0.72px] shrink-0"
|
||||
>
|
||||
<span>{{ props.title }}</span>
|
||||
</h3>
|
||||
<div class="flex items-center justify-between w-full">
|
||||
<div class="flex items-center justify-between">
|
||||
<slot />
|
||||
<p
|
||||
v-if="props.description && !props.link"
|
||||
|
||||
@@ -280,7 +280,7 @@ defineExpose({
|
||||
class="absolute left-0 right-0 top-0 bg-gradient-to-b from-[#292929] to-transparent z-[1] h-[24px] md:h-[32px]"
|
||||
></div>
|
||||
<div
|
||||
class="overflow-y-auto h-full py-[24px] px-5 md:py-[32px] md:px-10"
|
||||
class="overflow-y-auto h-full py-[24px] px-5 md:py-[32px] md:px-10 custom-theme-scrollbar"
|
||||
>
|
||||
<div class="px-3 py-4 md:px-6">
|
||||
<div class="flex cursor-pointer items-center gap-3 md:gap-4">
|
||||
@@ -308,7 +308,7 @@ defineExpose({
|
||||
<!-- Marketing Detail Content -->
|
||||
<div
|
||||
v-if="isExpandedMarketing"
|
||||
class="mt-4 max-h-[160px] overflow-y-auto rounded-lg bg-white/[0.04] px-4 py-3"
|
||||
class="mt-4 max-h-[160px] overflow-y-auto rounded-lg bg-white/[0.04] px-4 py-3 custom-theme-scrollbar"
|
||||
>
|
||||
<p
|
||||
v-dompurify-html="tmWithGameName('Preregist_Agree_News_Info')"
|
||||
@@ -426,27 +426,4 @@ defineExpose({
|
||||
.modal-wrap:deep(.modal-close) svg {
|
||||
@apply fill-white;
|
||||
}
|
||||
|
||||
/* Custom scrollbar for accordion content */
|
||||
:deep(.overflow-y-auto) {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
|
||||
}
|
||||
|
||||
:deep(.overflow-y-auto::-webkit-scrollbar) {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
:deep(.overflow-y-auto::-webkit-scrollbar-track) {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
:deep(.overflow-y-auto::-webkit-scrollbar-thumb) {
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
:deep(.overflow-y-auto::-webkit-scrollbar-thumb:hover) {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -12,10 +12,11 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
const gameDataStore = useGameDataStore()
|
||||
|
||||
const { setGameData } = gameDataStore
|
||||
|
||||
if (serverGameData) {
|
||||
setGameData(serverGameData)
|
||||
}
|
||||
try{
|
||||
try {
|
||||
// 서버 사이드에서는 스킵
|
||||
if (!import.meta.client) {
|
||||
return
|
||||
@@ -52,9 +53,12 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
// const { getGameDataExternal } = useGetGameDataExternal()
|
||||
// await getGameDataExternal(req)
|
||||
|
||||
|
||||
// error 페이지는 API 호출하지 않음
|
||||
if (pageUrl === '/error' || to.path.includes('/error') || to.path.includes('/inspection')) {
|
||||
if (
|
||||
pageUrl === '/error' ||
|
||||
to.path.includes('/error') ||
|
||||
to.path.includes('/inspection')
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -64,17 +68,17 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
// 현재 언어가 허용된 언어 목록에 없으면 에러 페이지로 이동
|
||||
if (currentLangCode && !allowedLangCodes.includes(currentLangCode)) {
|
||||
return navigateTo(`/${currentLangCode}/error`, { external: true })
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
showError(createError({
|
||||
statusCode: error.statusCode,
|
||||
statusMessage: error.message,
|
||||
showError(
|
||||
createError({
|
||||
statusCode: error?.statusCode || error?.status || 500,
|
||||
statusMessage:
|
||||
error?.statusMessage || error?.message || 'Internal Server Error',
|
||||
fatal: false, // 즉시 에러 페이지로
|
||||
data: { reason: 'post-not-found' }
|
||||
}))
|
||||
data: { reason: 'post-not-found' },
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
@@ -20,11 +20,7 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
const loadingStore = useLoadingStore()
|
||||
const { getPathAfterLanguage } = usePathResolver()
|
||||
|
||||
|
||||
const langCode = csrGetFinalLocale(
|
||||
to.path,
|
||||
gameData.value?.lang_codes,
|
||||
)
|
||||
const langCode = csrGetFinalLocale(to.path, gameData.value?.lang_codes)
|
||||
|
||||
try {
|
||||
if (to.path.includes('inspection')) {
|
||||
@@ -33,18 +29,16 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
}
|
||||
|
||||
const pageUrl = getPathAfterLanguage(to.path)
|
||||
console.log("🚀 ~ pageUrl:", pageUrl)
|
||||
|
||||
// pageUrl이 빈값이거나 null이면 /brand로 리다이렉트
|
||||
if (
|
||||
!pageUrl ||
|
||||
pageUrl === '' ||
|
||||
pageUrl === '/' ||
|
||||
pageUrl === `/${langCode}/`
|
||||
) {
|
||||
return navigateTo(`/${langCode}/brand`, { external: false })
|
||||
}
|
||||
|
||||
// if (
|
||||
// !pageUrl ||
|
||||
// pageUrl === '' ||
|
||||
// pageUrl === '/' ||
|
||||
// pageUrl === `/${langCode}/`
|
||||
// ) {
|
||||
// return navigateTo(`/${langCode}/brand`, { external: false })
|
||||
// }
|
||||
|
||||
// error 페이지는 API 호출하지 않음
|
||||
if (pageUrl === '/error' || to.path.includes('/error')) {
|
||||
|
||||
@@ -67,7 +67,11 @@ const cache = new LRUCache({
|
||||
* @param finalLocale - 최종 언어
|
||||
* @param baseDomain - 기본 도메인
|
||||
*/
|
||||
function setFinalLocaleCookie(event: any, finalLocale: string, baseDomain: string) {
|
||||
function setFinalLocaleCookie(
|
||||
event: any,
|
||||
finalLocale: string,
|
||||
baseDomain: string
|
||||
) {
|
||||
setCookie(event, 'LOCALE', finalLocale.toLowerCase(), {
|
||||
domain: baseDomain,
|
||||
path: '/',
|
||||
@@ -95,7 +99,6 @@ function fnLocaleMiddleware(event: any, finalLocale: string) {
|
||||
// 쿼리스트링 포함 시 순수 경로만 추출
|
||||
arrPath = path.split('?')[0].split('/')
|
||||
queryString = path.split('?')[1]
|
||||
|
||||
} else {
|
||||
arrPath = path.split('/')
|
||||
queryString = ''
|
||||
@@ -237,7 +240,12 @@ export default defineEventHandler(async event => {
|
||||
}
|
||||
|
||||
// 2. 언어 코드 추출
|
||||
finalLocale = ssrGetFinalLocale(event?.node.req.url, event.node.req.headers, initLangCodes, initDefaultLocale)
|
||||
finalLocale = ssrGetFinalLocale(
|
||||
event?.node.req.url,
|
||||
event.node.req.headers,
|
||||
initLangCodes,
|
||||
initDefaultLocale
|
||||
)
|
||||
|
||||
const path = event?.node.req.url || ''
|
||||
let queryStringF = ''
|
||||
@@ -270,6 +278,7 @@ export default defineEventHandler(async event => {
|
||||
game_domain: cleanHost || '',
|
||||
lang_code: finalLocale,
|
||||
}
|
||||
|
||||
const response = (await $fetch(apiUrl, {
|
||||
query: queryParams,
|
||||
})) as GameDataResponse | null
|
||||
@@ -283,7 +292,7 @@ export default defineEventHandler(async event => {
|
||||
event.context.gameData = response.value
|
||||
event.context.googleAnalyticsId = response.value?.ga_code
|
||||
|
||||
// console.log('🚀 ~ gameData:', response.value)
|
||||
console.log('🚀 ~ gameData:', response.value)
|
||||
|
||||
// 점검 데이터 조회
|
||||
let inspectionData
|
||||
@@ -305,7 +314,6 @@ export default defineEventHandler(async event => {
|
||||
)
|
||||
inspectionData = inspectionResponse?.value?.inspection
|
||||
cache.set(cacheKey, inspectionData) // 캐시에 저장
|
||||
// console.log("🚀 ~ inspectionData:", inspectionData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,7 +354,10 @@ export default defineEventHandler(async event => {
|
||||
// 허용된 IP 목록 확인
|
||||
if (!inspectionData?.ip_filter_list?.includes(clientIP)) {
|
||||
// 허용되지 않은 IP인 경우 점검 페이지로 이동
|
||||
if (!event.node.res.headersSent && !event.node.res.writableEnded) {
|
||||
if (
|
||||
!event.node.res.headersSent &&
|
||||
!event.node.res.writableEnded
|
||||
) {
|
||||
event.node.res.statusCode = 302
|
||||
event.node.res.setHeader('Location', inspectionPath)
|
||||
event.node.res.end()
|
||||
@@ -404,6 +415,28 @@ export default defineEventHandler(async event => {
|
||||
}
|
||||
}
|
||||
}
|
||||
// -------------------------------------------------------------------------------
|
||||
// [Root Path Redirect to /home]
|
||||
// 언어 코드만 있는 경로(예: /ko, /ko/)를 /home 리다이렉트
|
||||
// -------------------------------------------------------------------------------
|
||||
const normalizedPath = fullPath.endsWith('/')
|
||||
? fullPath.slice(0, -1)
|
||||
: fullPath
|
||||
const localePath = `/${finalLocale}`
|
||||
if (normalizedPath === localePath) {
|
||||
const defaultPath = `/${finalLocale}/home`
|
||||
const queryString = event?.node.req.url?.includes('?')
|
||||
? '?' + event.node.req.url.split('?')[1]
|
||||
: ''
|
||||
|
||||
if (!event.node.res.headersSent && !event.node.res.writableEnded) {
|
||||
event.node.res.statusCode = 302
|
||||
event.node.res.setHeader('Location', defaultPath + queryString)
|
||||
event.node.res.end()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// [Locale Middleware]
|
||||
// -------------------------------------------------------------------------------
|
||||
@@ -429,7 +462,7 @@ export default defineEventHandler(async event => {
|
||||
}
|
||||
// finalLocale이 undefined인 경우 기본값으로 'ko' 설정
|
||||
|
||||
console.log("🚀 ~ 여기도 타? error:", error)
|
||||
console.log('🚀 ~ 여기도 타? error:', error)
|
||||
throw createError({
|
||||
statusCode: error.statusCode,
|
||||
statusMessage: error.statusMessage,
|
||||
|
||||
@@ -135,6 +135,7 @@ const handleLoadMoreRecent = () => {
|
||||
class="relative content-static bg-[#fff] rounded-[12px] md:rounded-[16px]"
|
||||
>
|
||||
<BlocksSlideFade
|
||||
:arrows="recommendedVideos.length > 1"
|
||||
:pagination="false"
|
||||
:drag="false"
|
||||
@move="handleSplideMove"
|
||||
|
||||
@@ -70,9 +70,11 @@ const onArrowClick = (direction, targetIndex) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="pt-[80px] pb-[100px] md:pt-[120px] md:pb-[140px]">
|
||||
<section class="section-standard">
|
||||
<WidgetsBackground v-if="backgroundData" :resources-data="backgroundData" />
|
||||
<div class="content-standard px-0 max-w-[2043px] mx-auto">
|
||||
<div
|
||||
class="content-standard justify-start pt-[80px] px-0 max-w-[2043px] mx-auto md:pt-[120px]"
|
||||
>
|
||||
<WidgetsMainTitle
|
||||
v-if="mainTitleData"
|
||||
:resources-data="mainTitleData"
|
||||
|
||||
@@ -36,8 +36,8 @@ const onArrowClick = direction => {
|
||||
<section class="section-standard">
|
||||
<BlocksSlideFade
|
||||
v-if="slideData"
|
||||
:arrows="true"
|
||||
:pagination="true"
|
||||
:arrows="slideData.length > 1"
|
||||
:pagination="slideData.length > 1"
|
||||
class="h-full"
|
||||
:pagination-data="paginationData"
|
||||
@arrow-click="onArrowClick"
|
||||
|
||||
@@ -212,8 +212,8 @@ export type StoveGnbSkinType =
|
||||
|
||||
// Stove GNB 타입
|
||||
export interface GameDataStoveGnb {
|
||||
skin_type: StoveGnbSkinType
|
||||
stove_install_button_visible: string
|
||||
notify_icon_visible: boolean
|
||||
stove_install_button_visible: boolean
|
||||
}
|
||||
|
||||
// 이벤트 배너 타입
|
||||
|
||||
BIN
public/images/sample/GR_BOARD_01/common/bg.jpg
Normal file
BIN
public/images/sample/GR_BOARD_01/common/bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
public/images/sample/GR_BOARD_01/common/bg_m.jpg
Normal file
BIN
public/images/sample/GR_BOARD_01/common/bg_m.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 396 KiB |
BIN
public/images/sample/GR_CONTENTS_01/common/bg.jpg
Normal file
BIN
public/images/sample/GR_CONTENTS_01/common/bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
BIN
public/images/sample/GR_CONTENTS_01/common/bg_m.jpg
Normal file
BIN
public/images/sample/GR_CONTENTS_01/common/bg_m.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 MiB |
BIN
public/images/sample/GR_CONTENTS_01/ko/img_slide01.png
Normal file
BIN
public/images/sample/GR_CONTENTS_01/ko/img_slide01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 563 KiB |
BIN
public/images/sample/GR_CONTENTS_01/ko/img_slide01_m.png
Normal file
BIN
public/images/sample/GR_CONTENTS_01/ko/img_slide01_m.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 MiB |
Reference in New Issue
Block a user