-
Notifications
You must be signed in to change notification settings - Fork 1
/
randomizer.html
527 lines (515 loc) · 20.3 KB
/
randomizer.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
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<!doctype html>
<html lang="en" data-bs-theme="dark" class="spaceBG">
<meta http-equiv="refresh" content="0; URL=https://rungul.us/randomizer" />
<script>
//let me guess, you want to see the source code?
//i'm not insane, there are comments here
//you can go see them at https://github.com/rungulus/runguszone/
//ok bye
</script>
<head>
<!-- these meta tags cannot be nested in a module, so they're out here -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>the randomizer - rungus zone</title>
<meta name="title" content="the randomizer - rungus zone" />
<meta charset="utf-8">
<meta name="description" content="silly video time" />
<!-- preload critical css first -->
<!-- long stylesheet time! -->
<link rel="stylesheet" href="https://cdn.rungus.zone/v4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.rungus.zone/v4/css/custom.css">
<!-- also defer scripts until page is loaded -->
<script src="https://cdn.rungus.zone/v4/js/bootstrap.bundle.min.js" defer></script>
<script src="https://cdn.rungus.zone/v4/js/randomizer.js" defer></script>
<!-- defer backdrop and icons -->
<link rel="preload" href="https://cdn.rungus.zone/v4/css/backdroponly.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.rungus.zone/v4/css/backdroponly.css"></noscript>
<link rel="preload" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css"></noscript>
<script>
function loadingWheel(x) {
x.removeAttribute('class')
x.classList.toggle("spinner-grow");
document.getElementById('loaderText').innerHTML="loading";
}
</script>
<tags>
<!-- opengraph -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://rungus.zone/randomizer" />
<meta property="og:title" content="the randomizer - rungus zone" />
<meta property="og:description" content="silly video time" />
<meta property="og:image" content="https://cdn.rungus.zone/profile.gif" />
<!-- twitter -->
<!-- of course twitter has their own -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://rungus.zone/randomizer" />
<meta property="twitter:title" content="the randomizer - rungus zone" />
<meta property="twitter:description" content="silly video time" />
<meta property="twitter:image" content="https://cdn.rungus.zone/profile.gif" />
</tags>
</head>
<!-- lg-xl sidebar (desktops) -->
<lg-sidebar class="stickyBar z-3 d-none d-lg-block alert">
<!-- i wrangled with css and bootstrap for like 2 days to get this to work good -->
<!-- turns out im a dumbass, there is no margin-left (ml) in bootstrap, its ms for margin-start! -->
<!-- why? who the hell knows -->
<div class="p-0 ps-1 pt-3 pb-1 btn btn-dark">
<div>
<div class="runguszone">
<span class="sidewaysText">
<span class="fs-2">
<span style="color:#69f0ae">r</span>ungus<span class="text-muted">.zone</span>
</span>
<div class="fs-3">
<a class="bi-youtube link-danger pt-1 mb-n" href="https://www.youtube.com/@rungus" aria-label="youtube"></a>
<!-- for some reason youtube has a big margin on the bottom -->
<a class="bi bi-discord link-primary pt-1 m-0" href="https://discord.gg/2VuJFdEcwM" aria-label="discord"></a>
<a rel="me" class="bi bi-mastodon link-success pt-1 m-0" href="https://wetdry.world/@rungus" aria-label="mastodon"></a>
<a class="bi bi-twitter link-info pt-1 m-0" href="https://twitter.com/rungulus" aria-label="twitter"></a>
<a class="bi bi-github link-light pt-1 m-0" href="https://github.com/rungulus" aria-label="github"></a>
</div>
</span>
</div>
</div>
<hr class="m-0 mt-2 me-1 p-0">
<div class="text-center d-grid mt-1 pe-1 pb-1 pt-1 btn-group-vertical btn-group-sm">
<a class="btn btn-danger" href="https://rungusrungus.tumblr.com/" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
<i class="bi bi-pencil-square"></i>
<span class="smallLink">blog</span>
</a>
<a class="btn btn-light" href="https://news.rungus.zone" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
<i class="bi bi-newspaper"></i>
<span class="smallLink">rungnews</span>
</a>
<a class="btn btn-primary" href="https://rungus.zone/randomizer">
<i class="bi bi-shuffle"></i>
<span class="smallLink">randomizer</span>
</a>
<a class="btn btn-warning" href="https://rungus.zone/time">
<i class="bi bi-clock-history"></i>
<span class="smallLink">time</span>
</a>
<a class="btn btn-dark" href="https://rungus.zone/type">
<i class="bi bi-body-text"></i>
<span class="smallLink">type here</span>
</a>
<a class="btn btn-success" href="https://rungus.zone/cow">
<i class="bi bi-chat-quote"></i>
<span class="smallLink">cow advice</span>
</a>
</div>
<hr class="m-0 mt-1 mb-0 me-1 p-0">
<div class="text-center d-grid mt-1 pe-1 pb-1 pt-1 btn-group-vertical btn-group-sm">
<a class="btn btn-secondary" href="https://rungus.zone/">
<i class="bi bi-house-fill"></i>
<span class="smallLink">back home</span>
</a>
</div>
</div>
<!-- this is probably terrible on *really* ultrawide monitors -->
</lg-sidebar>
<!-- sm-md sidebar (tablets, some laptops) -->
<s-sidebar class="stickyBar z-3 d-lg-none d-sm-block d-none m-1">
<div class="p-0 ps-1 pt-3 pb-1 btn btn-dark" type="button" data-bs-toggle="collapse" data-bs-target="#s-sidebarLinks">
<div>
<div class="runguszone ps-1">
<span class="sidewaysText">
<span class="fs-2">
<span style="color:#69f0ae">r</span>ungus<span class="text-muted">.zone</span>
</span>
</span>
</div>
</div>
<div class="collapse navbar-collapse" id="s-sidebarLinks">
<hr class="m-0 mt-2 me-1 p-0">
<div class="text-center d-grid mt-1 pe-1 pb-1 pt-1 btn-group-vertical">
<a class="btn btn-danger" href="https://rungusrungus.tumblr.com/" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
<i class="bi bi-pencil-square"></i>
<br>
</a>
<a class="btn btn-light" href="https://news.rungus.zone" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
<i class="bi bi-newspaper"></i>
<br>
</a>
<a class="btn btn-primary" href="https://rungus.zone/randomizer">
<i class="bi bi-shuffle"></i>
<br>
</a>
<a class="btn btn-warning" href="https://rungus.zone/time">
<i class="bi bi-clock-history"></i>
<br>
</a>
<a class="btn btn-dark" href="https://rungus.zone/type">
<i class="bi bi-body-text"></i>
</a>
<a class="btn btn-success" href="https://rungus.zone/cow">
<i class="bi bi-chat-quote"></i>
<br>
</a>
</div>
<hr class="m-0 mt-1 mb-0 me-1 p-0">
<div class="text-center d-grid mt-1 pe-1 pb-1 pt-1 btn-group-vertical btn-group-sm">
<a class="btn btn-secondary" href="https://rungus.zone/">
<i class="bi bi-house-fill"></i>
<span class="smallLink"></span>
</a>
</div>
<hr class="m-0 mt-2 me-1 p-0">
<div class="fs-3 btn-group-vertical d-grid mt-1 pe-1 pb-1 pt-1">
<a class="bi-youtube link-danger pt-1 mb-n" href="https://www.youtube.com/@rungus" aria-label="youtube"></a>
<a class="bi bi-discord link-primary pt-1 m-0" href="https://discord.gg/2VuJFdEcwM" aria-label="discord"></a>
<a rel="me" class="bi bi-mastodon link-success pt-1 m-0" href="https://wetdry.world/@rungus" aria-label="mastodon"></a>
<a class="bi bi-twitter link-info pt-1 m-0" href="https://twitter.com/rungulus" aria-label="twitter"></a>
<a class="bi bi-github link-light pt-1 m-0" href="https://github.com/rungulus" aria-label="github"></a>
</div>
</div>
</div>
</s-sidebar>
<!-- xs sidebar (phones) -->
<xs-sidebar class="stickyBar z-3 d-lg-none d-sm-none d-block m-1">
<div class="p-0 pe-1 pb-1 btn btn-dark" type="button" data-bs-toggle="collapse" data-bs-target="#xs-sidebarLinks">
<div>
<div class="runguszone ms-3 me-3 text-center">
<span class="text-center">
<span class="fs-2 text-center ps-1">
<span style="color:#69f0ae">r</span><span class="text-muted">z</span>
</span>
</span>
</div>
</div>
<div class="collapse navbar-collapse" id="xs-sidebarLinks">
<hr class="m-0 mt-2 me-1 p-0 ms-1">
<div class="text-center d-grid mt-1 pe-1 pb-1 pt-1 btn-group-vertical ms-1 m-0 p-0">
<a class="btn btn-danger" href="https://rungusrungus.tumblr.com/" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
<i class="bi bi-pencil-square"></i>
<br>
</a>
<a class="btn btn-light" href="https://news.rungus.zone" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
<i class="bi bi-newspaper"></i>
<br>
</a>
<a class="btn btn-primary" href="https://rungus.zone/randomizer">
<i class="bi bi-shuffle"></i>
<br>
</a>
<a class="btn btn-warning" href="https://rungus.zone/time">
<i class="bi bi-clock-history"></i>
<br>
</a>
<a class="btn btn-dark" href="https://rungus.zone/type">
<i class="bi bi-body-text"></i>
</a>
<a class="btn btn-success" href="https://rungus.zone/cow">
<i class="bi bi-chat-quote"></i>
<br>
</a>
</div>
<hr class="m-0 mt-1 mb-0 me-1 p-0">
<div class="text-center d-grid mt-1 pe-1 pb-1 pt-1 btn-group-vertical btn-group-sm">
<a class="btn btn-secondary" href="https://rungus.zone/">
<i class="bi bi-house-fill"></i>
<span class="smallLink"></span>
</a>
</div>
<hr class="m-0 mt-2 me-1 p-0 ms-1">
<div class="fs-3 btn-group-vertical d-grid mt-1 pe-1 pb-1 pt-1">
<a class="bi-youtube link-danger pt-1 mb-n" href="https://www.youtube.com/@rungus" aria-label="youtube"></a>
<a class="bi bi-discord link-primary pt-1 m-0" href="https://discord.gg/2VuJFdEcwM" aria-label="discord"></a>
<a rel="me" class="bi bi-mastodon link-success pt-1 m-0" href="https://wetdry.world/@rungus" aria-label="mastodon"></a>
<a class="bi bi-twitter link-info pt-1 m-0" href="https://twitter.com/rungulus" aria-label="twitter"></a>
<a class="bi bi-github link-light pt-1 m-0" href="https://github.com/rungulus" aria-label="github"></a>
</div>
</div>
</div>
</xs-sidebar>
<body>
<div class="container-fluid z-n1 position-absolute">
<!-- this way edits on the sidebars do not affect placement of elements on the main area -->
<div class="container">
<pagelogo>
<div class="container">
<!-- top of screen info, used for a welcome message and rungus zone yeah cool -->
<div class="">
<p class="text-center m-0"><span class="runguszone text-light siteText">the <span style="color:#69f0ae">r</span>andomizer</span></span></p>
</div>
<!-- can use this for announcements -->
<announcement>
<!-- <nocss class="nocss text-center mt-n">
<p class="text-center mt-n mb-n2">seems like everything didn't load successfully<br>
you should try refreshing</p>
</nocss> -->
</announcement>
</div>
</pagelogo>
<maincontent>
<div class="container alert frostedglass">
<div class="align-content-center">
<!-- this will be using rows eventually, probably in my next update -->
<div class="">
<randomizer>
<div>
<div class="container frostedglass pt-3 pb-2 mb-3">
<div class="ratio ratio-16x9">
<div id="player" style="border-radius: 10px;">
<div class="ratio" id="placeholder">
<button class="btn"
type="button"
data-bs-toggle="collapse"
data-bs-target="#randomizercontrols"
aria-expanded="false"
aria-controls="randomizercontrols"
aria-label="load randomizer">
<i class="bi bi-play-circle-fill" onclick="loadingWheel(this)" style="font-size:500%"></i>
<br>
<p id="loaderText">click to load randomizer</p>
</button>
</div>
</div>
</div>
<br>
<div class="btn-group-sm collapse" id="randomizercontrols">
<button class="btn btn-success mb-2 mt-n" onclick="reroll();">re-roll</button>
</div>
</div>
</div>
</randomizer>
<hr class="m-0 mb-1">
<p class="fs-3 runguszone mb-n text-center">whe<span style="color:#69f0ae">r</span>e am i</p>
<p class="text-center">this is the randomizer, a simple randomizer script to pull videos from my list
<br> most of them are kinda funny, some are sad and some are weird. thanks for visiting
<br> share with your friends please, i need them clicks
</p>
<hr class="m-0">
<p class="fs-3 runguszone mb-n text-center">ok can i submit videos too</p>
<p class="text-center">hell yeah, send me a message on <i class="bi bi-twitter"></i> or <i class="bi bi-discord"></i> at <kbd>@rungulus</kbd> and i can add it for ya.
<br> it has to be weird, funny, or strange. if you get all 3 you win.
</p>
</div>
<!-- although, im not really sold on this at all honestly. its just a bunch of text in line. there's gotta be a cooler way to show this? -->
</div>
</div>
</maincontent>
<div class="container alert frostedglass">
<span class="runguszone" style="margin-bottom:-0.2rem;">
<a href="https://rungus.zone/terms" class="alert-link">tos</a> -
<a href="https://cdn.rungus.zone" class="alert-link">cdn</a>
<span class="position-absolute top-50 start-50 translate-middle">
<i class="bi bi-heart-fill"></i> -
<i class="bi bi-github"></i>
<i class="bi bi-bootstrap"></i>
<i class="bi bi-google"></i></span>
<span class="float-end">© rungus</span></span><br>
randomizer v3</span>
</div>
</div>
</div>
</body>
<script>
//randomizer 3.0
//lets use that youtube api
// make a function to load the youtube api
// this way we can lazy load it
document.getElementById("placeholder").addEventListener("click", function(){
loadYT()
});
function loadYT() {
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
}
// then, create a youtube player
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '270',
width: '480',
videoId: randURLs[Math.floor(Math.random() * randURLs.length)],
playerVars: {
'playsinline': 1
},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
// once it's ready, try to play the video automatically
// this probably won't work in most cases, browsers dont like video playing unattended
function onPlayerReady(event) {
event.target.playVideo();
}
//check if the video ends, and if so wait .5 seconds and re-roll
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.ENDED) {
setTimeout(reroll, 500);
}
}
//simply randomly select from the randURLs array
function reroll() {
randomvideo=randURLs[Math.floor(Math.random() * randURLs.length)];
console.log("the randomly selected video id is " + randomvideo);
doument.getElementById('videoid').innerHTML = "<kbd>" + randomvideo + "</kbd>";
player.loadVideoById(randomvideo);
}
var randURLs = [
"fCmvXCgZr74",
"fCmvXCgZr74",
"4ZQRHNG1IYE",
"_0AlytWWDm",
"2REG3-Wb5gM",
"2X5hyC62zZ4",
"Cb6F14AGrvI",
"4DUkS98yw5Y",
"vl_aWoPNpJM",
"DOWO4gq-whg",
"hxpbJ89pHAM",
"A7qXoSgYR4c",
"bxRzsgtvakY",
"Epd4pUxkogw",
"ag46jiqISO4",
"_xyGvpLOZ1Q",
"WFoC3TR5rzI",
"juQyy00x-Mw",
"VfCYZ3pks48",
"Xh-71XzC8pw",
"R37bwKO9gBA",
"dQ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fV3nflAQ99w",
"t4mGPIWbw0c",
"0mQCi4LQUQw",
"FG7eYo_ozJQ",
"heEKi5EjZXA",
"xt2OdUfYZbk",
"0E_5SynW3aM",
"0iUTZajxlWI",
"bLHL75H_VEM",
"UddCTvioEnw",
"ixWybGQnPHQ",
"v11SYt_brN8",
"hnsNMoor5Ic",
"csFf8EiCQ2Y",
"d1CRGkDgrrQ",
"GjjZacZSWT4",
"NYdU1p7kDxY",
"6f5ys8VU2ek",
"MDM304JW_NA",
"UfNRWh4s_ag",
"4ONHOwTBbNw",
"oNjD7ogr--g",
"YKAPZgtYzIs",
"LYSPaCiKpQw",
"_oVm2jtv6q8",
"HKVoN-SjZ-Q",
"6dfM7Hiah4s",
"7FiiEZ9Z3aQ",
"IanEey1mEIg",
"qCIlcC6c1i8",
"SyzM3yjkQko",
"mJUvIhI_jpo",
"z94lg7dGkw4",
"h6OKgREcHFM",
"E7w_v9J7iOc",
"0UR3bAfuNyg",
"SoZ41i2dSIw",
"-sk9kXyfGvU",
"dvOjGkfea_w",
"bmFGbBmlyKQ",
"IxTAJNifDAI",
"NnDe2u5M7e8",
"y7wyfTsIm1k",
"T-VZ1kL8ZgE",
"Udk8YHOy0EU",
"wbfu39l0kxg",
"3fG8rNHUspU",
"FOtgipv4oa8",
"VDP6RCJSsMg",
"etfsKeog6S4",
"YG8vtggc1Ok",
"RBGW9J3sx1g",
"VCNskcGD1Oc",
"OBEiYEk3zD4",
"QBK3QpQVnaw",
"0tdyU_gW6WE",
"VqB1uoDTdKM",
"SNvDUO42Hys",
"j13HG2HiEAk",
"sdmsRcsl_xA"
];
</script>
</html>