diff --git a/app/pages/error.vue b/app/pages/error.vue new file mode 100644 index 0000000..1068f43 --- /dev/null +++ b/app/pages/error.vue @@ -0,0 +1,9 @@ + + + + Dang + It looks like something broke. + Sorry about that. + + + \ No newline at end of file diff --git a/app/pages/index.vue b/app/pages/index.vue index dceae28..43db7c4 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -7,6 +7,8 @@ const { pageData } = storeToRefs(pageDataStore) const currentLayout = computed(() => getLayoutType(pageData.value)) +console.log("๐ ~ currentLayout:", currentLayout) + definePageMeta({ layout: false, // ๋์ ๋ ์ด์์์ ์ํด ๊ธฐ๋ณธ ๋ ์ด์์ ๋นํ์ฑํ }) diff --git a/error.vue b/error.vue new file mode 100644 index 0000000..dc92961 --- /dev/null +++ b/error.vue @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + {{ tm('Error_Official_Page') }} + + + + + + + + + + \ No newline at end of file diff --git a/layers/components/blocks/LanguageSwitcher.vue b/layers/components/blocks/LanguageSwitcher.vue index 979af39..5fdc18f 100644 --- a/layers/components/blocks/LanguageSwitcher.vue +++ b/layers/components/blocks/LanguageSwitcher.vue @@ -1,14 +1,33 @@ - - + + + - - + + @@ -18,32 +37,31 @@ - - - {{ getCurrentLanguageName() }} - + + {{ isChanging ? '์ธ์ด ๋ณ๊ฒฝ ์ค...' : getLanguageName(selectedLocale) }} + + + + + + + + - - - - - - - + + + - - - {{ getLanguageName(localeOption) }} + {{ localeItem.name }} - - - - ๋ณ๊ฒฝ ์ค... - + + @@ -74,17 +86,12 @@ const gameDataStore = useGameDataStore() // ์ฌ์ฉ ๊ฐ๋ฅํ ์ธ์ด ๋ชฉ๋ก const availableLanguages = computed(() => { - return gameDataStore.gameData?.lang_codes || ['ko'] + return gameDataStore.gameData?.lang_codes?.map(localeCode => ({ + code: localeCode, + name: getLanguageName(localeCode) + })) || [{ code: 'ko', name: 'ํ๊ตญ์ด' }] }) -const { locale, setLocale } = useI18n() -const switchLocalePath = useSwitchLocalePath() -const pageDataStore = usePageDataStore() - -const selectedLocale = ref(locale.value) -const isChanging = ref(false) -const isDropdownOpen = ref(false) - // ์ธ์ด ์ฝ๋๋ฅผ ํ๊ตญ์ด ์ด๋ฆ์ผ๋ก ๋ณํํ๋ ํจ์ const getLanguageName = (localeCode: string) => { const languageNames: Record = { @@ -103,18 +110,19 @@ const getLanguageName = (localeCode: string) => { return languageNames[localeCode] || localeCode } -// ํ์ฌ ์ธ์ด ์ด๋ฆ ๋ฐํ -const getCurrentLanguageName = () => { - return getLanguageName(selectedLocale.value) -} +const { locale, setLocale } = useI18n() +const switchLocalePath = useSwitchLocalePath() +const pageDataStore = usePageDataStore() +const selectedLocale = ref(locale.value) +const isChanging = ref(false) +const isDropdownOpen = ref(false) // ๋๋กญ๋ค์ด ํ ๊ธ ํจ์ const toggleDropdown = () => { if (!isChanging.value) { isDropdownOpen.value = !isDropdownOpen.value } } - // ์ธ์ด ์ ํ ํจ์ const selectLanguage = async (localeCode: string) => { if (localeCode === selectedLocale.value || isChanging.value) { @@ -122,12 +130,11 @@ const selectLanguage = async (localeCode: string) => { return } - selectedLocale.value = localeCode + selectedLocale.value = localeCode as any isDropdownOpen.value = false await switchLanguage() } - -// ์ธ์ด ๋ณ๊ฒฝ ํจ์ (CSR ๋ฐฉ์) +// ์ธ์ด ๋ณ๊ฒฝ ํจ์ (์๋ฒ ๋ฏธ๋์จ์ด๋ฅผ ํตํ gameData ๊ฐฑ์ ) const switchLanguage = async () => { if (!selectedLocale.value || isChanging.value) return @@ -139,18 +146,26 @@ const switchLanguage = async () => { if (path) { // ํ์ด์ง ๋ฐ์ดํฐ ์ด๊ธฐํ (์๋ก์ด ์ธ์ด๋ก ๋ค์ ๋ก๋๋๋๋ก) pageDataStore.clearPageData() - + window.location.href = path // ์ธ์ด ๋ณ๊ฒฝ ๋ฐ ๋ผ์ฐํ - await setLocale(selectedLocale.value as any) - // await router.push(path) + // await setLocale(selectedLocale.value as any) + + // ์ ์ฒด ํ์ด์ง์ ํ์ด๋ ์์ ํจ๊ณผ ์ ์ฉ + // document.body.style.transition = 'opacity 0.1s ease-out' + // document.body.style.opacity = '0' + + // // ํ์ด๋ ์์ ์๋ฃ ํ ํ์ด์ง ์ด๋ + // await new Promise(resolve => setTimeout(resolve, 100)) + + // ์๋ฒ ๋ฏธ๋์จ์ด๋ฅผ ํตํด gameData ๊ฐฑ์ ์ ์ํด ํ์ด์ง ์๋ก๊ณ ์นจ + // ์ด๋ ๊ฒ ํ๋ฉด ์๋ฒ ๋ฏธ๋์จ์ด๊ฐ ์๋ก์ด ์ธ์ด๋ก gameData๋ฅผ ๋ค์ ๊ฐ์ ธ์ด - // ํ์ด์ง ์๋ก๊ณ ์นจ์ ํตํด ๋ฐ์ดํฐ ์ฌ๋ก๋ ๋ณด์ฅ - await nextTick() - window.location.reload() } } catch { // ์ค๋ฅ ๋ฐ์ ์ ์ด์ ์ธ์ด๋ก ๋ณต์ selectedLocale.value = locale.value + // ํ์ด๋ ํจ๊ณผ ๋ณต์ + document.body.style.opacity = '1' } finally { isChanging.value = false } @@ -160,20 +175,85 @@ const switchLanguage = async () => { watch(locale, newLocale => { selectedLocale.value = newLocale }) - -// ์ธ๋ถ ํด๋ฆญ ์ ๋๋กญ๋ค์ด ๋ซ๊ธฐ -onMounted(() => { - const handleClickOutside = (event: Event) => { - const target = event.target as HTMLElement - if (!target.closest('.relative')) { - isDropdownOpen.value = false - } - } - - document.addEventListener('click', handleClickOutside) - - onUnmounted(() => { - document.removeEventListener('click', handleClickOutside) - }) -}) + \ No newline at end of file diff --git a/layers/components/layouts/Footer.vue b/layers/components/layouts/Footer.vue index 259cb8a..e927e8c 100644 --- a/layers/components/layouts/Footer.vue +++ b/layers/components/layouts/Footer.vue @@ -24,12 +24,12 @@ - {{ tm('Footer_AgeRating') }} + {{ footerAgeRating }} - {{ tm('Footer_AgeRating') }} + {{ footerAgeRating }} @@ -55,23 +55,23 @@ - {{ tm('Footer_AgeRating_Info')[0] }} + {{ footerAgeRatingInfo[0] }} {{ footerData.game_rating_info.company_name }} - {{ tm('Footer_AgeRating_Info')[1] }} + {{ footerAgeRatingInfo[1] }} {{ footerData.game_rating_info.rating_grade }} - {{ tm('Footer_AgeRating_Info')[2] }} + {{ footerAgeRatingInfo[2] }} {{ footerData.game_rating_info.reg_no }} - {{ tm('Footer_AgeRating_Info')[3] }} + {{ footerAgeRatingInfo[3] }} {{ footerData.game_rating_info.prod_date }} - {{ tm('Footer_AgeRating_Info')[4] }} + {{ footerAgeRatingInfo[4] }} {{ footerData.game_rating_info.rating_class_no }} @@ -85,7 +85,7 @@ @@ -93,11 +93,11 @@ - {{ tm('Footer_caution') }} + {{ footerCaution }} - {{ tm('Footer_Copyright') }} + © Smilegate. All rights reserved @@ -144,10 +144,11 @@ diff --git a/layers/middleware/init.route.global.ts b/layers/middleware/init.route.global.ts index e61a5bd..112ead5 100644 --- a/layers/middleware/init.route.global.ts +++ b/layers/middleware/init.route.global.ts @@ -23,7 +23,7 @@ export default defineNuxtRouteMiddleware(async (to, _from) => { // ํ์ฉ๋ ์ธ์ด ์ฝ๋ ๋ชฉ๋ก const allowedLangCodes = gameDataStore.gameData.lang_codes || [] - // ํ์ฌ ์ธ์ด๊ฐ ํ์ฉ๋ ์ธ์ด ๋ชฉ๋ก์ ์์ผ๋ฉด 404๋ก ๋ฆฌ๋ค์ด๋ ํธ + // ํ์ฌ ์ธ์ด๊ฐ ํ์ฉ๋ ์ธ์ด ๋ชฉ๋ก์ ์์ผ๋ฉด ์๋ฌ ํ์ด์ง๋ก ์ด๋ if (currentLangCode && !allowedLangCodes.includes(currentLangCode)) { throw createError({ statusCode: 404, diff --git a/layers/utils/dataUtil.ts b/layers/utils/dataUtil.ts index 1b62cac..7c3d66d 100644 --- a/layers/utils/dataUtil.ts +++ b/layers/utils/dataUtil.ts @@ -19,7 +19,7 @@ import type { OperateComponents } from '#layers/types/api/resourcesData' export const getLayoutType = ( pageData: PageDataValue | null ): 'default' | 'promotion' => { - return pageData?.page_type === 1 ? 'default' : 'promotion' + return pageData?.page_type === 2 ? 'promotion' : 'default' } /** diff --git a/public/images/common/img_error.png b/public/images/common/img_error.png new file mode 100644 index 0000000..c3dbc4a Binary files /dev/null and b/public/images/common/img_error.png differ diff --git a/public/images/common/logo-stove.svg b/public/images/common/logo-stove.svg new file mode 100644 index 0000000..208d0a5 --- /dev/null +++ b/public/images/common/logo-stove.svg @@ -0,0 +1,3 @@ + + +
It looks like something broke.
Sorry about that.