-
Notifications
You must be signed in to change notification settings - Fork 1
/
error.vue
103 lines (88 loc) · 1.89 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<script lang="ts" setup>
import Error from './interfaces/Error'
import Footer from '~/components/Footer.vue'
import Header from '~/components/Header.vue'
interface Props {
error: Error
}
const props = defineProps<Props>()
const otherError: string = 'An error occurred'
const pageNotFound: string = 'Page Not Found - 404'
useHead({
title: props.error.statusCode === 404 ? pageNotFound : otherError,
})
</script>
<template>
<v-app>
<Header />
<v-main>
<h1 v-if="error.statusCode === 404">
{{ pageNotFound }}
</h1>
<h1 v-else>
{{ otherError }}
</h1>
<h2>May the force be with you.</h2>
<NuxtLink to="/">Return to Home page</NuxtLink>
<v-img alt="Error image" cover src="pages/404.gif" />
</v-main>
<Footer />
</v-app>
</template>
<style lang="scss" scoped>
a,
h1,
h2 {
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
left: 0;
padding-top: 20rem;
position: absolute;
top: 64px; // Height of v-toolbar.
width: 100%;
z-index: 1;
}
a {
color: #4a148c;
font-size: 2rem;
padding-top: 29rem;
transition: 5s;
&:hover {
color: white;
}
@media only screen and (min-width: 768px) and (max-width: 1200px) {
padding-top: 20rem;
}
@media only screen and (max-width: 767px) {
font-size: 1rem;
padding-top: 11rem;
}
}
h1 {
color: #4a148c;
font-size: 5rem;
padding-top: 15rem;
@media only screen and (min-width: 768px) and (max-width: 1200px) {
font-size: 5rem;
padding-top: 8rem;
}
@media only screen and (max-width: 767px) {
font-size: 2.25rem;
padding-top: 5rem;
}
}
h2 {
color: #9c27b0;
font-size: 3rem;
padding-top: 22rem;
@media only screen and (min-width: 768px) and (max-width: 1200px) {
padding-top: 14rem;
}
@media only screen and (max-width: 767px) {
font-size: 1.25rem;
padding-top: 8rem;
}
}
</style>