83 lines
1.9 KiB
Vue
83 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
useHead({
|
|
link: [
|
|
{
|
|
rel: "preconnect",
|
|
href: "https://fonts.googleapis.com",
|
|
},
|
|
{
|
|
rel: "preconnect",
|
|
href: "https://fonts.gstatic.com",
|
|
crossorigin: "",
|
|
},
|
|
{
|
|
rel: "stylesheet",
|
|
href: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap",
|
|
},
|
|
],
|
|
});
|
|
|
|
const { locale } = useI18n();
|
|
|
|
const changingLocale = useState(
|
|
"locale-loading",
|
|
() => false,
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<NuxtLayout>
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
|
|
<!-- CUSTOM CURSOR -->
|
|
<CustomCursor />
|
|
|
|
<!-- LANGUAGE LOADING -->
|
|
<Transition
|
|
enter-active-class="transition-opacity duration-200 ease-out"
|
|
enter-from-class="opacity-0"
|
|
enter-to-class="opacity-100"
|
|
leave-active-class="transition-opacity duration-200 ease-in"
|
|
leave-from-class="opacity-100"
|
|
leave-to-class="opacity-0"
|
|
>
|
|
<div
|
|
v-if="changingLocale"
|
|
class="fixed inset-0 z-99999 flex items-center justify-center"
|
|
:style="{
|
|
backgroundColor: 'var(--bg)',
|
|
color: 'var(--text)',
|
|
}"
|
|
>
|
|
<div class="flex flex-col items-center">
|
|
<!-- Spinner -->
|
|
<div
|
|
class="h-10 w-10 animate-spin rounded-full border-2 border-transparent border-t-current"
|
|
/>
|
|
|
|
<!-- Text -->
|
|
<div class="mt-5 text-center">
|
|
<p class="text-sm font-semibold tracking-wide">
|
|
{{
|
|
locale === "id"
|
|
? "Mengganti bahasa"
|
|
: "Switching language"
|
|
}}
|
|
</p>
|
|
|
|
<p
|
|
class="mt-1 text-xs"
|
|
:style="{ color: 'var(--text-muted)' }"
|
|
>
|
|
{{
|
|
locale === "id"
|
|
? "Tunggu sebentar..."
|
|
: "Please wait..."
|
|
}}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Transition>
|
|
</template> |