mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 15:54:13 +01:00
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:
@@ -22,7 +22,6 @@ useHead({
|
||||
|
||||
body {
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
@apply text-red-200;
|
||||
}
|
||||
|
||||
.sofia {
|
||||
|
||||
@@ -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
13
app/error.vue
Normal 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>
|
||||
@@ -40,7 +40,6 @@ export default defineNuxtConfig({
|
||||
content: {
|
||||
preview: {
|
||||
api: 'https://api.nuxt.studio',
|
||||
dev: true,
|
||||
},
|
||||
build: {
|
||||
markdown: {
|
||||
|
||||
Reference in New Issue
Block a user