-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.vue
99 lines (88 loc) · 2.03 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
<template>
<div class="container">
<section>
<template v-if="error.statusCode !== undefined">
<h2>Darn, it's a</h2>
<h1>{{ error.statusCode }}</h1>
</template>
<template v-else>
<h2>An error occurred</h2>
</template>
<p v-if="error.statusMessage">{{ error.statusMessage }}</p>
<p v-else-if="error.message">{{ error.message }}</p>
<NuxtLink href="/"
><FontAwesomeIcon icon="fa-solid fa-arrow-left" /> Back Home</NuxtLink
>
</section>
<AppFooter />
</div>
</template>
<script setup lang="ts">
const props = defineProps<{
error: any;
}>();
useHead({
titleTemplate: "%s | Callum Watkins",
title: computed(() => {
if (props.error.statusCode === "404") return `Page Not Found`;
else if (props.error.statusCode) return `Error ${props.error.statusCode}`;
else return "Error";
}),
});
</script>
<style lang="scss" scoped>
.container {
height: 100%;
display: grid;
grid-template-rows: 1fr auto;
& > :first-child {
margin: auto;
padding: 4rem 1rem;
text-align: center;
max-width: 75ch;
h2 {
color: #aaa;
font-size: 2em;
margin: 0;
}
h1 {
color: #eee;
font-size: 8em;
margin: 0;
line-height: 0.9;
}
p {
color: #eee;
font-size: 1.2em;
}
a {
color: #fff;
display: inline-block;
text-decoration: none;
text-transform: uppercase;
padding: 0 3rem;
border: 3px solid #d8d8d8;
letter-spacing: 0.3em;
line-height: 3em;
margin-top: 50px;
background: linear-gradient(to right, transparent 50%, #319608 50%);
background-size: 200% 100%;
background-position: left bottom;
transition: background-position 0.5s ease;
&:visited {
color: #fff;
}
&:hover {
background-position: right bottom;
}
}
@media only screen and (max-width: 480px) {
a {
padding: 0 1rem;
width: auto;
display: block;
}
}
}
}
</style>