-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
138 lines (132 loc) · 3.87 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
<!DOCTYPE html>
<html>
<!--spacy was here-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="HUBCHICKEN.png">
<title>404: Not Found</title>
<meta name="theme-color" content="#0D69AB" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap');
body {
margin: 0;
background-color: #1e1e1e;
padding: 0;
overflow: hidden;
}
.hubchicken {
position: absolute;
top: -100px;
left: 0;
width: 100px;
height: 100px;
background-image: url('https://hubchicken.pages.dev/HUBCHICKEN.png');
background-size: contain;
opacity: 0.4;
transition: top 10s linear, left 10s linear;
z-index: -1;
}
#fart {
display: block;
margin-left: auto;
margin-right: auto;
max-width: 600px;
max-height: 600px;
width: 39%;
}
.topbar {
width: 100%;
min-width: 320px;
margin: 0;
background-color: #262626;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
margin-bottom: 20px;
display: flex;
justify-content: center;
align-items: center;
gap: 1ch;
flex-direction: row;
}
.topbar p {
text-align: center;
font-family: Inconsolata;
font-weight: 400;
font-size: 20px;
user-select: none;
color: white;
}
.topbar a {
font-size: 15px;
text-decoration: none;
color: white;
}
.topbar a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="topbar" id="topbar" >
<p>
Page Not Found<br /><a href="https://hubchicken.pages.dev">Go Back</a>
</p>
</div>
<script src="/theme-parser.js"></script>
</body>
<div id="banner-images"></div>
<script type="module">
function spawnHubchicken() {
const container = document.querySelector('body');
const width = window.innerWidth;
const height = window.innerHeight;
const hubchicken = document.createElement('div');
hubchicken.classList.add('hubchicken');
const randomX = Math.random() * (width - 100);
const randomY = -Math.random() * height;
hubchicken.style.left = `${randomX}px`;
hubchicken.style.top = `${randomY}px`;
const angle = Math.atan2(randomY, randomX);
const degrees = angle * 180 / Math.PI;
hubchicken.style.transform = `rotate(${degrees}deg)`;
container.appendChild(hubchicken);
const randomDuration = Math.random() * 1000 + 500;
const randomXOffset = Math.random() * 100 - 50;
setTimeout(() => {
hubchicken.style.top = `${height + 100}px`;
hubchicken.style.left = `${randomX + randomXOffset}px`;
}, randomDuration);
const removeInterval = setInterval(() => {
const rect = hubchicken.getBoundingClientRect();
if (rect.top >= height) {
hubchicken.remove();
clearInterval(removeInterval);
}
}, 100);
}
function spawnHubchickens(numHubchickens) {
let hubchickensSpawned = 0;
const maxHubchickens = 20;
const spawnInterval = setInterval(() => {
if (hubchickensSpawned >= numHubchickens) {
clearInterval(spawnInterval);
return;
}
spawnHubchicken();
hubchickensSpawned++;
if (hubchickensSpawned >= maxHubchickens) {
clearInterval(spawnInterval);
setTimeout(() => {
spawnHubchickens(numHubchickens - maxHubchickens);
}, 3000);
}
}, 50);
}
window.onload = spawnHubchickens;
const images = [];
const extensions = {"gif": true, "png": true, "jpg": true, "jpeg": true};
let files = await fetch(`https://hubcdn.pages.dev/image-array.json`)
files = await files.json()
for (const [file, url] of Object.entries(files)) images.push(url)
$('<img class="fade-in" id="fart" src="' + images[Math.floor(Math.random() * images.length)] + '">').appendTo('#banner-images');
</script>