-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
161 lines (144 loc) · 5.21 KB
/
index.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>
<!--
-:<>
-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
position: relative;
background-color: rgb(255, 255, 255);
}
#welcome {
font-size: 12rem;
user-select: none;
background-color: red;
color: white;
border: 1px solid black;
cursor: pointer;
}
#nuke {
z-index: 99;
position: relative;
cursor: pointer;
margin-top: 10px;
padding: 10px;
background-color: yellow;
border: none;
box-shadow: 0px 10px 0px 0px rgba(255, 217, 0, 0.9);
}
#nuke:hover {
background-color: rgb(223, 223, 0);
}
#nuke:active {
transform: translateY(5px);
box-shadow: 0px 5px 0px 0px rgba(204, 173, 0, 0.9);
}
#worshipping {
position: fixed;
display: none;
color: whitesmoke;
background-color: rgba(103, 7, 7, 0.588);
width: 20%;
height: 100px;
z-index: 2;
font-size: 40px;
}
.boom {
position: fixed;
width: 20%;
z-index: 3
}
.spamKim {
position: fixed;
}
.kim {
background-image: url("./kim_the_clapper.gif");
width: 200px;
height: 200px;
}
</style>
</head>
<body class="body">
<p id="welcome" aria-disabled="false">Hello world!</p>
<center>
<button id="nuke">Nuke</button>
</center>
<div class="kim"></div>
<footer>
<a href="https://github.com/hueychen27/nuclear_website" target="_blank">Github link</a>
</footer>
<script>
const welcome = document.getElementById("welcome");
const nuke = document.getElementById("nuke");
let clicked = false;
let brightness = 255; // rgb(255, 255, 255) is white and we want to make it black with rgb(0, 0, 0)
async function repeat(fun, times) {
for (let i = 0; i < times; i++) {
await fun();
}
}
welcome.addEventListener("click", function () {
if (clicked) return false;
let isGoodbye = this.textContent[0].toLowerCase() == "g"
this.textContent = isGoodbye ? "Hello world!" : "Goodbye world!"
this.style.backgroundColor = isGoodbye ? "red" : "gray";
})
nuke.addEventListener("click", async () => {
if (!clicked) {
welcome.textContent = "Goodbye world! Hello to nukes!"
welcome.style.backgroundColor = "gray";
welcome.setAttribute("aria-disabled", true);
const audio = new Audio("./March_in_step_1_2_3!.wav");
audio.loop = true;
audio.play(); // glory to our fat leader!!!!
}
const worshipping = document.createElement("marquee");
worshipping.style.display = "block";
worshipping.textContent = "WORSHIP HIM NOW!!!!!!!!!!!";
/*
kim jong loses more weight in the night than at daytime
*/
worshipping.id = "worshipping";
worshipping.direction = Math.round(Math.random()) ? "left" : "right";
worshipping.scrollAmount = Math.round(Math.random()) ? 24 : 96;
worshipping.style.top = ((Math.random()) * (window.innerHeight - 40)) + "px";
worshipping.style.left = ((Math.random()) * (window.innerWidth)) + "px";
document.body.append(worshipping);
clicked = true;
if (brightness > 0) brightness -= 2.5;
document.body.style.backgroundColor = `rgb(${brightness}, ${brightness}, ${brightness})`
const img = new Image();
const img2 = new Image();
img2.classList.add("kim", "spamKim")
img2.style.top = ((Math.random()) * (window.innerHeight - img.height)) + "px";
img2.style.left = ((Math.random()) * (window.innerWidth - img.width)) + "px";
document.body.append(img2);
img.className = "boom";
let explosion = Math.round(Math.random() + 1) == 1
img.src = explosion ? "./me_when_transparent.gif" : "./explosion.gif";
await img.decode();
img.style.top = ((Math.random()) * (window.innerHeight - img.height)) + "px";
img.style.left = ((Math.random()) * (window.innerWidth - img.width)) + "px";
img.addEventListener("start", (e) => {
/**
* @type {HTMLImageElement}
*/
const target = e.target;
setTimeout(() => { target.remove() }, explosion ? 1700 : 2100)
}, { once: true })
img.dispatchEvent(new CustomEvent("start", { target: img }))
repeat(() => { document.body.append(img) }, Math.floor(Math.random() * 4 + 1))
})
</script>
</body>
</html>