-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.vue
More file actions
133 lines (119 loc) · 2.36 KB
/
Copy patherror.vue
File metadata and controls
133 lines (119 loc) · 2.36 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
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
<script lang="ts" setup>
import type { NuxtError } from 'nuxt/app'
defineProps<{
error: NuxtError
}>()
const appConfig = useAppConfig()
const router = useRouter()
function goBack() {
history.back()
}
function goHome() {
router.push(appConfig.nebula.homePath)
}
</script>
<template>
<div class="error-page">
<span class="status-code" :class="{ error: error.statusCode !== 404 }">{{ error.statusCode }}</span>
<div class="error-page-content">
<div class="error-text">
<h1>{{ error?.message }}</h1>
<p>There was an error while rendering this page.</p>
</div>
<footer>
<neb-button type="secondary-neutral" @click="goBack()">
<icon name="material-symbols:arrow-back-rounded" />
Go back
</neb-button>
<neb-button @click="goHome()">
Go home
</neb-button>
</footer>
</div>
</div>
</template>
<style scoped>
.error-page {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}
.error-page-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-12);
width: 100%;
}
.error-text {
max-width: 80%;
display: flex;
flex-direction: column;
gap: var(--space-6);
text-align: center;
h1 {
font-size: var(--title-lg);
color: var(--neutral-color-900);
}
p {
font-size: var(--text-xl);
color: var(--neutral-color-600);
}
}
.status-code {
z-index: -1;
position: fixed;
font-size: 500px;
font-weight: 600;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--neutral-color-100);
&.error {
color: var(--error-color-100);
}
}
footer {
display: flex;
align-items: center;
gap: var(--space-3);
}
.dark-mode {
.status-code {
color: var(--neutral-color-900);
&.error {
color: var(--error-color-950);
}
}
.error-text {
h1 {
color: var(--neutral-color-100);
}
p {
color: var(--neutral-color-400);
}
}
}
@media (--tablet-viewport) {
.status-code {
top: 8%;
transform: translate(-50%, 0);
font-size: 150px;
color: var(--neutral-color-200);
}
.error-text {
text-align: center;
max-width: 90%;
gap: var(--space-4);
h1 {
font-size: var(--title-xs);
}
p {
font-size: var(--text-md);
}
}
}
</style>