-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.vue
52 lines (49 loc) · 1.71 KB
/
error.vue
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
<script lang="ts" setup>
interface IError {
statusCode: number;
message: string;
}
const props = defineProps<{ error: IError }>();
console.error(props.error.message);
const handleError = () => clearError({ redirect: '/' });
</script>
<template>
<section
v-if="error.statusCode === 404"
class="flex flex-col items-center justify-center px-8 py-12 text-center lg:px-12"
>
<h2 class="mb-12 text-9xl font-extrabold">404</h2>
<p class="mb-12 text-2xl font-semibold md:text-3xl">Desculpe, não encontramos esta página</p>
<button
class="mx-auto w-full select-none rounded bg-primary py-3 font-semibold text-white hover:bg-primary-700 focus:outline-none active:bg-primary-800 sm:w-auto sm:px-24 sm:py-4 md:text-xl"
@click="handleError"
>
Início
</button>
</section>
<section v-else class="flex flex-col items-center justify-center px-8 py-12 text-center lg:px-12">
<h2 class="mb-12 text-9xl font-extrabold">Erro</h2>
<p class="mb-12 text-2xl font-semibold md:text-3xl">Desculpe, esta página está indisponível</p>
<button
class="mx-auto w-full select-none rounded bg-primary py-3 font-semibold text-white hover:bg-primary-700 focus:outline-none active:bg-primary-800 sm:w-auto sm:px-24 sm:py-4 md:text-xl"
@click="handleError"
>
Início
</button>
</section>
</template>
<style scoped>
section::before {
content: '';
pointer-events: none;
position: absolute;
left: 0;
top: 0;
z-index: -1;
width: 100%;
height: 100%;
background-image: url('/textures/grainy.png');
background-repeat: repeat;
opacity: 0.1;
}
</style>