-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.vue
More file actions
70 lines (65 loc) · 1.9 KB
/
error.vue
File metadata and controls
70 lines (65 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<script setup lang="ts">
import type { NuxtError } from "#app";
const { width } = useWindowSize();
const size = (20 * width.value) / 100;
const props = defineProps({
error: Object as () => NuxtError,
});
</script>
<template>
<NuxtLayout name="default">
<div
class="flex flex-col items-center justify-center w-full h-screen"
v-if="error?.statusCode === 404"
>
<h2 class="w-full font-medium text-center text-9xl">
{{ $t("error.year") }}
</h2>
<h1 class="inline-flex items-center leading-none error">
4<MoonLoading :line-weight="14" :size="size" :speed="1" />4
</h1>
<p class="text-xl italic text-gray-700 dark:text-gray-300">
{{ $t("error.glitch") }}
</p>
<NuxtLink
class="px-6 py-3 m-3 text-xl text-white bg-black rounded-md"
to="/"
>{{ $t("error.back") }} {{ new Date().getFullYear() }}</NuxtLink
>
</div>
<div
v-else
class="grid min-h-full px-6 py-24 bg-white place-items-center sm:py-32 lg:px-8"
>
<div class="text-center">
<p class="text-3xl font-semibold">{{ error?.statusCode }}</p>
<h1
class="mt-4 text-3xl font-bold tracking-tight text-gray-900 sm:text-5xl"
>
{{ $t("error.occured") }}
</h1>
<p class="mt-6 text-base leading-7 text-gray-600">
{{ $t("error.encounter") }}
</p>
<div class="flex items-center justify-center mt-10 gap-x-6">
<NuxtLink
to="/"
class="px-6 py-3 m-3 text-xl text-white bg-black rounded-md"
>{{ $t("error.home") }}</NuxtLink
>
</div>
<pre
v-if="error?.message"
class="flex w-full py-3 mt-3 text-sm text-red-500 text-start"
>
{{ error.message }}
</pre>
</div>
</div>
</NuxtLayout>
</template>
<style>
.error {
font-size: 30vw;
}
</style>