From 60b306ca90cda20011cce1d47642f49136c660e6 Mon Sep 17 00:00:00 2001 From: clkim Date: Mon, 10 Nov 2025 21:11:39 +0900 Subject: [PATCH] =?UTF-8?q?feat.=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EB=84=A4?= =?UTF-8?q?=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app.vue | 54 ++- layers/components/blocks/StoveGnbNew.vue | 19 +- layers/components/blocks/UtileContainer.vue | 15 +- layers/components/blocks/modal/Toast.vue | 34 +- layers/components/layouts/EventNavigation.vue | 135 +++++++ layers/components/layouts/Footer.vue | 348 +++++++++++------- layers/components/layouts/Header.vue | 30 +- layers/components/layouts/Main.vue | 14 +- layers/components/layouts/StoveHeader.vue | 7 +- layers/composables/useCwmsArticle.ts | 63 ++++ layers/composables/useOperateResources.ts | 47 +++ layers/composables/useResourcesData.ts | 103 ------ layers/layouts/default.vue | 20 +- layers/layouts/promotion.vue | 19 +- layers/middleware/pageData.global.ts | 12 +- layers/stores/useModalStore.ts | 11 +- layers/templates/FxPreregist01/index.vue | 6 +- layers/templates/FxVideo01/index.vue | 6 +- layers/templates/GrBoard01/index.vue | 6 +- layers/templates/GrVisual02/index.vue | 6 +- .../api/{resourcesData.ts => cwmsArticle.ts} | 49 +-- layers/types/api/eventNavigation.ts | 23 ++ layers/types/api/operateResources.ts | 40 ++ layers/utils/dataUtil.ts | 2 +- 24 files changed, 647 insertions(+), 422 deletions(-) create mode 100644 layers/components/layouts/EventNavigation.vue create mode 100644 layers/composables/useCwmsArticle.ts create mode 100644 layers/composables/useOperateResources.ts delete mode 100644 layers/composables/useResourcesData.ts rename layers/types/api/{resourcesData.ts => cwmsArticle.ts} (66%) create mode 100644 layers/types/api/eventNavigation.ts create mode 100644 layers/types/api/operateResources.ts diff --git a/app/app.vue b/app/app.vue index 3df3aa1..abe7abf 100644 --- a/app/app.vue +++ b/app/app.vue @@ -16,6 +16,7 @@ const scrollStore = useScrollStore() const { setGameData } = gameDataStore const { gameData } = storeToRefs(gameDataStore) const { youtube, confirm, alert, toast, handleResetYoutube } = modalStore +const { scrollGnbPosition } = storeToRefs(scrollStore) const metaData = ref(null) @@ -51,13 +52,22 @@ const setupAllMetaData = (data: GameDataValue) => { ] // 색상 CSS 변수 생성 - const cssVariables = Object.entries(data.key_color_json ?? {}) + const cssColorVariables = Object.entries(data.key_color_json ?? {}) .map(([key, value]) => `--${key}: ${value};`) - .join('\n ') + .join('\n ') + + const commImgVariables = + data.comm_img_json?.groups + ?.map( + ({ img_name, img_path }) => + `--${img_name}: url(${getImageHost(img_path?.comm ?? '')});` + ) + .join('\n ') ?? '' const cssContent = ` :root { - ${cssVariables} + ${cssColorVariables} + ${commImgVariables} } ` @@ -81,7 +91,7 @@ const setupAllMetaData = (data: GameDataValue) => { style: [ { innerHTML: cssContent, - id: 'game-color-variables', + id: 'game-css-variables', }, ], }) @@ -109,21 +119,34 @@ gtag('event', 'screen_view', { screen_name: 'Home', }) +let rafId: number | null = null + onMounted(() => { useEventListener('scroll', scrollStore.updateScrollValue) - if (gameData.value?.comm_img_json?.groups) { - const groups = gameData.value.comm_img_json.groups - groups.forEach(({ img_name, img_path }) => { - document.documentElement.style.setProperty( - `--${img_name}`, - `url(${getImageHost(img_path?.comm ?? '')})` - ) - }) - } + + watch( + scrollGnbPosition, + newValue => { + if (rafId) { + cancelAnimationFrame(rafId) + } + rafId = requestAnimationFrame(() => { + document.documentElement.style.setProperty( + '--scroll-position', + `${newValue}px` + ) + rafId = null + }) + }, + { immediate: true } + ) }) onBeforeUnmount(() => { removeEventListener('scroll', scrollStore.updateScrollValue) + if (rafId) { + cancelAnimationFrame(rafId) + } }) @@ -160,10 +183,7 @@ onBeforeUnmount(() => { :modal-name="alert.storeModalName" @confirm-button-event="alert.storeConfirmButtonEvent" /> - + diff --git a/layers/components/blocks/StoveGnbNew.vue b/layers/components/blocks/StoveGnbNew.vue index 88c26d8..2811706 100644 --- a/layers/components/blocks/StoveGnbNew.vue +++ b/layers/components/blocks/StoveGnbNew.vue @@ -46,10 +46,12 @@ onMounted(() => { mini: true, layout: 'wide', fixed: false, - } + }, } - mountedInstance = (window as any).StoveGnb.mount('#stove-wrap', stoveGnbOptions) - + mountedInstance = (window as any).StoveGnb.mount( + '#stove-wrap', + stoveGnbOptions + ) } }) @@ -61,22 +63,17 @@ onBeforeUnmount(() => { }) diff --git a/layers/components/blocks/modal/Toast.vue b/layers/components/blocks/modal/Toast.vue index 5ea708e..3663e1e 100644 --- a/layers/components/blocks/modal/Toast.vue +++ b/layers/components/blocks/modal/Toast.vue @@ -1,39 +1,13 @@