-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherror.vue
316 lines (283 loc) · 8.27 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<template>
<div class="grid w-full h-screen py-32 text-center place-items-center lg:py-24 xs:py-16">
<p class="absolute font-extrabold leading-[0.5] text-xl5_d z-10 opacity-5" ref="dvd">
Oops:(
<br />
<span class="font-normal text-xl2_d"> Page not found </span>
</p>
<div class="relative z-10">
<nuxt-img src="/404-bg_rw8brp.png" provider="cloudinary" alt="" class="relative"
v-show="$colorMode.value === 'dark'" />
<nuxt-img src="/404-bg-dark_cqvcws.png" provider="cloudinary" alt="" class="relative"
v-show="$colorMode.value === 'light'" />
<div class="absolute top-0 left-0 z-10 grid w-full place-items-center">
<div class="relative rotate-face">
<nuxt-img src="/face-img_jjkwur.png" provider="cloudinary" alt="" class="relative" />
<div class="waterdrop"></div>
</div>
</div>
</div>
<p class="relative z-20 font-bold text-base_t">
It’s not you, it’s me. <br />
<span class="relative z-20 font-extralight">Try this...</span>
</p>
<div class="z-20 flex flex-col items-center justify-center gap-2 w-60">
<button @click="handleError" class="btn-green">Go Home</button>
<button class="btn-border" @click="openModal">Learn</button><button class="btn-border"
@click="openModal">Test</button><button class="btn-border" @click="openModal">Chill</button>
</div>
<div
class="fixed top-0 left-0 w-full h-24 bg-white dark:bg-black z-[9999] text-base_m lg-m:text-xl_t appear-from-top lg:h-20 xs:h-16 appear-menu">
<div class="absolute top-0 z-20 parent-toggle right-4 toggle-menu toggle-404">
<input type="checkbox" class="bg-white toggle dark:bg-black" id="checkbox" @change="
setColorTheme($colorMode.preference === 'dark' ? 'light' : 'dark')
" />
<div v-show="$colorMode.value === 'light'">
<Icon name="akar-icons:sun-fill" class="moon svg" />
</div>
<div v-show="$colorMode.value === 'dark'">
<Icon name="akar-icons:moon-fill" class="sun svg" />
</div>
</div>
</div>
<div class="grid items-center justify-center modal modal1 dark:bg-black/80 bg-white/80 place-items-center"
@click="closeModalOutside">
<div class="absolute grid w-11/12 bg-white dark:bg-black h-3/4 modal-content">
<div class="absolute w-6 h-6 left-4 top-4 z-[9999] text-white" @click="closeModal">
<Icon name="akar-icons:arrow-back" class="relative p-2 text-white rounded-lg bg-green2" size="40px" />
</div>
<QandAContainer></QandAContainer>
<div class="opacity-0">Learn</div>
</div>
</div>
<div class="grid items-center justify-center modal modal2 dark:bg-black/80 bg-white/80 place-items-center"
@click="closeModalOutside">
<div class="absolute grid w-11/12 bg-white dark:bg-black h-3/4 modal-content">
<div class="absolute w-6 h-6 left-4 top-4 z-[9999] text-white" @click="closeModal">
<Icon name="akar-icons:arrow-back" class="relative w-6 h-6" />
</div>
<div class="opacity-0">Test</div>
</div>
</div>
<div class="grid items-center justify-center modal modal3 dark:bg-black/80 bg-white/80 place-items-center"
@click="closeModalOutside">
<div class="absolute grid w-11/12 bg-white dark:bg-black h-3/4 modal-content">
<div class="absolute w-6 h-6 left-4 top-4 z-[9999] text-white" @click="closeModal">
<Icon name="akar-icons:arrow-back" class="relative w-6 h-6" />
</div>
<div class="opacity-0">Chill</div>
</div>
</div>
<NuxtPage />
</div>
</template>
<script setup lang="ts">
type Theme = "light" | "dark";
const colorMode = useColorMode();
const setColorTheme = (newTheme: Theme) => {
colorMode.preference = newTheme;
};
const props = defineProps({
error: Object,
});
const handleError = () => clearError({ redirect: "/" });
function openModal(e) {
const modal = document.querySelectorAll(".modal");
const target = e.currentTarget.innerText;
modal.forEach((item) => {
if (item.firstChild.lastChild.innerText == target) {
item.classList.add("active");
} else {
item.classList.remove("active");
}
});
}
function closeModal(e) {
const modal = document.querySelectorAll(".modal");
modal.forEach((item) => {
item.classList.remove("active");
});
}
function closeModalOutside(e) {
const modal = document.querySelectorAll(".modal");
if (e.currentTarget === e.target) {
modal.forEach((item) => {
item.classList.remove("active");
});
}
}
useHead({
title: "CricaDev | 404",
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{
hid: "description",
name: "description",
content:
"Hey, this is a 404, it's not you it's me... Have some fun here!",
},
],
link: [{ rel: "icon", type: "image/png", href: "/404-img.png" }],
});
</script>
<style lang="scss" scoped>
.modal.active {
opacity: 1;
pointer-events: all;
transform: translateY(0%);
transition: all 0.2s ease-in-out;
}
.modal {
transition: all 0.5s ease-in-out;
transform: translateY(100%);
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: 100vw;
z-index: 999;
opacity: 0;
pointer-events: none;
.modal-content {
border-radius: 20px;
display: grid;
grid-template-columns: 100%;
grid-template-rows: repeat(6, 1fr);
grid-auto-flow: column;
place-self: center;
place-items: center;
-webkit-box-shadow: 0px 0px 10px 2px rgba(90, 175, 152, 1);
-moz-box-shadow: 0px 0px 10px 2px rgba(90, 175, 152, 1);
box-shadow: 0px 0px 10px 2px rgba(90, 175, 152, 1);
@media (min-width: 1100px) {
width: 40%;
}
@media (max-height: 780px) {
height: 90%;
}
}
}
.toggle-404 {
@media (min-width: 599px) {
display: none;
}
}
.rotate-face {
animation: tilt-face 2s infinite;
animation-delay: 2s;
@keyframes tilt-face {
//tilt face to the left and then to the right infinitely
0% {
transform: rotate(0deg);
}
33% {
transform: rotate(-15deg);
}
66% {
transform: rotate(15deg);
}
100% {
transform: rotate(0deg);
}
}
}
.waterdrop {
position: absolute;
top: 30%;
right: 20%;
width: 10px;
height: 10px;
border-radius: 100% 0% 100% 100%;
margin: 0px;
transform: rotate(-45deg);
background: #c1e8eb;
animation: drip 2s forwards;
@keyframes drip {
0% {
transform: rotate(-45deg) translate(0px, 0px);
}
100% {
transform: rotate(-45deg) translate(0px, 10px) scaleY(1.5) scaleX(1.3);
}
}
}
.btn-green {
@apply font-bold text-white text-[0.9rem] bg-green2 px-8 py-3 rounded-lg w-full border-2 border-white dark:border-black transition-all;
&:hover {
@apply border-2 border-green2 text-green2 bg-[transparent] transition-all;
}
}
.btn-border {
@apply border-2 border-green2 text-green2 p-4 rounded-lg px-8 py-3 w-full transition-all;
&:hover {
@apply bg-green2 text-white transition-all;
}
}
.toggle-menu {
@media (max-width: 599px) {
transform: scale(0.6) rotate(90deg);
}
}
.parent-toggle {
height: 80px;
width: 40px;
}
input {
appearance: none;
border: 2px solid #5aaf98;
border-radius: 20px;
display: block;
position: relative;
top: 0;
left: 0;
width: 40px;
height: 80px;
margin: 0;
}
.sun {
top: 0;
transform: translateY(0%) scale(0.75);
color: #00010d;
animation: fade-sun 0.5s ease-in-out forwards;
@media (max-width: 599px) {
animation: fade-sun-mobile 0.5s ease-in-out forwards;
}
}
.moon {
bottom: 0;
transform: translateY(0%) scale(0.75);
color: #f6f6f6;
animation: fade-moon 0.5s ease-in-out forwards;
}
@keyframes fade-sun-mobile {
0% {
transform: translateY(100%) scale(0.75) rotate(165deg) translateX(70%);
}
100% {
transform: translateY(-10%) scale(0.75) rotate(165deg) translateX(70%);
}
}
@keyframes fade-moon {
0% {
transform: translateY(-100%) scale(0.75) translateX(-70%);
}
100% {
transform: translateY(0%) scale(0.75) translateX(-70%);
}
}
.svg {
position: absolute;
box-sizing: content-box;
padding: 10px;
width: 20px;
height: 20px;
transition: 0.2s all ease-in;
pointer-events: none;
background: #5aaf98;
border-radius: 50%;
}
.fade {
opacity: 0;
}
</style>