-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
404.html
161 lines (154 loc) · 5.48 KB
/
404.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page not found!</title>
<style>
@font-face {
font-family: "mono";
src: url("https://axorax.github.io/css-button-maker/assets/fonts/robotomono.ttf");
}
:root {
color-scheme: dark;
}
body {
background-color: #111;
font-family: "mono", monospace;
padding: 0;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
}
main {
background: #131313;
border: 1.3px solid #272727;
border-radius: 7px;
padding: 0.8rem 1.2rem;
text-align: center;
transition: 190ms;
position: absolute;
}
main:hover {
user-select: none;
background: #537fe7;
border-color: none;
}
#tip {
position: absolute;
bottom: 1rem;
font-size: 13px;
display: none;
}
dialog {
border: none;
outline: none;
border-radius: 7px;
border: 1px solid #ed2b2a;
background: #231717dc;
color: #ed2b2a;
font-weight: 900;
font-size: 1.7rem;
animation: glow 1s ease-in-out infinite alternate;
}
@keyframes glow {
from {
text-shadow: 0 0 10px #ed2b2a, 0 0 20px #ed2b2a,
0 0 30px #ed2b2a, 0 0 40px #ed2b2a, 0 0 50px #ed2b2a,
0 0 60px #ed2b2a, 0 0 70px #ed2b2a;
}
to {
text-shadow: 0 0 20px #ed2b2a, 0 0 30px #ed2b2a,
0 0 40px #ed2b2a, 0 0 50px #ed2b2a, 0 0 60px #ed2b2a,
0 0 70px #ed2b2a, 0 0 80px #ed2b2a;
}
}
</style>
</head>
<body>
<main>
<h1>404</h1>
<p>PAGE NOT FOUND!</p>
</main>
<p id="tip">Type "move" for a secret!</p>
<dialog>IM TIRED OF BEING PRESSED! >:(</dialog>
<script>
const main = document.querySelector("main"),
params = new URLSearchParams(window.location.search),
tip = document.querySelector("#tip");
let keys = [],
active = false;
if (
params.get("secret") &&
params.get("secret").trim().length != 0
) {
secretActivate();
}
function calculateDistance(x1, y1, x2, y2) {
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
}
function secretActivate() {
const d = document.querySelector("dialog");
d.showModal();
setTimeout(() => {
d.remove();
move();
}, 3000);
}
function move() {
window.addEventListener("mousemove", (event) => {
var cursorX = event.clientX;
var cursorY = event.clientY;
const div = main.getBoundingClientRect();
const distance = calculateDistance(
cursorX,
cursorY,
div.left + main.clientWidth / 2,
div.top + main.clientHeight / 2
);
if (distance < 200) {
main.style.left =
random(10, window.innerWidth - main.clientWidth) +
"px";
main.style.top =
random(10, window.innerHeight - main.clientHeight) +
"px";
}
});
}
main.addEventListener("click", () => {
main.style.left =
random(10, window.innerWidth - main.clientWidth) + "px";
main.style.top =
random(10, window.innerHeight - main.clientHeight) + "px";
});
window.addEventListener("keydown", (e) => {
if (!active) {
const x = e.key.toLowerCase();
if (x === "m" || x === "o" || x === "v" || x === "e") {
keys.push(x);
if (keys.join("") == "move") {
secretActivate();
}
setTimeout(() => {
keys.shift();
}, 1000);
}
}
});
if (random(0, 100) < 40) {
tip.style.display = "block";
setTimeout(() => {
tip.remove();
}, 3000);
}
function random(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
</script>
</body>
</html>