Remove unused CSS variable from body, enhance locale change logic in AppHeader, add 404 error page, and clean up nuxt.config

This commit is contained in:
2025-07-24 23:05:07 +02:00
parent e88290967a
commit 9c8bfb3118
4 changed files with 23 additions and 6 deletions

View File

@@ -22,7 +22,6 @@ useHead({
body {
font-family: 'DM Sans', sans-serif;
@apply text-red-200;
}
.sofia {

View File

@@ -97,12 +97,18 @@ const currentLocale = computed(() => locales.value.filter(l => l.code === locale
const lang = ref(locale.value)
watch(lang, () => changeLocale(lang.value))
async function changeLocale(newLocale: string) {
async function changeLocale(newLocale?: string) {
document.body.style.animation = 'switch-on .2s'
await new Promise(resolve => setTimeout(resolve, 200))
await setLocale(newLocale as 'en' | 'fr' | 'es')
document.body.style.animation = 'switch-off .2s'
if (newLocale) {
await setLocale(newLocale as 'en' | 'fr' | 'es')
}
else {
newLocale = currentLocale.value!.code === 'en' ? 'fr' : currentLocale.value!.code === 'fr' ? 'es' : 'en'
await setLocale(newLocale as 'en' | 'fr' | 'es')
}
document.body.style.animation = 'switch-off .5s'
await new Promise(resolve => setTimeout(resolve, 200))
document.body.style.animation = ''
@@ -113,7 +119,7 @@ const openContactDrawer = ref(false)
const router = useRouter()
defineShortcuts({
t: () => startViewTransition({ clientX: window.innerWidth, clientY: 0 }),
l: () => openSelectMenu.value = !openSelectMenu.value,
l: () => changeLocale(),
c: () => openContactDrawer.value = !openContactDrawer.value,
backspace: () => router.back(),
})

13
app/error.vue Normal file
View File

@@ -0,0 +1,13 @@
<template>
<UApp class="relative flex h-screen flex-col items-center justify-center">
<div class="flex flex-col items-center justify-center min-h-screen">
<h1 class="text-center font-serif text-[14rem] italic">
404
</h1>
<p class="text-center flex gap-1">
I think you're lost, let's go back
<HomeLink label="home" href="/" />
</p>
</div>
</UApp>
</template>

View File

@@ -40,7 +40,6 @@ export default defineNuxtConfig({
content: {
preview: {
api: 'https://api.nuxt.studio',
dev: true,
},
build: {
markdown: {