fix. 불필요한 파일 제거
This commit is contained in:
@@ -9,7 +9,7 @@ const { gameData } = useGameDataStore()
|
||||
|
||||
const stoveInflowPath = runtimeConfig.public.stoveInflowPath
|
||||
const stoveGameNo = runtimeConfig.public.stoveGameNo
|
||||
const gnbData = gameData?.stove_gnb_json
|
||||
const stoveGnbData = gameData?.stove_gnb_json
|
||||
|
||||
const languageCodes = computed(() => {
|
||||
if (Array.isArray(availableLocales)) {
|
||||
@@ -24,9 +24,9 @@ const loadGnb = (locale: string) => {
|
||||
locale = locale.toLowerCase()
|
||||
|
||||
const gnbOption = {
|
||||
wrapper: '#stove-wrapper',
|
||||
wrapper: '#stove-wrap',
|
||||
isResponsive: true,
|
||||
skin: gnbData?.skin_type || 'gnb-dark-mini',
|
||||
skin: stoveGnbData?.skin_type || 'gnb-dark-mini',
|
||||
widget: {
|
||||
gameListAndService: false,
|
||||
languageSelect: false,
|
||||
@@ -42,7 +42,7 @@ const loadGnb = (locale: string) => {
|
||||
params: {
|
||||
inflow_path: stoveInflowPath,
|
||||
game_no: stoveGameNo,
|
||||
show_play_button: gnbData?.stove_install_button_visible || 'Y',
|
||||
show_play_button: stoveGnbData?.stove_install_button_visible || 'Y',
|
||||
},
|
||||
redirectCurrentPage: true,
|
||||
windowTitle: undefined,
|
||||
@@ -66,5 +66,5 @@ onBeforeUnmount(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="stove-wrapper" class="relative z-[5]" />
|
||||
<div id="stove-wrap" class="relative z-[5]" />
|
||||
</template>
|
||||
|
||||
@@ -1,55 +1,52 @@
|
||||
<template>
|
||||
<div id="stove-wrapper" class="relative z-[5]" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type {
|
||||
GameDataValue,
|
||||
} from '#layers/types/api/gameData'
|
||||
import type { GameDataValue } from '#layers/types/api/gameData'
|
||||
let mountedInstance: any = null
|
||||
|
||||
onMounted(() => {
|
||||
const gameDataStore = useGameDataStore()
|
||||
const gameData = gameDataStore.gameData as GameDataValue
|
||||
const langCodes = gameData?.lang_codes
|
||||
const defaultLangCode = gameData?.default_lang_code
|
||||
const gnbData = gameData?.stove_gnb_json
|
||||
const gameDataStore = useGameDataStore()
|
||||
const gameData = gameDataStore.gameData as GameDataValue
|
||||
const langCodes = gameData?.lang_codes
|
||||
const defaultLangCode = gameData?.default_lang_code
|
||||
const stoveGnbData = gameData?.stove_gnb_json
|
||||
|
||||
const currentDomain = window.location.protocol + '//' + window.location.hostname;
|
||||
if (typeof window !== 'undefined' && (window as any).StoveGnb) {
|
||||
mountedInstance = (window as any).StoveGnb.mount('#stove-wrapper', {
|
||||
logArea: currentDomain,
|
||||
useLanguageCodeFromPath: true,
|
||||
serviceTitle: {
|
||||
pc: '',
|
||||
mobile: ''
|
||||
const currentDomain =
|
||||
window.location.protocol + '//' + window.location.hostname
|
||||
if (typeof window !== 'undefined' && (window as any).StoveGnb) {
|
||||
mountedInstance = (window as any).StoveGnb.mount('#stove-wrap', {
|
||||
logArea: currentDomain,
|
||||
useLanguageCodeFromPath: true,
|
||||
serviceTitle: {
|
||||
pc: '',
|
||||
mobile: '',
|
||||
},
|
||||
widget: {
|
||||
notification: true,
|
||||
stoveDownload: true,
|
||||
languageSelect: false,
|
||||
themeSelect: false,
|
||||
stoveMenu: {
|
||||
active: false,
|
||||
mobile: true,
|
||||
},
|
||||
widget: {
|
||||
notification: true,
|
||||
stoveDownload: true,
|
||||
languageSelect: false,
|
||||
themeSelect: false,
|
||||
stoveMenu: {
|
||||
active: false,
|
||||
mobile: true
|
||||
},
|
||||
},
|
||||
global: {
|
||||
languageCoverages: langCodes,
|
||||
defaultSelectedLanguage: defaultLangCode || 'en',
|
||||
},
|
||||
loginMethod: {
|
||||
redirectCurrentPage: true,
|
||||
},
|
||||
mode: {
|
||||
theme: {
|
||||
default: gnbData?.skin_type === 'gnb-dark-mini' ? 'dark' : 'light',
|
||||
support: ['dark', 'light'],
|
||||
},
|
||||
mini: true,
|
||||
fixed:false,
|
||||
},
|
||||
global: {
|
||||
languageCoverages: langCodes,
|
||||
defaultSelectedLanguage: defaultLangCode || 'en',
|
||||
},
|
||||
loginMethod: {
|
||||
redirectCurrentPage: true,
|
||||
},
|
||||
mode: {
|
||||
theme: {
|
||||
default:
|
||||
stoveGnbData?.skin_type === 'gnb-dark-mini' ? 'dark' : 'light',
|
||||
support: ['dark', 'light'],
|
||||
},
|
||||
mini: true,
|
||||
fixed: false,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
@@ -58,4 +55,7 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
mountedInstance = null
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
<template>
|
||||
<div id="stove-wrap" class="relative z-[5]" />
|
||||
</template>
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { useWindowSize, useWindowScroll } from '@vueuse/core'
|
||||
|
||||
interface DeviceMode {
|
||||
mode: 'desktop' | 'mobile'
|
||||
browser: 'chrome' | 'crawler' | 'edge' | 'firefox' | 'safari' | null
|
||||
isDesktop: boolean
|
||||
isMobile: boolean
|
||||
isTablet: boolean
|
||||
isIos: boolean
|
||||
isAndroid: boolean
|
||||
isDeviceReady: boolean
|
||||
}
|
||||
|
||||
export const useCommonStore = defineStore('commonStore', () => {
|
||||
const stoveGnbHeight = 48
|
||||
|
||||
const useDeviceData = useDevice()
|
||||
const { width: windowWidth, height: windowHeight } = useWindowSize()
|
||||
const { x: windowX, y: windowY } = useWindowScroll({ behavior: 'smooth' })
|
||||
|
||||
const device = ref<DeviceMode>({
|
||||
mode: useDeviceData.isMobile || useDeviceData.isTablet ? 'mobile' : 'desktop',
|
||||
browser: useDeviceData.isChrome
|
||||
? 'chrome'
|
||||
: useDeviceData.isCrawler
|
||||
? 'crawler'
|
||||
: useDeviceData.isEdge
|
||||
? 'edge'
|
||||
: useDeviceData.isFirefox
|
||||
? 'firefox'
|
||||
: useDeviceData.isSafari
|
||||
? 'safari'
|
||||
: null,
|
||||
isDesktop: useDeviceData.isDesktop,
|
||||
isMobile: useDeviceData.isMobile,
|
||||
isTablet: useDeviceData.isTablet,
|
||||
isIos: useDeviceData.isIos,
|
||||
isAndroid: useDeviceData.isAndroid,
|
||||
isDeviceReady: false
|
||||
})
|
||||
|
||||
const isPassedStoveGnb = ref(false)
|
||||
const scrollFixedXValue = ref('0px')
|
||||
const footerRef = ref<HTMLElement | null>(null)
|
||||
const isLoading = ref<boolean>(true)
|
||||
const isScrollLock = ref<boolean>(false)
|
||||
|
||||
const updateDeviceMode = () => {
|
||||
device.value.mode = useDeviceData.isMobile || useDeviceData.isTablet ? 'mobile' : 'desktop'
|
||||
device.value.browser = useDeviceData.isChrome
|
||||
? 'chrome'
|
||||
: useDeviceData.isCrawler
|
||||
? 'crawler'
|
||||
: useDeviceData.isEdge
|
||||
? 'edge'
|
||||
: useDeviceData.isFirefox
|
||||
? 'firefox'
|
||||
: useDeviceData.isSafari
|
||||
? 'safari'
|
||||
: null
|
||||
device.value.isDesktop = useDeviceData.isDesktop
|
||||
device.value.isMobile = useDeviceData.isMobile
|
||||
device.value.isTablet = useDeviceData.isTablet
|
||||
device.value.isIos = useDeviceData.isIos
|
||||
device.value.isAndroid = useDeviceData.isAndroid
|
||||
device.value.isDeviceReady = true
|
||||
}
|
||||
|
||||
const updateIsPassedStoveGnb = () => {
|
||||
isPassedStoveGnb.value = windowY.value >= stoveGnbHeight
|
||||
|
||||
if (isPassedStoveGnb.value) {
|
||||
scrollFixedXValue.value = `-${windowX.value}px`
|
||||
} else {
|
||||
scrollFixedXValue.value = '0px'
|
||||
}
|
||||
}
|
||||
|
||||
const isLoadingComplete = () => {
|
||||
isLoading.value = false
|
||||
}
|
||||
|
||||
const scrollLock = () => {
|
||||
isScrollLock.value = !isScrollLock.value
|
||||
}
|
||||
|
||||
const addScrollLock = () => {
|
||||
isScrollLock.value = true
|
||||
}
|
||||
|
||||
const removeScrollLock = () => {
|
||||
isScrollLock.value = false
|
||||
}
|
||||
|
||||
return {
|
||||
device,
|
||||
windowWidth,
|
||||
windowHeight,
|
||||
windowX,
|
||||
windowY,
|
||||
isPassedStoveGnb,
|
||||
scrollFixedXValue,
|
||||
footerRef,
|
||||
isLoading,
|
||||
isScrollLock,
|
||||
|
||||
updateDeviceMode,
|
||||
updateIsPassedStoveGnb,
|
||||
isLoadingComplete,
|
||||
scrollLock,
|
||||
addScrollLock,
|
||||
removeScrollLock
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user