generated from UCLALibrary/nuxt3-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.vue
136 lines (120 loc) · 2.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<script setup lang="ts">
import type { NuxtError } from '#app'
import { SectionWrapper } from 'ucla-library-website-components'
const props = defineProps({
error: Object as () => NuxtError
})
const isDevelopment = computed(() => import.meta.dev)
</script>
<template>
<NuxtLayout :is-error="true">
<main
id="main"
class="page page-error"
>
<SectionWrapper>
<p class="error">
{{ error?.statusCode }}
</p>
<h2
v-if="isDevelopment"
class="actual-error"
>
Error Mesage
</h2>
<h3
v-if="isDevelopment"
class="actual-error"
>
<pre>{{ error?.message }}</pre>
<br>
</h3>
<divider-way-finder />
<h2
v-if="isDevelopment"
class="error-message"
>
Error
</h2>
<h3
v-if="isDevelopment"
class="error-message"
>
<pre>{{ error }}</pre>
</h3>
<divider-way-finder />
<rich-text
class="
error-text"
>
<h1
v-if="error?.statusCode === 404"
class="error-title"
>
Page not found
</h1>
<h1
v-else
class="error-title"
>
An error occurred
</h1>
<p>
We can’t find the page you are looking for, but we're here to help. <nuxt-link to="/">
Go back to home
page
</nuxt-link> or try these regularly visited links:
</p>
<ul>
<li><a href="https://library.ucla.edu">UCLA Library Home</a></li>
<li><a href="https://www.library.ucla.edu/research-teaching-support/research-help">Research Help</a></li>
<li>
<a href="https://www.library.ucla.edu/use/access-privileges/disability-resources">Accessibility
Resources</a>
</li>
</ul>
</rich-text>
</SectionWrapper>
</main>
</NuxtLayout>
</template>
<style lang="scss" scoped>
.page-error {
padding: var(--space-3xl) var(--unit-gutter);
.error {
font-family: var(--font-secondary);
font-size: 248px;
font-weight: 600;
line-height: 1;
background: linear-gradient(20deg,
#fd9be0 10.99%,
#e29aee 23.02%,
#c099ff 32.91%,
#8ba0ef 42.44%,
#0aa5ff 56.68%,
#06bef2 73.09%,
#00e0e0 89.01%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
text-fill-color: transparent;
text-align: center;
}
.error-title {
@include step-5;
margin-bottom: 32px;
p {
margin-bottom: var(--space-xl);
}
}
pre {
white-space: pre-wrap;
overflow-x: auto;
}
@media #{$small} {
.error {
font-size: 128px;
}
}
}
</style>