Code for https://gm112.neocities.org/ gm112.neocities.org/

fix: FOUC caused by nuxt/i18n chore: styling changes

+168 -128
-123
app/app.config.ts
··· 1 - export default defineAppConfig({ 2 - ui: { 3 - colors: { 4 - primary: 'blue', 5 - neutral: 'neutral', 6 - red: 'red', 7 - }, 8 - header: { 9 - slots: { 10 - root: 'border-0', 11 - title: 'text-alttp-white hover:no-underline hover:text-muted font-normal', 12 - }, 13 - }, 14 - main: { 15 - base: 'flex', 16 - }, 17 - link: { 18 - variants: { 19 - active: { 20 - false: 'text-zelda-alttp-triforce-gold hover:text-alttp-white', 21 - }, 22 - }, 23 - compoundVariants: [ 24 - { 25 - active: false, 26 - disabled: false, 27 - class: ['hover:underline hover:underline-offset-1'], 28 - }, 29 - ], 30 - }, 31 - contentToc: { 32 - slots: { 33 - trigger: 'text-[32px] font-normal', 34 - link: 'text-base font-normal', 35 - }, 36 - compoundVariants: [ 37 - { 38 - color: 'primary', 39 - active: true, 40 - class: { 41 - link: 'text-highlighted underline underline-offset-1', 42 - linkLeadingIcon: 'text-highlighted', 43 - }, 44 - }, 45 - ], 46 - }, 47 - 48 - navigationMenu: { 49 - slots: { 50 - link: 'text-base font-normal text-shadow-none', 51 - childLink: 'text-base font-normal text-shadow-none', 52 - linkLabel: 'text-clip', 53 - }, 54 - }, 55 - 56 - contentSurround: { 57 - slots: { 58 - link: ['border-0 hover:underline'], 59 - linkLeading: [ 60 - 'bg-inherit border-0 rounded-none hover:bg-inherit ring-0 group-hover:ring-0', 61 - ], 62 - linkLeadingIcon: ['bg-inherit group-hover:bg-inherit link-da-flute-boi-img'], 63 - linkTitle: ['alttp-text text-base font-normal'], 64 - linkDescription: ['alttp-text text-base font-normal'], 65 - }, 66 - variants: { 67 - direction: { 68 - left: 'text-center', 69 - linkLeadingIcon: ['translate-40'], 70 - }, 71 - }, 72 - }, 73 - prose: { 74 - a: { 75 - base: 'text-zelda-alttp-triforce-gold hover:text-zelda-alttp-triforce-gold-50', 76 - }, 77 - h1: { 78 - slots: { 79 - base: 'text-[64px] font-normal', 80 - }, 81 - }, 82 - h2: { 83 - slots: { 84 - base: 'text-[48px] font-normal', 85 - leading: 'top-5.5', 86 - }, 87 - }, 88 - h3: { 89 - slots: { 90 - base: 'text-[32px] font-normal', 91 - leading: 'top-2 ', 92 - }, 93 - }, 94 - 95 - pre: { 96 - slots: { 97 - filename: 'text-base', 98 - }, 99 - }, 100 - 101 - code: { 102 - base: 'alttp-text text-base font-normal', 103 - variants: { 104 - color: { 105 - primary: 'text-alttp-white', 106 - }, 107 - }, 108 - }, 109 - 110 - codeGroup: { 111 - slots: { 112 - trigger: 'text-base alttp-text', 113 - triggerLabel: 'text-clip', 114 - }, 115 - }, 116 - codeCollapse: { 117 - slots: { 118 - trigger: 'text-base font-normal alttp-text [&>span]:text-clip [&>span]:overflow-visible', 119 - }, 120 - }, 121 - }, 122 - }, 123 - })
+2 -2
app/components/post/detail.vue
··· 3 3 <ui-widget class="border-0 border-alttp"> 4 4 <template #header> 5 5 <section class="p-2 mx-2"> 6 - <h1 class="text-[32px]"> 6 + <h1 class="text-[80px]"> 7 7 {{ page.title }} 8 8 </h1> 9 - <h2 v-if="!!page.description" class="text-sm py-2"> 9 + <h2 v-if="!!page.description" class="text-[32px] font-bold py-2"> 10 10 {{ page.description }} 11 11 </h2> 12 12 </section>
+125 -1
layers/00.base/nuxt.config.ts
··· 1 1 import type { FileBeforeParseHook } from '@nuxt/content' 2 2 3 3 export default defineNuxtConfig({ 4 + appConfig: { 5 + ui: { 6 + colors: { 7 + primary: 'blue', 8 + neutral: 'neutral', 9 + red: 'red', 10 + }, 11 + header: { 12 + slots: { 13 + root: 'border-0', 14 + title: 'text-alttp-white hover:no-underline hover:text-muted font-normal', 15 + }, 16 + }, 17 + main: { 18 + base: 'flex', 19 + }, 20 + link: { 21 + variants: { 22 + active: { 23 + false: 'text-zelda-alttp-triforce-gold hover:text-alttp-white', 24 + }, 25 + }, 26 + compoundVariants: [ 27 + { 28 + active: false, 29 + disabled: false, 30 + class: ['hover:underline hover:underline-offset-1'], 31 + }, 32 + ], 33 + }, 34 + contentToc: { 35 + slots: { 36 + trigger: 'text-[32px] font-normal', 37 + link: 'text-base font-normal', 38 + }, 39 + compoundVariants: [ 40 + { 41 + color: 'primary', 42 + active: true, 43 + class: { 44 + link: 'text-highlighted underline underline-offset-1', 45 + linkLeadingIcon: 'text-highlighted', 46 + }, 47 + }, 48 + ], 49 + }, 50 + 51 + navigationMenu: { 52 + slots: { 53 + link: 'text-base font-normal text-shadow-none', 54 + childLink: 'text-base font-normal text-shadow-none', 55 + linkLabel: 'text-clip', 56 + }, 57 + }, 58 + 59 + contentSurround: { 60 + slots: { 61 + link: ['border-0 hover:underline'], 62 + linkLeading: [ 63 + 'bg-inherit border-0 rounded-none hover:bg-inherit ring-0 group-hover:ring-0', 64 + ], 65 + linkLeadingIcon: ['bg-inherit group-hover:bg-inherit link-da-flute-boi-img'], 66 + linkTitle: ['alttp-text text-base font-normal'], 67 + linkDescription: ['alttp-text text-base font-normal'], 68 + }, 69 + variants: { 70 + direction: { 71 + left: 'text-center', 72 + linkLeadingIcon: ['translate-40'], 73 + }, 74 + }, 75 + }, 76 + prose: { 77 + a: { 78 + base: 'text-zelda-alttp-triforce-gold hover:text-zelda-alttp-triforce-gold-50', 79 + }, 80 + h1: { 81 + slots: { 82 + base: 'text-[64px] font-normal', 83 + }, 84 + }, 85 + h2: { 86 + slots: { 87 + base: 'text-[48px] font-normal', 88 + leading: 'top-5.5', 89 + }, 90 + }, 91 + h3: { 92 + slots: { 93 + base: 'text-[32px] font-normal', 94 + leading: 'top-2 ', 95 + }, 96 + }, 97 + 98 + pre: { 99 + slots: { 100 + filename: 'text-base', 101 + }, 102 + }, 103 + 104 + code: { 105 + base: 'alttp-text text-base font-normal', 106 + variants: { 107 + color: { 108 + primary: 'text-alttp-white', 109 + }, 110 + }, 111 + }, 112 + 113 + codeGroup: { 114 + slots: { 115 + trigger: 'text-base alttp-text', 116 + triggerLabel: 'text-clip', 117 + }, 118 + }, 119 + codeCollapse: { 120 + slots: { 121 + trigger: 122 + 'text-base font-normal alttp-text [&>span]:text-clip [&>span]:overflow-visible', 123 + }, 124 + }, 125 + }, 126 + }, 127 + }, 4 128 modules: [ 5 129 // '@nuxt/eslint', FIXME: May remove entirely just for oxlint usage. 6 130 '@nuxt/ui', ··· 44 168 typescriptBundlerResolution: true, 45 169 }, 46 170 experimental: { 47 - nitroAutoImports: true, 171 + nitroAutoImports: false, 48 172 appManifest: true, 49 173 asyncContext: true, 50 174 asyncEntry: true,
+5
nuxt.config.ts
··· 25 25 i18n: { 26 26 locales: [{ code: 'en', iso: 'en-US', file: 'en.ts', dir: 'ltr', language: 'en-US' }], 27 27 defaultLocale: 'en', 28 + experimental: { 29 + preload: true, 30 + stripMessagesPayload: true, 31 + typedOptionsAndMessages: 'default', 32 + }, 28 33 }, 29 34 pwa: { 30 35 registerType: 'autoUpdate',
+3
package.json
··· 40 40 "pnpm": { 41 41 "overrides": { 42 42 "vite": "npm:rolldown-vite@7.3.1" 43 + }, 44 + "patchedDependencies": { 45 + "@nuxtjs/i18n": "patches/@nuxtjs__i18n.patch" 43 46 } 44 47 }, 45 48 "packageManager": "pnpm@10.30.2+sha512.36cdc707e7b7940a988c9c1ecf88d084f8514b5c3f085f53a2e244c2921d3b2545bc20dd4ebe1fc245feec463bb298aecea7a63ed1f7680b877dc6379d8d0cb4"
+26
patches/@nuxtjs__i18n.patch
··· 1 + diff --git a/dist/runtime/shared/detection.js b/dist/runtime/shared/detection.js 2 + index f1acf851083906e21a2a429898d380d1b0adeb17..f7456a4a1125fc7bf2e716dec35c86670b790424 100644 3 + --- a/dist/runtime/shared/detection.js 4 + +++ b/dist/runtime/shared/detection.js 5 + @@ -6,9 +6,8 @@ import { parseAcceptLanguage } from "@intlify/utils"; 6 + import { matchDomainLocale } from "./domain.js"; 7 + import { useRuntimeI18n } from "../shared/utils.js"; 8 + import { useCookie } from "#app"; 9 + -const getCookieLocale = (event, cookieName) => (import.meta.client ? useCookie(cookieName).value : getCookie(event, cookieName)) || void 0; 10 + const getRouteLocale = (event, route) => getLocaleFromRoute(route); 11 + -const getHeaderLocale = (event) => findBrowserLocale(normalizedLocales, parseAcceptLanguage(getRequestHeader(event, "accept-language") || "")); 12 + + 13 + const getNavigatorLocale = (event) => findBrowserLocale(normalizedLocales, navigator.languages); 14 + const getHostLocale = (event, path, domainLocales) => { 15 + const host = import.meta.client ? new URL(window.location.href).host : getRequestURL(event, { xForwardedHost: true }).host; 16 + @@ -24,8 +23,8 @@ export const useDetectors = (event, config, nuxtApp) => { 17 + } 18 + const runtimeI18n = useRuntimeI18n(nuxtApp); 19 + return { 20 + - cookie: () => getCookieLocale(event, config.cookieKey), 21 + - header: () => import.meta.server ? getHeaderLocale(event) : void 0, 22 + + cookie: () => (import.meta.client ? useCookie(config.cookieKey).value : getCookie(event, config.cookieKey)) || void 0, 23 + + header: () => import.meta.server ? findBrowserLocale(normalizedLocales, parseAcceptLanguage(getRequestHeader(event, "accept-language") || "")) : void 0, 24 + navigator: () => import.meta.client ? getNavigatorLocale(event) : void 0, 25 + host: (path) => getHostLocale(event, path, runtimeI18n.domainLocales), 26 + route: (path) => getRouteLocale(event, path)
+7 -2
pnpm-lock.yaml
··· 7 7 overrides: 8 8 vite: npm:rolldown-vite@7.3.1 9 9 10 + patchedDependencies: 11 + '@nuxtjs/i18n': 12 + hash: ac0616015af3001274a134d593af55dc8a0e5823f2e43f27991e70d46598c82b 13 + path: patches/@nuxtjs__i18n.patch 14 + 10 15 importers: 11 16 12 17 .: ··· 50 55 version: 4.0.0(magicast@0.5.2)(rolldown-vite@7.3.1(@types/node@25.3.1)(esbuild@0.27.3)(jiti@2.6.1)(terser@5.46.0)(yaml@2.8.2))(typescript@5.9.3)(vitest@4.0.18(@types/node@25.3.1)(esbuild@0.27.3)(jiti@2.6.1)(terser@5.46.0)(yaml@2.8.2)) 51 56 '@nuxtjs/i18n': 52 57 specifier: ^10.2.3 53 - version: 10.2.3(@vue/compiler-dom@3.5.28)(db0@0.3.4(better-sqlite3@12.6.2))(eslint@10.0.0(jiti@2.6.1))(ioredis@5.9.2)(magicast@0.5.2)(rollup@4.57.1)(vue@3.5.28(typescript@5.9.3)) 58 + version: 10.2.3(patch_hash=ac0616015af3001274a134d593af55dc8a0e5823f2e43f27991e70d46598c82b)(@vue/compiler-dom@3.5.28)(db0@0.3.4(better-sqlite3@12.6.2))(eslint@10.0.0(jiti@2.6.1))(ioredis@5.9.2)(magicast@0.5.2)(rollup@4.57.1)(vue@3.5.28(typescript@5.9.3)) 54 59 '@types/node': 55 60 specifier: ^25.3.1 56 61 version: 25.3.1 ··· 9529 9534 transitivePeerDependencies: 9530 9535 - magicast 9531 9536 9532 - '@nuxtjs/i18n@10.2.3(@vue/compiler-dom@3.5.28)(db0@0.3.4(better-sqlite3@12.6.2))(eslint@10.0.0(jiti@2.6.1))(ioredis@5.9.2)(magicast@0.5.2)(rollup@4.57.1)(vue@3.5.28(typescript@5.9.3))': 9537 + '@nuxtjs/i18n@10.2.3(patch_hash=ac0616015af3001274a134d593af55dc8a0e5823f2e43f27991e70d46598c82b)(@vue/compiler-dom@3.5.28)(db0@0.3.4(better-sqlite3@12.6.2))(eslint@10.0.0(jiti@2.6.1))(ioredis@5.9.2)(magicast@0.5.2)(rollup@4.57.1)(vue@3.5.28(typescript@5.9.3))': 9533 9538 dependencies: 9534 9539 '@intlify/core': 11.2.8 9535 9540 '@intlify/h3': 0.7.4