vericudebuget commited on
Commit
119b382
·
verified ·
1 Parent(s): 55e9ba3

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +423 -18
index.html CHANGED
@@ -1,19 +1,424 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>HuggingTube</title>
8
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
9
+ <style>
10
+
11
+
12
+ :root {
13
+ --bg-primary: #0a0f18;
14
+ --bg-secondary: #141e2f;
15
+ --text-primary: #ffffff;
16
+ --text-secondary: #adbac7;
17
+ --accent: #2188ff;
18
+ }
19
+
20
+ * {
21
+ margin: 0;
22
+ padding: 0;
23
+ box-sizing: border-box;
24
+ }
25
+
26
+ .video-card {
27
+ width: 250px;
28
+ margin: 15px;
29
+ }
30
+
31
+ body {
32
+ font-family: Arial, sans-serif;
33
+ background-color: var(--bg-primary);
34
+ color: var(--text-primary);
35
+ }
36
+
37
+ header {
38
+ display: flex;
39
+ justify-content: space-between;
40
+ align-items: center;
41
+ padding: 0.5rem 1rem;
42
+ background-color: var(--bg-secondary);
43
+ position: fixed;
44
+ top: 0;
45
+ left: 0;
46
+ right: 0;
47
+ z-index: 1000;
48
+ }
49
+
50
+ .logo {
51
+ color: var(--text-primary);
52
+ font-size: 1.2rem;
53
+ font-weight: bold;
54
+ display: flex;
55
+ align-items: center;
56
+ }
57
+
58
+ .logo i {
59
+ color: var(--accent);
60
+ margin-right: 0.5rem;
61
+ }
62
+
63
+ .search-bar {
64
+ flex-grow: 1;
65
+ max-width: 600px;
66
+ margin: 0 1rem;
67
+ }
68
+
69
+ .search-bar input {
70
+ width: 100%;
71
+ padding: 0.5rem 1rem;
72
+ border-radius: 20px;
73
+ border: 1px solid var(--text-secondary);
74
+ background-color: var(--bg-primary);
75
+ color: var(--text-primary);
76
+ }
77
+
78
+ .user-actions i {
79
+ margin-left: 1rem;
80
+ cursor: pointer;
81
+ }
82
+
83
+ main {
84
+ display: flex;
85
+ margin-top: 56px; /* Header height */
86
+ }
87
+
88
+ .sidebar {
89
+ width: 240px;
90
+ padding: 1rem;
91
+ position: fixed;
92
+ top: 56px;
93
+ bottom: 0;
94
+ overflow-y: auto;
95
+ background-color: var(--bg-primary);
96
+ }
97
+
98
+ .sidebar-item {
99
+ display: flex;
100
+ align-items: center;
101
+ padding: 0.75rem 1rem;
102
+ cursor: pointer;
103
+ border-radius: 10px;
104
+ }
105
+
106
+ .sidebar-item:hover {
107
+ background-color: var(--bg-secondary);
108
+ }
109
+
110
+ .sidebar-item i {
111
+ margin-right: 1rem;
112
+ width: 20px;
113
+ }
114
+
115
+ .content {
116
+ flex-grow: 1;
117
+ padding: 1rem;
118
+ margin-left: 240px;
119
+ }
120
+
121
+ .video-grid {
122
+ display: grid;
123
+ grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
124
+ gap: 1rem;
125
+ }
126
+
127
+ .video-card {
128
+ cursor: pointer;
129
+ }
130
+
131
+ .thumbnail {
132
+ position: relative;
133
+ width: 100%;
134
+ height: 0;
135
+ padding-bottom: 56.25%;
136
+ background-color: var(--bg-secondary);
137
+ border-radius: 10px;
138
+ overflow: hidden;
139
+ }
140
+
141
+ .video-duration {
142
+ position: absolute;
143
+ bottom: 5px;
144
+ right: 5px;
145
+ background-color: rgba(0, 0, 0, 0.8);
146
+ padding: 2px 4px;
147
+ border-radius: 4px;
148
+ font-size: 0.8rem;
149
+ }
150
+
151
+ .video-info {
152
+ display: grid;
153
+ margin-top: 0.5rem;
154
+ }
155
+
156
+ .channel-avatar {
157
+ width: 36px;
158
+ height: 36px;
159
+ border-radius: 50%;
160
+ background-color: var(--bg-secondary);
161
+ margin-right: 0.5rem;
162
+ flex-shrink: 0;
163
+ }
164
+
165
+ .video-details h3 {
166
+ font-size: 1rem;
167
+ margin-bottom: 0.25rem;
168
+ }
169
+
170
+ .video-details p {
171
+ font-size: 0.9rem;
172
+ color: var(--text-secondary);
173
+ }
174
+
175
+ .mobile-nav {
176
+ display: none;
177
+ position: fixed;
178
+ bottom: 0;
179
+ left: 0;
180
+ right: 0;
181
+ background-color: var(--bg-secondary);
182
+ padding: 0.5rem;
183
+ z-index: 1000;
184
+ }
185
+
186
+ .mobile-nav-items {
187
+ display: flex;
188
+ justify-content: space-around;
189
+ }
190
+
191
+ .mobile-nav-item {
192
+ display: flex;
193
+ flex-direction: column;
194
+ align-items: center;
195
+ font-size: 0.8rem;
196
+ }
197
+
198
+ .mobile-nav-item i {
199
+ font-size: 1.2rem;
200
+ margin-bottom: 0.25rem;
201
+ }
202
+
203
+ /* Mobile styles */
204
+ @media (max-width: 768px)
205
+
206
+ {
207
+
208
+ .video-card {
209
+ width: 100%;
210
+ margin: 15px;
211
+ }
212
+
213
+ .logo span {
214
+ display: none;
215
+ }
216
+
217
+ .search-bar {
218
+ margin: 0 0.5rem;
219
+ }
220
+
221
+ .user-actions i {
222
+ margin-left: 0.5rem;
223
+ }
224
+
225
+ .sidebar {
226
+ display: none;
227
+ }
228
+
229
+ .content {
230
+ margin-left: 0;
231
+ margin-bottom: 60px; /* Space for mobile nav */
232
+ }
233
+
234
+ .mobile-nav {
235
+ display: block;
236
+ }
237
+
238
+ .video-grid {
239
+ display: grid;
240
+ grid-template-columns: 1fr;
241
+ }
242
+
243
+
244
+ }
245
+
246
+
247
+ /* Small mobile styles */
248
+ @media (max-width: 480px) {
249
+
250
+
251
+ .video-card {
252
+ width: 100%;
253
+ margin: 15px;
254
+ }
255
+
256
+
257
+ .user-actions {
258
+ display: none;
259
+ }
260
+
261
+ .search-bar input {
262
+ font-size: 14px;
263
+ }
264
+
265
+ .video-details h3 {
266
+ font-size: 0.9rem;
267
+ }
268
+
269
+ .video-details p {
270
+ font-size: 0.8rem;
271
+ }
272
+ }
273
+
274
+
275
+ .video-grid {
276
+ display: flex;
277
+ flex-wrap: wrap;
278
+ }
279
+
280
+
281
+
282
+ .thumbnail img {
283
+ width: 100%;
284
+ }
285
+
286
+ .video-info h3 {
287
+ margin: 10px 0;
288
+ }
289
+ </style>
290
+ </head>
291
+
292
+ <body>
293
+ <header>
294
+ <div class="logo">
295
+ <i class="fab fa-youtube"></i>
296
+ <span>HuggingTube</span>
297
+ </div>
298
+ <div class="search-bar">
299
+ <input type="text" placeholder="Search">
300
+ </div>
301
+ <div class="user-actions">
302
+ <i class="fas fa-video"></i>
303
+ <i class="fas fa-bell"></i>
304
+ <i class="fas fa-user-circle"></i>
305
+ </div>
306
+ </header>
307
+
308
+ <main>
309
+ <aside class="sidebar">
310
+ <div class="sidebar-item">
311
+ <i class="fas fa-home"></i> Home
312
+ </div>
313
+ <div class="sidebar-item">
314
+ <i class="fas fa-compass"></i> Explore
315
+ </div>
316
+ <div class="sidebar-item">
317
+ <i class="fas fa-upload"></i> Upload
318
+ </div>
319
+ <div class="sidebar-item">
320
+ <i class="fas fa-photo-video"></i> All videos
321
+ </div>
322
+ </aside>
323
+
324
+ <section class="content">
325
+ <div class="video-grid" id="videoGrid">
326
+ <!-- Dynamic video cards will be inserted here -->
327
+ </div>
328
+ </section>
329
+ </main>
330
+
331
+ <nav class="mobile-nav">
332
+ <div class="mobile-nav-items">
333
+ <div class="mobile-nav-item">
334
+ <i class="fas fa-home"></i> Home
335
+ </div>
336
+ <div class="mobile-nav-item">
337
+ <i class="fas fa-compass"></i> Explore
338
+ </div>
339
+ <div class="mobile-nav-item">
340
+ <i class="fas fa-upload"></i> Upload
341
+ </div>
342
+ <div class="mobile-nav-item">
343
+ <i class="fas fa-photo-video"></i> Library
344
+ </div>
345
+ </div>
346
+ </nav>
347
+
348
+ <script>
349
+ async function fetchVideoMetadata() {
350
+ try {
351
+ // Fetch the raw video-index JSON-like data
352
+ const response = await fetch('https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/video-index.json');
353
+ const textData = await response.text();
354
+
355
+ // Manually process the raw data, splitting by ';' and trimming
356
+ let rawUrls = textData.trim().replace(/[{}]/g, '').split(';').filter(url => url.trim());
357
+
358
+ // Base URLs for metadata and thumbnails
359
+ const baseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/';
360
+ const thumbnailBaseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/thumbnails/';
361
+
362
+ // Loop through each URL in the list and fetch the respective metadata
363
+ const videoGrid = document.getElementById('videoGrid');
364
+ for (let i = 0; i < rawUrls.length; i++) {
365
+ let videoUrl = rawUrls[i].trim();
366
+
367
+ // Extract only the file name (last part of the URL)
368
+ let fileName = videoUrl.substring(videoUrl.lastIndexOf('/') + 1);
369
+ let indexFileName = fileName.replace('-index.json', ''); // Remove '-index.json' for use in redirection
370
+
371
+ // Create the full URL by appending the file name to the base URL
372
+ let finalUrl = baseUrl + encodeURIComponent(fileName);
373
+
374
+ try {
375
+ // Fetch metadata from the properly encoded URL
376
+ const videoResponse = await fetch(finalUrl);
377
+ const videoData = await videoResponse.json();
378
+
379
+ // Fix thumbnail URL by using the online location
380
+ let thumbnailUrl = thumbnailBaseUrl + encodeURIComponent(videoData.thumbnailLocation.substring(videoData.thumbnailLocation.lastIndexOf('/') + 1));
381
+
382
+ // Create a video card dynamically
383
+ const videoCard = document.createElement('div');
384
+ videoCard.classList.add('video-card');
385
+ videoCard.innerHTML = `
386
+ <div class="thumbnail">
387
+ <img src="${thumbnailUrl}" alt="${videoData.title}" style="cursor: pointer;" onclick="window.location.href='videos/jsonindex${indexFileName}.html'">
388
+ <span class="video-duration">N/A</span>
389
+ </div>
390
+ <div class="video-info">
391
+ <h3 style="cursor: pointer;" onclick="window.location.href='videos/jsonindex${indexFileName}.html'">${videoData.title}</h3>
392
+ <p>${videoData.uploader}</p>
393
+ <p>${videoData.views} views • ${new Date(videoData.uploadTimestamp).toLocaleDateString()}</p>
394
+ </div>
395
+ `;
396
+
397
+ // Append the video card to the grid
398
+ videoGrid.appendChild(videoCard);
399
+
400
+ // Wait 0.3 seconds before fetching the next URL
401
+ await new Promise(resolve => setTimeout(resolve, 300));
402
+
403
+ } catch (videoError) {
404
+ console.error(`Error fetching metadata for URL: ${finalUrl}`, videoError);
405
+ }
406
+ }
407
+ } catch (error) {
408
+ console.error('Error fetching video metadata:', error);
409
+ }
410
+ }
411
+
412
+ // Call the function on page load
413
+ window.onload = fetchVideoMetadata;
414
+
415
+
416
+
417
+ </script>
418
+
419
+
420
+ <img scr="https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/thumbnails/From%20Buddha%20to%20Jesus%20%20%23fyp%20%23christian%20%23testimony%20%23gospel%20%23jesusislord%20%23believe%20%23%C9%A2%E1%B4%8F%E1%B4%85%C9%AAs%C9%A2%E1%B4%8F%E1%B4%8F%E1%B4%85%20%23christ%20%23jesusiscalling%20%23christianpost%20%23christianity%20%23bible%20%23biblestudymoments%20(1)-kwne_thumb.jpg"></img>
421
+
422
+ </body>
423
+
424
  </html>