-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
credits.html
428 lines (366 loc) · 13.1 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
<!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%;
}
@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);
}
}
.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;
}
#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);
}
.text-container.animate {
animation: 600s linear translateText forwards;
}
.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;
}
</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">
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>
// 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;
}
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('💬');
return `${this.name} ${badges.join(' ')} [${this.type}]`;
}
}
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 user = getOrCreateUser(data.chatname, data.type);
user.messageCount++;
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);
let content = '';
if (vips.length > 0) {
content += '<div class="category-header">VIP Supporters</div>';
content += vips.map(u => u.displayName).join('<br>') + '<br><br>';
}
if (regulars.length > 0) {
content += '<div class="category-header">Regular Supporters</div>';
content += regulars.map(u => u.displayName).join('<br>') + '<br><br>';
}
if (participants.length > 0) {
content += '<div class="category-header">Stream Participants</div>';
content += participants.map(u => u.displayName).join('<br>');
}
return content;
}
// IFRAME setup for Social Stream Ninja
const iframe = document.createElement("iframe");
const filename = "dock";
const urlParams = new URLSearchParams(window.location.search);
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);
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);
}
}
});
document.addEventListener('visibilitychange', function() {
const appElement = document.getElementById('app');
const textContainer = document.querySelector('.text-container');
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;
// 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');
}
});
document.querySelector('.text-container').addEventListener('animationend', function() {
// Clear collected names when animation completes
users.clear();
// Remove the animation class to reset position
this.classList.add('fadeout');
// Hide the app
document.getElementById('app').classList.remove('visible');
document.body.classList.remove('visible');
});
</script>
</body>
</html>