-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
251 lines (234 loc) · 6.27 KB
/
index.js
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
const text = [
{
text: "you're my best friend. just you. dont tell anyone",
weight: 3
},
{
text: "hungry",
weight: 15
},
{
text: "shovel them in there",
weight: 8
},
{
text: "hey",
weight: 15
},
{
text: "what?",
weight: 15
},
{
text: "the commissioner is doing a great job",
weight: 4
},
{
text: "sibr is doing a great job",
weight: 4
},
{
text: "where's jaylen?",
weight: 15
},
{
text: "it's pronounced sibr",
weight: 4
},
{
text: "these eggs are yum",
weight: 15
},
{
text: "you look like a snack",
weight: 12
},
{
text: "*cronch*",
weight: 15
},
{
text: "are you holding out on me",
weight: 10
},
{
text: "pretzels got wet",
weight: 10
},
{
text: "Blaseball is a mess.",
weight: 10
},
{
text: "also who are the data witches",
weight: 10
},
{
text: "<a href=https://github.com/Society-for-Internet-Blaseball-Research/squid>Read the Documentation</a>",
weight: 20
}
];
const hats = {
//Squid
'chef': {
src: 'squid-hat.png',
alt: "A giant squid, adorned with a chef's hat, floating ominously on the page",
title: "The Monitor from Blaseball.com",
contentType: 'squid'
},
'fedora': {
src: 'fedora-squid.svg',
alt: "A giant squid, adorned with a fedora, floating ominously on the page",
title: "Giant Squid by Delapouite, Fedora by Lorc; game-icons.net",
contentType: 'squid'
},
'default': {
src: 'giant-squid.svg',
alt: "A giant squid, floating ominously on the page",
title: "Giant Squid by Delapouite at game-icons.net",
contentType: 'squid'
},
'sunglasses': {
src: 'sunglasses-squid.png',
alt: 'A giant squid, adorned with sunglasses, floating ominously on the page',
title: "The Monitor with sunglasses from Blaseball.com",
contentType: 'squid'
},
'3d': {
src: '1024px-Tgb_monitor.png',
alt: 'A giant squid, with a foam finger, popcorn and glowing red eyes, floating ominously on the page',
title: "The 3d Monitor from Blaseball.com",
contentType: 'squid'
},
'2d': {
src: '2d.png',
alt: 'A giant squid, with a foam finger, popcorn and glowing red eyes drawn poorly, floating ominously on the page',
title: "The badly drawn 3d Monitor from Blaseball.com",
contentType: 'squid'
},
'wave': {
src: 'blinky-wave.gif',
alt: 'A giant squid, with a foam finger and empty popcorn, drawn waving poorly, floating ominously on the page',
title: "The badly drawn Monitor from Blaseball.com",
contentType: 'squid'
},
//Coin
'coin': {
src: "Equity.c533a2ae.png",
alt: "A roman equity coin",
title: "The Coin from Blaseball.com",
contentType: 'coin'
},
'scattered': {
src: "scattered.png",
alt: "A glitchy roman equity coin",
title: "The Coin, scattered, from Blaseball.com",
contentType: 'scattered'
},
'melting': {
src: "Bossmelt.png",
alt: "A melting roman equity coin",
title: "The Coin, melting, from Blaseball.com",
contentType: 'melting'
},
//Peanut
'shelled-one': {
src: 'peanut.svg',
alt: 'A giant peanut, spinning ominously on the page',
title: 'Peanut by rihlsul at game-icons.net',
contentType: 'shelled-one'
},
'shelled-two': {
src: 'peanut.png',
alt: 'Spinning peanut',
title: 'Peanut from Blaseball.com',
contentType: 'shelled-two'
},
'tutorial': {
src: 'peanut.png',
alt: 'Spinning peanut',
title: 'Peanut from Blaseball.com',
contentType: 'tutorial'
},
//Microphone
'microphone':{
src:"feedback.png",
alt:"Pink Microphone",
title: "Microphone from Blaseball.com",
contentType: "microphone"
},
'microphone-tweet':{
src:"MicrophoneTwitter.jpg",
alt:"Pink Microphone",
title: "Microphone from Blaseball.com",
contentType: "microphone-tweet"
},
//Reader
'reader':{
src:"Tgb_desert.png",
alt:"An ominous purple eye",
title: "The Reader from Blaseball.com",
contentType: "reader"
},
//Lōotcrates
'lootcrates':{
src:"Lootcrates.png",
alt:"A stack of crates",
title: "Lōotcrates from Blaseball.com",
contentType: "lootcrates"
},
//Namerifeht
'namerifeht':{
contentType: "namerifeht"
},
'namerifeht-ball':{
src: 'FK_Namerifeht.png',
alt: "A ball of crystal like flame with a bowtie",
title: "Namerifeht from Blaseball.com",
contentType: "namerifeht-ball"
},
//Misc
'ballclark': {
src: 'ballclark.png',
alt: 'An angry bbaseball, floating ominously on the page',
title: "Ball Clark by Quinns at People Make Games",
contentType: 'squid'
},
};
const textArray = text.map(saying => Array(saying.weight).fill(saying.text)).flat();
function onLoad() {
const params = new URLSearchParams(window.location.search);
const type = params.get('type') || params.get('hat') || 'default';
const hat = hats[type] || hats['default'];
const floaty = document.querySelector(".floaty");
document.querySelector(".content").className = "content " + hat.contentType;
if (hat.src && !floaty.src.includes(hat.src)) {
floaty.src = hat.src;
floaty.alt = hat.alt;
floaty.title = hat.title;
}
if (type === 'shelled-two' || type === 'tutorial'){
document.querySelector(".Overlay-Text-Line").className = "Overlay-Text-Line text"
}
if (type === 'namerifeht') {
document.querySelector(".icon").innerHTML = "<video autoplay loop src=n.webm>"
}
const text = params.get('text');
if (text && !type.startsWith('namerifeht')) {
document.querySelector(".text").textContent = text;
}
else if (text && type.startsWith('namerifeht')){
document.querySelector(".text").innerHTML = text.split("").map(string=>`<span>${string}</span>`).join("");
} else {
setText();
}
}
function setText() {
// console.log("Set Text");
document.querySelector(".text").innerHTML = textArray[
Math.floor(Math.random() * textArray.length)
];
const rand = (Math.floor(Math.random() * 180) + 30) * 1000;
// console.log(rand);
setTimeout(setText, rand);
}