lord6ablo commited on
Commit
631a019
·
verified ·
1 Parent(s): 3173eb2

Delete index.html

Browse files
Files changed (1) hide show
  1. index.html +0 -512
index.html DELETED
@@ -1,512 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>V-Pod</title>
7
- <link rel="stylesheet" href="index.css" />
8
- <link rel="preconnect" href="https://fonts.googleapis.com" />
9
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
- <link
11
- href="https://fonts.googleapis.com/css2?family=Inter:wght@900&family=Satisfy&display=swap"
12
- rel="stylesheet"
13
- />
14
- <<<<<<< HEAD
15
- <audio id="audioPlayer" src="risenfall.mp3" autoplay></audio>
16
- =======
17
- <audio id="audioPlayer" src="overthink.mp3" autoplay></audio>
18
- >>>>>>> 58d66b5f5888eeb66f0ca862510b029273126702
19
-
20
- <script src="/mpegts.js"></script>
21
- </head>
22
- <body>
23
- <div
24
- class="h-screen w-screen grid place-content-center place-items-center overflow-hidden bg-gradient-to-b from-slate-900 to-black"
25
- >
26
- <<<<<<< HEAD
27
- <div id="backgroundVideo" class="absolute inset-0 z-0" style="background-size: cover; background-position: center;">
28
- <video autoplay muted loop class="w-full h-full object-cover">
29
- <source src="v1.mp4" type="video/mp4">
30
- </video>
31
- =======
32
- <div
33
- id="backgroundImage"
34
- class="absolute inset-0 z-0"
35
- style="
36
- background-image: url('https://media2.giphy.com/media/APExBZ9Aqqy4cDXNoS/giphy.gif?cid=82a1493bd7eswewmapwt3vu83f904rw67jl86246jk211bnz&ep=v1_videos_related&rid=giphy.gif&ct=v');
37
- background-size: cover;
38
- background-position: center;
39
- "
40
- >>>>>>> 58d66b5f5888eeb66f0ca862510b029273126702
41
- >
42
- <div class="flex place-content-center justify-between flex-row">
43
- <h1 class="display-flex text-4xl font-black text-teal-300">VGФЙЧ</h1>
44
- <h2 class="cursive text-6xl font-bold text-fuchsia-500">forever</h2>
45
- </div>
46
- </div>
47
- <div x-data="app()" x-init="init()" class="container mx-auto z-10">
48
-
49
- <div class="flex grid place-content-center justify-center w-full p-2">
50
- <video
51
- id="videoElement"
52
- <<<<<<< HEAD
53
- class="aspect-video mx-auto w-auto border-4 border-6 border-orange-900/20 rounded-full"
54
- =======
55
- class="aspect-video mx-auto w-auto border-4 border-6 border-slate-900/80 rounded-full"
56
- >>>>>>> 58d66b5f5888eeb66f0ca862510b029273126702
57
- preload="auto"
58
- muted
59
- autoplay
60
- ></video>
61
- </div>
62
- <div class="flex justify-center bottom-0 pb-2 z-10">
63
- <div class="container mx-auto px-4 opacity-85">
64
- <div class="flex-row items-center justify-center">
65
- <div
66
- class="flex items-center space-x-6 text-xs focus:cursor-pointer"
67
- >
68
- <template x-for="(chan, index) in channels">
69
- <div
70
- class="text-sm capitalize truncate mr-2"
71
- :class="chan.id === channel.id ? 'font-semibold cursor-pointer text-white' : 'text-slate-100 cursor-pointer hover:underline'"
72
- @click="window.location = `${window.location.origin}/?channel=${chan.id}`"
73
- x-text="chan.label"
74
- >
75
- <span
76
- class="animate-ping absolute inline-flex h-3 w-3 rounded-full bg-blue-500 opacity-75"
77
- ></span>
78
- </div>
79
- </template>
80
- </div>
81
-
82
- <div class="flex-col justify-center items-center">
83
- <div class="flex items-center justify-center">
84
- <a class="text-white font-bold" x-text="''"></a>
85
- </div>
86
- </div>
87
- </div>
88
- </div>
89
- </div>
90
- <div class="flex-col items-center justify-center pt-14">
91
- <<<<<<< HEAD
92
- <a class="flex grid place-content-end mr-8" href="https://vgony.tech">
93
- <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="white">
94
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 0 013 3v1"></path>
95
- =======
96
- <a class="flex grid place-content-end "">
97
- <svg href="https://vgony.tech xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="white">
98
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path>
99
- >>>>>>> 58d66b5f5888eeb66f0ca862510b029273126702
100
- </svg>
101
- </a>
102
- <button
103
- id="playPauseBtn"
104
- type="button"
105
- class="dark:bg-slate-100 dark:text-slate-700 flex-none -my-2 mx-auto w-10 h-10 rounded-full shadow-md flex items-center justify-center opacity-90"
106
- aria-label="Pause"
107
- >
108
- <img src="headphones.svg" alt="Pause Button" width="10" height="10" />
109
- <<<<<<< HEAD
110
- <a class="tooltip-text">1 New Message</a>
111
- </button>
112
- =======
113
- </button>
114
-
115
- >>>>>>> 58d66b5f5888eeb66f0ca862510b029273126702
116
- </div>
117
- </div>
118
- </div>
119
- <div id="placeholder" class="relative inset-0 z-0"></div>
120
-
121
- <script>
122
- // Get the audio element and play/pause button
123
- // Get the audio element and play/pause button
124
- const audioPlayer = document.getElementById('audioPlayer');
125
- const playPauseBtn = document.getElementById('playPauseBtn');
126
-
127
- // Array of audio file paths
128
- const audioFiles = [
129
- 'hold.mp3',
130
- 'hold.mp3',
131
- 'risenfall.mp3',
132
- 'hold.mp3',
133
- 'risenfall.mp3',
134
- 'hold.mp3',
135
- 'risenfall.mp3',
136
- 'hold.mp3',
137
- 'tst.mp3',
138
- // Add more audio file paths here
139
- ];
140
-
141
- // Shuffle the audio files array
142
- function shuffleArray(array) {
143
- for (let i = array.length - 1; i > 0; i--) {
144
- const j = Math.floor(Math.random() * (i + 1));
145
- [array[i], array[j]] = [array[j], array[i]];
146
- }
147
- return array;
148
- }
149
-
150
- // Play the next audio file in the shuffled array
151
- function playNextAudio() {
152
- const currentIndex = audioFiles.findIndex(file => file === audioPlayer.src);
153
- const nextIndex = (currentIndex + 1) % audioFiles.length;
154
- audioPlayer.src = audioFiles[nextIndex];
155
- audioPlayer.play();
156
- }
157
-
158
- // Add a click event listener to the play/pause button
159
- playPauseBtn.addEventListener('click', () => {
160
- if (audioPlayer.paused) {
161
- audioPlayer.play();
162
- playPauseBtn.querySelector('img').src = 'pause.svg';
163
-
164
- } else {
165
- audioPlayer.pause();
166
- playPauseBtn.querySelector('img').src = 'headphones.svg';
167
-
168
- }
169
- });
170
-
171
- // Shuffle the audio files array on page load
172
- shuffleArray(audioFiles);
173
- audioPlayer.src = audioFiles[0];
174
- audioPlayer.play();
175
-
176
- // Automatically play the next audio file after the current one finishes
177
- audioPlayer.addEventListener('ended', playNextAudio);
178
-
179
-
180
-
181
-
182
- document.addEventListener("DOMContentLoaded", function () {
183
- setTimeout(function () {
184
- showVideo();
185
- fadeBackgroundImage();
186
- }, 6500); //
187
- });
188
-
189
- function showVideo() {
190
- var videoElement = document.getElementById("videoElement");
191
- videoElement.classList.add("fade-in");
192
- }
193
-
194
- function fadeBackgroundImage() {
195
- var backgroundElement = document.getElementById("backgroundImage");
196
- backgroundElement.classList.add("fade-out");
197
- }
198
- </script>
199
- <script>
200
- // Get the audio element and play/pause button
201
- // Get the audio element and play/pause button
202
- const audioPlayer = document.getElementById('audioPlayer');
203
- const playPauseBtn = document.getElementById('playPauseBtn');
204
-
205
- // Array of audio file paths
206
- const audioFiles = [
207
- 'overthink.mp3',
208
- 'overthink.mp3',
209
- 'overthink.mp3',
210
- // Add more audio file paths here
211
- ];
212
-
213
- // Shuffle the audio files array
214
- function shuffleArray(array) {
215
- for (let i = array.length - 1; i > 0; i--) {
216
- const j = Math.floor(Math.random() * (i + 1));
217
- [array[i], array[j]] = [array[j], array[i]];
218
- }
219
- return array;
220
- }
221
-
222
- // Play the next audio file in the shuffled array
223
- function playNextAudio() {
224
- const currentIndex = audioFiles.findIndex(file => file === audioPlayer.src);
225
- const nextIndex = (currentIndex + 1) % audioFiles.length;
226
- audioPlayer.src = audioFiles[nextIndex];
227
- audioPlayer.play();
228
- }
229
-
230
- // Add a click event listener to the play/pause button
231
- playPauseBtn.addEventListener('click', () => {
232
- if (audioPlayer.paused) {
233
- audioPlayer.play();
234
- playPauseBtn.querySelector('img').src = 'pause.svg';
235
-
236
- } else {
237
- audioPlayer.pause();
238
- playPauseBtn.querySelector('img').src = 'headphones.svg';
239
-
240
- }
241
- });
242
-
243
- // Shuffle the audio files array on page load
244
- shuffleArray(audioFiles);
245
- audioPlayer.src = audioFiles[0];
246
- audioPlayer.play();
247
-
248
- // Automatically play the next audio file after the current one finishes
249
- audioPlayer.addEventListener('ended', playNextAudio);
250
-
251
-
252
- document.addEventListener("DOMContentLoaded", function () {
253
- setTimeout(function () {
254
- showVideo();
255
- }, 3000); // 10 seconds
256
- });
257
-
258
- document.addEventListener("DOMContentLoaded", function () {
259
- setTimeout(function () {
260
- showVideo();
261
- fadeBackgroundImage();
262
- }, 1000); //
263
- });
264
-
265
- function showVideo() {
266
- var videoElement = document.getElementById("videoElement");
267
- videoElement.classList.add("fade-in");
268
- }
269
-
270
- function fadeBackgroundImage() {
271
- var backgroundElement = document.getElementById("backgroundImage");
272
- backgroundElement.classList.add("fade-out");
273
- }
274
- </script>
275
- <script>
276
- // disable analytics (we don't use VideoJS yet anyway)
277
- window.HELP_IMPROVE_VIDEOJS = false;
278
- </script>
279
- <script
280
- defer
281
- src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"
282
- ></script>
283
- <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
284
- <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
285
- <script>
286
- function app() {
287
- return {
288
- enabled: false,
289
- channels: {
290
- /*
291
- legacy: {
292
- id: 'legacy',
293
- label: '#older',
294
- audience: 0,
295
- online: false,
296
- visible: false,
297
- url: 'https://jbilcke-hf-media-server.hf.space/live/legacy.flv',
298
- resolution: '576x320',
299
- model: 'zeroscope_v2_576w',
300
- modelUrl: 'https://huggingface.co/cerspense/zeroscope_v2_576w',
301
- },
302
- */
303
- /*
304
- hdtv: {
305
- id: 'hdtv',
306
- label: '#old',
307
- audience: 0,
308
- online: false,
309
- visible: true,
310
- url: 'https://jbilcke-hf-media-server.hf.space/live/hdtv.flv',
311
- resolution: '1024x576_8FPS',
312
- model: 'zeroscope_v2_XL',
313
- modelUrl: 'https://huggingface.co/cerspense/zeroscope_v2_XL',
314
- },
315
- */
316
- random: {
317
- id: "random",
318
- label: "#random",
319
- audience: 0,
320
- online: false,
321
- visible: true,
322
- url: "https://jbilcke-hf-media-server.hf.space/live/random.flv",
323
- resolution: "1024x576_24FPS",
324
- model: "zeroscope_v2_XL",
325
- modelUrl: "https://huggingface.co/cerspense/zeroscope_v2_XL",
326
- },
327
- comedy: {
328
- id: "comedy",
329
- label: "#comedy",
330
- audience: 0,
331
- online: false,
332
- visible: true,
333
- url: "https://jbilcke-hf-media-server.hf.space/live/comedy.flv",
334
- resolution: "1024x576_24FPS",
335
- model: "zeroscope_v2_XL",
336
- modelUrl: "https://huggingface.co/cerspense/zeroscope_v2_XL",
337
- },
338
- documentary: {
339
- id: "documentary",
340
- label: "#documentary",
341
- audience: 0,
342
- online: false,
343
- visible: true,
344
- url: "https://jbilcke-hf-media-server.hf.space/live/documentary.flv",
345
- resolution: "1024x576_24FPS",
346
- model: "zeroscope_v2_XL",
347
- modelUrl: "https://huggingface.co/cerspense/zeroscope_v2_XL",
348
- },
349
- },
350
- muted: true,
351
- initialized: false,
352
- activityTimeout: null,
353
- defaultChannelId: "random",
354
- video: null,
355
- channel: {},
356
- wakeUp() {
357
- this.showToolbar = true;
358
- },
359
- toggleAudio() {
360
- if (this.video.muted) {
361
- this.video.muted = false;
362
- this.muted = false;
363
- } else {
364
- this.video.muted = true;
365
- this.muted = true;
366
- }
367
- },
368
- async checkAudience() {
369
- let audience = {};
370
- try {
371
- const res = await fetch("/stats");
372
- audience = await res.json();
373
- } catch (err) {
374
- console.log("failed to check the audience, something is wrong");
375
- }
376
-
377
- window.DEBUGME = Object.entries(this.channels);
378
- this.channels = Object.entries(this.channels).reduce(
379
- (acc, [channel, data]) => (
380
- console.log("debug:", {
381
- ...data,
382
- audience: audience[channel] || 0,
383
- }),
384
- {
385
- ...acc,
386
- [channel]: {
387
- ...data,
388
- audience: audience[channel] || 0,
389
- },
390
- }
391
- ),
392
- {}
393
- );
394
- this.channel = this.channels[this.channel.id];
395
- },
396
- fullscreen() {
397
- if (this.video.requestFullscreen) {
398
- this.video.requestFullscreen();
399
- } else if (this.video.mozRequestFullScreen) {
400
- this.video.mozRequestFullScreen();
401
- } else if (this.video.webkitRequestFullscreen) {
402
- this.video.webkitRequestFullscreen();
403
- } else if (this.video.msRequestFullscreen) {
404
- this.video.msRequestFullscreen();
405
- }
406
- },
407
- init() {
408
- if (this.initialized) {
409
- console.log("already initialized");
410
- return;
411
- }
412
- this.initialized = true;
413
- console.log("initializing..");
414
-
415
- const urlParams = new URLSearchParams(window.location.search);
416
-
417
- const requestedChannelId = `${
418
- urlParams.get("channel") || "random"
419
- }`;
420
-
421
- this.enabled = true;
422
- // this.enabled = `${urlParams.get('beta') || 'false'}` === 'true'
423
-
424
- if (!this.enabled) {
425
- return;
426
- }
427
-
428
- this.video = document.getElementById("videoElement");
429
-
430
- const defaultChannel = this.channels[this.defaultChannelId];
431
-
432
- this.channel = this.channels[requestedChannelId] || defaultChannel;
433
-
434
- console.log(`Selected channel: ${this.channel.label}`);
435
- console.log(`Stream URL: ${this.channel.url}`);
436
-
437
- const handleActivity = () => {
438
- this.wakeUp();
439
- };
440
- handleActivity();
441
-
442
- this.checkAudience();
443
- setInterval(() => {
444
- this.checkAudience();
445
- }, 1000);
446
-
447
- // detect mute/unmute events
448
- this.video.addEventListener("mute", () => {
449
- this.muted = true;
450
- });
451
- this.video.addEventListener("unmute", () => {
452
- this.muted = false;
453
- });
454
-
455
- // as a bonus, we also allow fullscreen on double click
456
- this.video.addEventListener("dblclick", () => {
457
- this.fullscreen();
458
- });
459
-
460
- // some devices such as the iPhone don't support MSE Live Playback
461
- if (mpegts.getFeatureList().mseLivePlayback) {
462
- var player = mpegts.createPlayer({
463
- type: "flv", // could also be mpegts, m2ts, flv
464
- isLive: true,
465
- url: this.channel.url,
466
- });
467
- player.attachMediaElement(this.video);
468
-
469
- player.on(mpegts.Events.ERROR, function (err) {
470
- console.log("got an error:", err);
471
- if (err.type === mpegts.ErrorTypes.NETWORK_ERROR) {
472
- console.log("Network error");
473
- }
474
- });
475
-
476
- player.load();
477
-
478
- // due to an issue with our stream when the FFMPEG playlist ends,
479
- // the stream gets interrupted for ~1sec, which causes the frontend to hangs up
480
- // the following code tries to restart the page when that happens, but in the long term
481
- // we should fix the issue on the server side (fix our FFMPEG bash script)
482
- this.video.addEventListener(
483
- "ended",
484
- function () {
485
- console.log("Stream ended, trying to reload...");
486
- setTimeout(() => {
487
- console.log("Reloading the page..");
488
- // Unloading and loading the source again isn't enough it seems
489
- // player.unload()
490
- // player.load()
491
- window.location.reload();
492
- }, 1200);
493
- },
494
- false
495
- );
496
-
497
- // Handle autoplay restrictions.
498
- let promise = this.video.play();
499
- if (promise !== undefined) {
500
- this.video.addEventListener("click", function () {
501
- this.video.play();
502
- });
503
- }
504
-
505
- player.play();
506
- }
507
- },
508
- };
509
- }
510
- </script>
511
- </body>
512
- </html>