-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathcredits.html
769 lines (642 loc) · 21.2 KB
/
credits.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
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Stream Credits</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@900&display=swap" rel="stylesheet" />
<style>
body {
margin: 0;
padding: 0;
background-color: black;
background-image: url("https://www.transparenttextures.com/patterns/stardust.png");
animation: stars 30s linear infinite;
overflow: hidden;
opacity: 0;
transition: opacity 2s;
}
body.visible {
opacity: 1;
}
/* Your existing CSS styles here */
@keyframes stars {
0% { background-position: 0 0; }
100% { background-position: 798px -798px; }
}
.footer-text {
color: white;
font-size: 14vh;
text-align: center;
padding-top:20%;
}
/* Star Wars style (default) */
@keyframes translateText {
0% {
transform: rotateX(15deg) scale(1.0, 1.0) translateY(66vh);
}
10% {
transform: rotateX(20deg) scale(0.965, .95) translateY(-315.6vh);
}
100% {
transform: rotateX(25deg) scale(0.65, 0.5) translateY(-3750vh);
}
}
/* Minimal style */
@keyframes minimalScroll {
0% {
transform: translateY(100vh);
opacity: 0;
}
5% {
opacity: 1;
}
95% {
opacity: 1;
}
100% {
transform: translateY(-300vh);
opacity: 0;
}
}
/* Elegant style */
@keyframes elegantFade {
0% {
transform: translateY(50vh);
opacity: 0;
}
5% {
opacity: 1;
}
95% {
opacity: 1;
}
100% {
transform: translateY(-300vh);
opacity: 0;
}
}
.text {
font-size: 9vh;
line-height: 1.4;
color: #ebbc3c;
text-align: center;
text-shadow: 0 0 16px #ffeb3b60, 0 0 3px #3bbeff88, 0 0 10px #ffffff83;
width: 80%;
margin: 0 auto;
transform: translateZ(0);
}
.category-header {
font-size: 11vh;
color: #ebbc3c;
margin: 2.5em 0 0.8em;
text-shadow: 0 0 16px #ffeb3b60, 0 0 3px #3bbeff88, 0 0 10px #ffffff83;
text-transform: uppercase;
}
#app {
width: 100vw;
height: 100vh;
font-family: "Nunito Sans", sans-serif;
perspective: 400px;
perspective-origin: center 100%;
overflow: hidden;
display: none;
}
/* Style-specific class overrides */
#app.starwars {
perspective: 400px;
perspective-origin: center 100%;
}
#app.standard {
perspective: none;
}
#app.minimal {
perspective: none;
}
#app.elegant {
perspective: none;
}
#app.visible {
display: block;
}
.logo-container img {
max-width: 200px;
height: auto;
filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
}
.logo-container {
text-align: center;
padding-top: 120px;
position: absolute;
top: 0;
width: 100%;
z-index: 20;
}
.background {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: #0a123630;
background-size: cover;
}
.fade {
position: fixed;
top: 0;
right: 0;
left: 0;
height: 50vh;
background: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .1), rgba(0, 0, 0, .3), rgba(0, 0, 0, .8));
z-index: 10;
}
.text-container {
position: relative;
width: 100%;
height: 100%;
padding-top: 120px;
/* Reduced translateY to start closer to visible area */
transform: rotateX(25deg) scale(0.4, 0.6) translateY(50vh);
}
/* Style-specific class overrides */
.text-container.starwars {
transform: rotateX(25deg) scale(0.4, 0.6) translateY(50vh);
}
.text-container.standard {
transform: translateY(100vh);
}
.text-container.minimal {
transform: translateY(100vh);
}
.text-container.elegant {
transform: translateY(50vh);
}
.text-container.animate.starwars {
animation-name: translateText;
}
.text-container.animate.standard {
animation-name: standardRoll;
}
.text-container.animate.minimal {
animation-name: minimalScroll;
}
.text-container.animate.elegant {
animation-name: elegantFade;
}
.text-container.animate {
animation-duration: 600s;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
/* Style-specific text styles */
.text.standard, .category-header.standard {
color: white;
text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
.text.minimal, .category-header.minimal {
color: #ffffff;
text-shadow: none;
}
.text.elegant, .category-header.elegant {
color: #d3d3d3;
text-shadow: 0 0 8px rgba(211, 211, 211, 0.6);
}
.stars {
overflow: visible;
position: fixed; /* Changed from absolute to fixed */
top: 0;
bottom: 0;
left: 0;
right: 0;
pointer-events: none;
}
.stars:nth-child(1) {
background-image:
radial-gradient(1px 1px at 20px 30px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 50px 160px, #fff, rgba(0,0,0,0)),
radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0));
background-repeat: repeat;
background-size: 200px 200px;
animation: twinkle 4s infinite, starMove 1200s linear infinite;
opacity: 0.5;
}
.stars:nth-child(2) {
background-image:
radial-gradient(1px 1px at 25px 35px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 45px 75px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 55px 165px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 95px 45px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 135px 85px, #fff, rgba(0,0,0,0));
background-repeat: repeat;
background-size: 300px 300px;
animation: twinkle 6s infinite, starMove 1200s linear infinite;
opacity: 0.4;
}
.stars:nth-child(3) {
background-image:
radial-gradient(1px 1px at 30px 40px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 50px 80px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 60px 170px, #fff, rgba(0,0,0,0)),
radial-gradient(1.5px 1.5px at 100px 50px, #fff, rgba(0,0,0,0)),
radial-gradient(1.5px 1.5px at 140px 90px, #fff, rgba(0,0,0,0));
background-repeat: repeat;
background-size: 400px 400px;
animation: twinkle 8s infinite, starMove 1200s linear infinite;
opacity: 0.3;
}
.stars:nth-child(4) {
background-image:
radial-gradient(1px 1px at 35px 45px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 55px 85px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 65px 175px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 105px 55px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 145px 95px, #fff, rgba(0,0,0,0));
background-repeat: repeat;
background-size: 250px 250px;
animation: twinkle 5s infinite, starMove 1200s linear infinite;
opacity: 0.35;
}
.stars:nth-child(5) {
background-image:
radial-gradient(1px 1px at 15px 25px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 35px 65px, #fff, rgba(0,0,0,0)),
radial-gradient(1px 1px at 45px 155px, #fff, rgba(0,0,0,0)),
radial-gradient(2px 2px at 85px 35px, #fff, rgba(0,0,0,0)),
radial-gradient(2px 2px at 125px 75px, #fff, rgba(0,0,0,0));
background-repeat: repeat;
background-size: 150px 150px;
animation: twinkle 7s infinite, starMove 1200s linear infinite;
opacity: 0.45;
}
@keyframes starMove {
from {
transform: translateY(-100%);
}
to {
transform: translateY(100%);
}
}
@keyframes twinkle {
0% {
opacity: 0.3;
animation-timing-function: ease-in;
}
50% {
opacity: 0.8;
animation-timing-function: linear;
}
100% {
opacity: 0.3;
}
}
.stars {
animation: starMove 120s linear infinite;
}
.fadeout {
opacity: 0;
transition: opacity 2s ease-out;
}
/* Hide stars for minimal and elegant styles */
.minimal #space, .elegant #space {
display: none;
}
/* Elegant background */
.elegant .background {
background: linear-gradient(45deg, #1a1a2e, #16213e);
}
/* Minimal background */
.minimal .background {
background: #000;
}
body.visible {
opacity: 1;
}
#app.visible {
display: block;
}
/* Fix animation duration settings */
.text-container.animate {
animation-duration: var(--animation-speed, 600s);
animation-timing-function: linear;
animation-fill-mode: forwards;
}
/* Ensure proper star visibility control for different styles */
.minimal .stars, .elegant .stars {
display: none;
}
/* Fix animation speed issue */
:root {
--animation-speed: 600s;
}
/* Fix footer text position for different styles */
.footer-text {
color: white;
font-size: 14vh;
text-align: center;
padding-top: 20%;
position: relative;
z-index: 1;
}
/* StarWars style stays at default speed (long duration) */
.text-container.animate.starwars {
animation-name: translateText;
animation-duration: var(--animation-speed, 600s);
}
/* Standard style is much faster */
.text-container.animate.standard {
animation-name: standardRoll;
animation-duration: var(--standard-speed, 120s);
}
/* Minimal style is faster */
.text-container.animate.minimal {
animation-name: minimalScroll;
animation-duration: var(--standard-speed, 120s);
}
/* Elegant style is faster */
.text-container.animate.elegant {
animation-name: elegantFade;
animation-duration: var(--standard-speed, 120s);
}
/* Adjust standardRoll animation to fit shorter duration */
@keyframes standardRoll {
0% {
transform: translateY(100vh);
}
100% {
transform: translateY(-300vh);
}
}
/* Avatar styles */
.avatar {
display: inline-block;
width: 6vh;
height: 6vh;
border-radius: 50%;
margin-right: 1vh;
vertical-align: middle;
object-fit: cover;
border: 2px solid rgba(255, 255, 255, 0.3);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.user-entry {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 1vh;
}
.user-entry.with-avatar {
margin-bottom: 2vh;
}
.user-info {
display: inline-block;
vertical-align: middle;
}
</style>
</head>
<body>
<div id="app">
<div class="background"></div>
<div class="fade"></div>
<div class="text-container">
<div class="text" id="credits-content">
<!-- Content will be inserted here -->
</div>
<div class="footer-text" id="endmessage">
Thank you all for being part of the stream! ❤️
</div>
</div>
</div>
<div id="space">
<div class="stars"></div>
<div class="stars"></div>
<div class="stars"></div>
<div class="stars"></div>
<div class="stars"></div>
</div>
<script>
// Get URL parameters
const urlParams = new URLSearchParams(window.location.search);
// User tracking
const users = new Map();
class User {
constructor(name, type) {
this.name = name;
this.type = type;
this.messageCount = 0;
this.donations = 0;
this.isMember = false;
this.avatarUrl = null;
}
get score() {
return (
this.messageCount * 1 +
this.donations * 100 +
(this.isMember ? 50 : 0)
);
}
get displayName() {
let badges = [];
if (this.isMember) badges.push('👑');
if (this.donations > 0) badges.push('💝');
if (this.messageCount > 10) badges.push('💬');
const nameDisplay = this.name;
const badgesDisplay = badges.length > 0 ? badges.join(' ') : '';
const typeDisplay = `[${this.type}]`;
const showamounts = urlParams.has('showamounts');
const donationDisplay = (showamounts && this.donations > 0) ? ` ($${this.donations.toFixed(2)})` : '';
return `${nameDisplay} ${badgesDisplay} ${typeDisplay}${donationDisplay}`;
}
generateHtml() {
const showAvatars = urlParams.has('showavatar') || urlParams.has('showavatars');
if (showAvatars && this.avatarUrl) {
return `<div class="user-entry with-avatar">
<img src="${this.avatarUrl}" alt="${this.name}" class="avatar">
<span class="user-info">${this.displayName}</span>
</div>`;
} else {
return `<div class="user-entry">${this.displayName}</div>`;
}
}
}
function getOrCreateUser(name, type) {
const key = `${name}-${type}`;
if (!users.has(key)) {
users.set(key, new User(name, type));
}
return users.get(key);
}
function processData(data) {
console.log(data);
if (data.content) {
data = data.content;
}
if (!data.chatname || !data.type) return;
const onlydonors = urlParams.has('onlydonors');
if (onlydonors && !data.hasDonation) return;
const user = getOrCreateUser(data.chatname, data.type);
user.messageCount++;
// Store avatar URL if available
if (data.chatimg) {
user.avatarUrl = data.chatimg;
}
if (data.membership) {
user.isMember = true;
}
if (data.hasDonation) {
const [amount] = data.hasDonation.split(' ');
user.donations += parseFloat(amount);
}
}
function generateCreditsContent() {
const sortedUsers = Array.from(users.values())
.sort((a, b) => b.score - a.score);
const vips = sortedUsers.filter(u => u.score >= 150);
const regulars = sortedUsers.filter(u => u.score >= 50 && u.score < 150);
const participants = sortedUsers.filter(u => u.score < 50);
const hidecategories = urlParams.has('hidecategories');
let content = '';
if (vips.length > 0) {
content += hidecategories ? "" : `<div class="category-header ${creditsStyle}">VIP Supporters</div>`;
content += vips.map(u => u.generateHtml()).join('') + '<br><br>';
}
if (regulars.length > 0) {
content += hidecategories ? "" : `<div class="category-header ${creditsStyle}">Regular Supporters</div>`;
content += regulars.map(u => u.generateHtml()).join('') + '<br><br>';
}
if (participants.length > 0) {
content += hidecategories ? "" : `<div class="category-header ${creditsStyle}">Stream Participants</div>`;
content += participants.map(u => u.generateHtml()).join('');
}
return content;
}
// IFRAME setup for Social Stream Ninja
const iframe = document.createElement("iframe");
const filename = "dock";
iframe.src = "https://vdo.socialstream.ninja/?ln&salt=vdo.ninja¬mobile¬mobile&password=false&solo&view=" + urlParams.get('session') + "&novideo&noaudio&label=" + filename + "&cleanoutput&room=" + urlParams.get('session');
iframe.style.width = "0px";
iframe.style.height = "0px";
iframe.style.position = "fixed";
iframe.style.left = "-100px";
iframe.style.top = "-100px";
iframe.id = "frame1";
document.body.appendChild(iframe);
// Set end message if provided
const endMessage = urlParams.get('endmessage');
if (endMessage) {
document.getElementById("endmessage").innerText = endMessage;
}
// Apply style classes
const creditsStyle = urlParams.get('style') || "starwars";
const appElement = document.getElementById('app');
appElement.classList.add(creditsStyle);
// Apply style to text container and content
const textContainer = document.querySelector('.text-container');
textContainer.classList.add(creditsStyle);
// Apply style to all necessary elements
document.querySelectorAll('.text, .category-header').forEach(el => {
el.classList.add(creditsStyle);
});
if (creditsStyle !== "starwars") {
if (creditsStyle === "elegant") {
document.querySelector('.background').style.background = "linear-gradient(45deg, #1a1a2e, #16213e)";
} else if (creditsStyle === "minimal") {
document.querySelector('.background').style.background = "#000";
}
// Hide stars for non-starwars styles
if (creditsStyle === "minimal" || creditsStyle === "elegant") {
document.getElementById('space').style.display = "none";
}
// Remove the star background-image from body immediately
document.body.style.backgroundImage = "none";
}
// Set animation speed
const speed = parseFloat(urlParams.get('speed') || "1");
// Set different default speeds based on style
if (speed !== 1) {
// If speed parameter is provided, apply it to both animation types
const starWarsSpeed = `${600 / speed}s`;
const standardSpeed = `${60 / speed}s`;
document.documentElement.style.setProperty('--animation-speed', starWarsSpeed);
document.documentElement.style.setProperty('--standard-speed', standardSpeed);
} else {
// Default speeds if no speed parameter provided
document.documentElement.style.setProperty('--animation-speed', '600s');
document.documentElement.style.setProperty('--standard-speed', '60s');
}
// Apply custom font if specified
const fontFamily = urlParams.get('font');
const googlefont = urlParams.get('googlefont');
if (googlefont) {
// Load Google font
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = `https://fonts.googleapis.com/css2?family=${encodeURIComponent(googlefont)}&display=swap`;
document.head.appendChild(link);
// Apply the font
document.body.style.fontFamily = `'${googlefont}', sans-serif`;
} else if (fontFamily) {
// Apply predefined font
document.body.style.fontFamily = `'${fontFamily}', sans-serif`;
// Load the OpenDyslexic font if specified
if (fontFamily === 'opendyslexic') {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://fonts.cdnfonts.com/css/opendyslexic';
document.head.appendChild(link);
}
}
// Handle message events
const eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
const eventer = window[eventMethod];
const messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message";
eventer(messageEvent, function (e) {
if (e.source != iframe.contentWindow) return;
if ("dataReceived" in e.data) {
if ("overlayNinja" in e.data.dataReceived) {
processData(e.data.dataReceived.overlayNinja);
}
}
});
// Handle visibility changes
document.addEventListener('visibilitychange', function() {
if (!document.hidden) {
// Page becomes visible
document.body.classList.add('visible');
appElement.classList.add('visible');
// Generate and insert credits content
const creditsContent = document.getElementById('credits-content');
creditsContent.innerHTML = generateCreditsContent();
// Force a reflow before starting animation
void textContainer.offsetWidth;
// Ensure fadeout class is removed
textContainer.classList.remove('fadeout');
// Small delay before adding animation class
setTimeout(() => {
textContainer.classList.add('animate');
}, 50);
} else {
// Page becomes hidden
document.body.classList.remove('visible');
appElement.classList.remove('visible');
textContainer.classList.remove('fadeout');
// Remove animation class to reset position
textContainer.classList.remove('animate');
}
});
// Handle animation end
document.querySelector('.text-container').addEventListener('animationend', function() {
// Clear collected names when animation completes
users.clear();
// Apply fadeout class
this.classList.add('fadeout');
// Hide the app
document.getElementById('app').classList.remove('visible');
document.body.classList.remove('visible');
});
</script>
</body>
</html>