This repository was archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patherror.vue
60 lines (56 loc) · 2.49 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
<script setup lang="ts">
defineProps<{ error: Object }>();
import scream from "static/images/emotes/scream.webp";
import dog from "static/images/dog.png";
const handleErrors = () => clearError({ redirect: "/" });
const flashbang = ref(false);
const showDog = ref(true);
const animationFinished = ref(false);
</script>
<template>
<div class="flex h-screen flex-col items-center justify-center gap-4 p-4">
<img :src="scream" decoding="async" loading="lazy" alt="Scream" class="rounded-lg" />
<div class="z-10 text-center">
<h1 class="text-3xl font-bold text-red-600 dark:text-red-500 lg:text-6xl">BLACK HOLE ALERT</h1>
<p class="text-lg text-gray-600 dark:text-gray-400">
The universe is about to collapse due to an unexpected error! In case this keeps happening open an issue
<a target="_blank" href="https://github.com/Tougrel/pestoverse/issues" class="text-primary-700 dark:text-primary-400">here</a>.
</p>
</div>
<code class="max-h-30 z-10 w-full max-w-screen-2xl overflow-y-scroll rounded-lg border-2 border-navigation bg-gray-300 p-2 dark:bg-navigation/40">{{
error
}}</code>
<button
@click="handleErrors"
class="border-primary-700 hover:bg-primary-300 hover:dark:bg-primary-900 z-10 rounded-lg border-2 px-4 py-2 transition-all duration-300 hover:scale-105"
@mouseenter="
() => {
if (animationFinished) showDog = true;
}
"
@mouseleave="
() => {
if (animationFinished) showDog = false;
}
"
>
Try to restore the Universe
</button>
<img
:src="dog"
:class="{ 'opacity-5': showDog, 'opacity-0': !showDog }"
class="fixed bottom-0 left-0 z-0 animate-[scalein_30s_ease-in-out_forwards] grayscale transition ease-linear"
draggable="false"
@animationend="flashbang = true"
/>
<div
:class="{ 'opacity-100': flashbang, 'opacity-0': !flashbang, 'delay-1000': !flashbang, 'duration-100': flashbang, 'duration-1000': !flashbang }"
class="pointer-events-none absolute z-50 h-screen w-screen bg-white transition ease-linear"
@transitionend="
flashbang = false;
showDog = false;
animationFinished = true;
"
></div>
</div>
</template>