Mousco commited on
Commit
ebd57be
·
verified ·
1 Parent(s): 1f292ce

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +801 -19
index.html CHANGED
@@ -1,19 +1,801 @@
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="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>StreamFree - Votre Cinéma à la Maison</title>
7
+ <!-- Importation de FontAwesome pour les icônes -->
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+
10
+ <style>
11
+ /*
12
+ * DESIGN SYSTEM & VARIABLES CSS
13
+ * Utilisation de variables pour une maintenance facile et un thème sombre moderne
14
+ */
15
+ :root {
16
+ --primary-color: #E50914; /* Rouge style Netflix */
17
+ --primary-hover: #b20710;
18
+ --background-dark: #141414;
19
+ --background-light: #1f1f1f;
20
+ --text-white: #ffffff;
21
+ --text-gray: #b3b3b3;
22
+ --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
23
+ --transition-speed: 0.3s;
24
+ --card-ratio: 1.5; /* Ratio pour les affiches 2:3 approx */
25
+ }
26
+
27
+ /* RESET & BASE */
28
+ * {
29
+ margin: 0;
30
+ padding: 0;
31
+ box-sizing: border-box;
32
+ }
33
+
34
+ body {
35
+ font-family: var(--font-main);
36
+ background-color: var(--background-dark);
37
+ color: var(--text-white);
38
+ overflow-x: hidden;
39
+ -webkit-font-smoothing: antialiased;
40
+ }
41
+
42
+ a {
43
+ text-decoration: none;
44
+ color: var(--text-white);
45
+ }
46
+
47
+ /* HEADER / NAVIGATION */
48
+ header {
49
+ position: fixed;
50
+ top: 0;
51
+ width: 100%;
52
+ height: 70px;
53
+ z-index: 1000;
54
+ display: flex;
55
+ align-items: center;
56
+ justify-content: space-between;
57
+ padding: 0 4%;
58
+ background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
59
+ transition: background-color var(--transition-speed);
60
+ }
61
+
62
+ header.scrolled {
63
+ background-color: var(--background-dark);
64
+ }
65
+
66
+ .logo {
67
+ font-size: 1.8rem;
68
+ font-weight: bold;
69
+ color: var(--primary-color);
70
+ text-transform: uppercase;
71
+ letter-spacing: 2px;
72
+ margin-right: 40px;
73
+ }
74
+
75
+ .nav-links {
76
+ display: flex;
77
+ gap: 20px;
78
+ list-style: none;
79
+ }
80
+
81
+ .nav-links li a {
82
+ font-size: 0.9rem;
83
+ color: var(--text-gray);
84
+ transition: color var(--transition-speed);
85
+ }
86
+
87
+ .nav-links li a:hover, .nav-links li a.active {
88
+ color: var(--text-white);
89
+ font-weight: bold;
90
+ }
91
+
92
+ .header-right {
93
+ display: flex;
94
+ align-items: center;
95
+ gap: 20px;
96
+ }
97
+
98
+ /* Barre de recherche */
99
+ .search-box {
100
+ background: rgba(0,0,0,0.75);
101
+ border: 1px solid var(--text-white);
102
+ display: flex;
103
+ align-items: center;
104
+ padding: 5px 10px;
105
+ border-radius: 4px;
106
+ transition: width 0.3s;
107
+ }
108
+
109
+ .search-box input {
110
+ background: transparent;
111
+ border: none;
112
+ color: white;
113
+ outline: none;
114
+ width: 0; /* Caché par défaut */
115
+ transition: width 0.4s;
116
+ padding-left: 0;
117
+ }
118
+
119
+ .search-box:hover input, .search-box input:focus {
120
+ width: 200px;
121
+ padding-left: 10px;
122
+ }
123
+
124
+ .search-box i {
125
+ cursor: pointer;
126
+ }
127
+
128
+ /* HERO SECTION (Film mis en avant) */
129
+ .hero {
130
+ position: relative;
131
+ height: 85vh;
132
+ width: 100%;
133
+ background: url('https://picsum.photos/seed/hero2/1920/1080') center/cover no-repeat;
134
+ display: flex;
135
+ align-items: center;
136
+ }
137
+
138
+ .hero::after {
139
+ content: '';
140
+ position: absolute;
141
+ top: 0; left: 0; width: 100%; height: 100%;
142
+ background: linear-gradient(to top, var(--background-dark) 0%, transparent 60%, rgba(0,0,0,0.4) 100%);
143
+ }
144
+
145
+ .hero-content {
146
+ position: relative;
147
+ z-index: 10;
148
+ padding-left: 4%;
149
+ max-width: 600px;
150
+ padding-top: 100px;
151
+ }
152
+
153
+ .hero-title {
154
+ font-size: 3.5rem;
155
+ margin-bottom: 15px;
156
+ text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
157
+ }
158
+
159
+ .hero-desc {
160
+ font-size: 1.2rem;
161
+ margin-bottom: 25px;
162
+ line-height: 1.5;
163
+ text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
164
+ }
165
+
166
+ .hero-buttons {
167
+ display: flex;
168
+ gap: 15px;
169
+ }
170
+
171
+ .btn {
172
+ padding: 10px 25px;
173
+ border-radius: 4px;
174
+ font-size: 1.1rem;
175
+ font-weight: bold;
176
+ cursor: pointer;
177
+ border: none;
178
+ display: flex;
179
+ align-items: center;
180
+ gap: 10px;
181
+ transition: transform 0.2s, background-color 0.2s;
182
+ }
183
+
184
+ .btn:hover {
185
+ transform: scale(1.05);
186
+ }
187
+
188
+ .btn-play {
189
+ background-color: var(--text-white);
190
+ color: black;
191
+ }
192
+
193
+ .btn-play:hover {
194
+ background-color: rgba(255, 255, 255, 0.75);
195
+ }
196
+
197
+ .btn-info {
198
+ background-color: rgba(109, 109, 110, 0.7);
199
+ color: white;
200
+ }
201
+
202
+ .btn-info:hover {
203
+ background-color: rgba(109, 109, 110, 0.4);
204
+ }
205
+
206
+ /* CATEGORIES & CAROUSELS */
207
+ .category-section {
208
+ padding: 20px 0 40px 4%;
209
+ position: relative;
210
+ z-index: 20;
211
+ margin-top: -50px; /* Chevauchement avec le Hero */
212
+ }
213
+
214
+ .category-title {
215
+ font-size: 1.4rem;
216
+ margin-bottom: 15px;
217
+ font-weight: 600;
218
+ color: #e5e5e5;
219
+ }
220
+
221
+ .carousel-container {
222
+ position: relative;
223
+ width: 100%;
224
+ }
225
+
226
+ .carousel {
227
+ display: flex;
228
+ gap: 10px;
229
+ overflow-x: auto;
230
+ scroll-behavior: smooth;
231
+ padding-right: 4%;
232
+ padding-bottom: 20px; /* Pour la scrollbar ou le hover */
233
+ }
234
+
235
+ /* Masquer la scrollbar tout en gardant le scroll */
236
+ .carousel::-webkit-scrollbar {
237
+ height: 5px;
238
+ }
239
+ .carousel::-webkit-scrollbar-track {
240
+ background: transparent;
241
+ }
242
+ .carousel::-webkit-scrollbar-thumb {
243
+ background: #333;
244
+ border-radius: 10px;
245
+ }
246
+ .carousel::-webkit-scrollbar-thumb:hover {
247
+ background: #555;
248
+ }
249
+
250
+ .movie-card {
251
+ flex: 0 0 auto;
252
+ width: 200px;
253
+ height: 300px; /* Ratio Poster */
254
+ position: relative;
255
+ cursor: pointer;
256
+ border-radius: 4px;
257
+ transition: transform 0.3s ease, z-index 0.3s;
258
+ overflow: hidden;
259
+ }
260
+
261
+ .movie-card img {
262
+ width: 100%;
263
+ height: 100%;
264
+ object-fit: cover;
265
+ border-radius: 4px;
266
+ }
267
+
268
+ .movie-card:hover {
269
+ transform: scale(1.15);
270
+ z-index: 100;
271
+ box-shadow: 0 10px 20px rgba(0,0,0,0.8);
272
+ }
273
+
274
+ /* Overlay sur la carte au survol */
275
+ .card-info {
276
+ position: absolute;
277
+ bottom: 0;
278
+ left: 0;
279
+ width: 100%;
280
+ padding: 10px;
281
+ background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
282
+ opacity: 0;
283
+ transition: opacity 0.3s;
284
+ }
285
+
286
+ .movie-card:hover .card-info {
287
+ opacity: 1;
288
+ }
289
+
290
+ .card-title {
291
+ font-size: 0.9rem;
292
+ font-weight: bold;
293
+ margin-bottom: 5px;
294
+ }
295
+
296
+ .card-meta {
297
+ font-size: 0.7rem;
298
+ color: #46d369; /* Vert "Match" */
299
+ font-weight: bold;
300
+ }
301
+
302
+ /* MODAL PLAYER (Overlay) */
303
+ .video-modal {
304
+ position: fixed;
305
+ top: 0; left: 0; width: 100%; height: 100%;
306
+ background: rgba(0,0,0,0.9);
307
+ z-index: 2000;
308
+ display: none; /* Caché par défaut */
309
+ justify-content: center;
310
+ align-items: center;
311
+ flex-direction: column;
312
+ opacity: 0;
313
+ transition: opacity 0.4s;
314
+ }
315
+
316
+ .video-modal.active {
317
+ display: flex;
318
+ opacity: 1;
319
+ }
320
+
321
+ .modal-content {
322
+ width: 90%;
323
+ max-width: 1000px;
324
+ position: relative;
325
+ }
326
+
327
+ .close-modal {
328
+ position: absolute;
329
+ top: -40px;
330
+ right: 0;
331
+ color: white;
332
+ font-size: 2rem;
333
+ cursor: pointer;
334
+ background: none;
335
+ border: none;
336
+ }
337
+
338
+ .video-wrapper {
339
+ position: relative;
340
+ padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
341
+ height: 0;
342
+ background: black;
343
+ border-radius: 8px;
344
+ overflow: hidden;
345
+ box-shadow: 0 0 50px rgba(229, 9, 20, 0.3);
346
+ }
347
+
348
+ .video-wrapper video, .video-wrapper iframe {
349
+ position: absolute;
350
+ top: 0; left: 0; width: 100%; height: 100%;
351
+ border: none;
352
+ }
353
+
354
+ .modal-details {
355
+ margin-top: 20px;
356
+ color: white;
357
+ }
358
+
359
+ .modal-details h2 {
360
+ margin-bottom: 10px;
361
+ color: var(--primary-color);
362
+ }
363
+
364
+ /* FOOTER */
365
+ footer {
366
+ margin-top: 50px;
367
+ padding: 50px 4%;
368
+ color: var(--text-gray);
369
+ font-size: 0.9rem;
370
+ text-align: center;
371
+ }
372
+
373
+ .footer-links {
374
+ margin-bottom: 20px;
375
+ }
376
+
377
+ .footer-links a {
378
+ margin: 0 10px;
379
+ }
380
+
381
+ .anycoder-badge {
382
+ margin-top: 20px;
383
+ font-size: 0.8rem;
384
+ opacity: 0.7;
385
+ }
386
+
387
+ .anycoder-badge a {
388
+ color: var(--primary-color);
389
+ font-weight: bold;
390
+ }
391
+
392
+ /* RESPONSIVE DESIGN */
393
+ @media (max-width: 768px) {
394
+ .nav-links {
395
+ display: none; /* Menu burger non implémenté pour simplifier, on cache le texte */
396
+ }
397
+
398
+ .hero-title {
399
+ font-size: 2.5rem;
400
+ }
401
+
402
+ .hero-desc {
403
+ font-size: 1rem;
404
+ max-width: 100%;
405
+ }
406
+
407
+ .movie-card {
408
+ width: 140px;
409
+ height: 210px;
410
+ }
411
+ }
412
+
413
+ /* Loader */
414
+ .loader {
415
+ border: 4px solid #f3f3f3;
416
+ border-top: 4px solid var(--primary-color);
417
+ border-radius: 50%;
418
+ width: 40px;
419
+ height: 40px;
420
+ animation: spin 1s linear infinite;
421
+ margin: 20px auto;
422
+ display: none;
423
+ }
424
+
425
+ @keyframes spin {
426
+ 0% { transform: rotate(0deg); }
427
+ 100% { transform: rotate(360deg); }
428
+ }
429
+
430
+ </style>
431
+ </head>
432
+ <body>
433
+
434
+ <!-- Header -->
435
+ <header id="main-header">
436
+ <div style="display: flex; align-items: center;">
437
+ <div class="logo">StreamFree</div>
438
+ <ul class="nav-links">
439
+ <li><a href="#" class="active">Accueil</a></li>
440
+ <li><a href="#">Séries</a></li>
441
+ <li><a href="#">Films</a></li>
442
+ <li><a href="#">Ma Liste</a></li>
443
+ </ul>
444
+ </div>
445
+
446
+ <div class="header-right">
447
+ <!-- Search Bar -->
448
+ <div class="search-box">
449
+ <i class="fas fa-search"></i>
450
+ <input type="text" id="searchInput" placeholder="Titres, personnes, genres">
451
+ </div>
452
+ <i class="fas fa-bell" style="font-size: 1.2rem; cursor: pointer;"></i>
453
+ <div style="width: 30px; height: 30px; background: #e5e5e5; border-radius: 4px; cursor: pointer;">
454
+ <img src="https://picsum.photos/seed/user/30/30" alt="User" style="border-radius: 4px;">
455
+ </div>
456
+ </div>
457
+ </header>
458
+
459
+ <!-- Main Content -->
460
+ <main>
461
+ <!-- Hero Section -->
462
+ <section class="hero" id="hero-section">
463
+ <div class="hero-content">
464
+ <h1 class="hero-title" id="hero-title">Chargement...</h1>
465
+ <p class="hero-desc" id="hero-desc">Découvrez cette histoire incroyable.</p>
466
+ <div class="hero-buttons">
467
+ <button class="btn btn-play" onclick="playHeroMovie()">
468
+ <i class="fas fa-play"></i> Lecture
469
+ </button>
470
+ <button class="btn btn-info">
471
+ <i class="fas fa-info-circle"></i> Plus d'infos
472
+ </button>
473
+ </div>
474
+ </div>
475
+ </section>
476
+
477
+ <!-- Dynamic Content Area -->
478
+ <div id="content-area">
479
+ <!-- Les catégories seront injectées ici par JS -->
480
+ </div>
481
+
482
+ <div class="loader" id="loader"></div>
483
+ </main>
484
+
485
+ <!-- Video Player Modal -->
486
+ <div class="video-modal" id="videoModal">
487
+ <div class="modal-content">
488
+ <button class="close-modal" onclick="closePlayer()">&times;</button>
489
+ <div class="video-wrapper" id="videoContainer">
490
+ <!-- Video ou Iframe sera injecté ici -->
491
+ </div>
492
+ <div class="modal-details" id="modalDetails">
493
+ <!-- Détails du film -->
494
+ </div>
495
+ </div>
496
+ </div>
497
+
498
+ <!-- Footer -->
499
+ <footer>
500
+ <div class="footer-links">
501
+ <a href="#">Audiodescription</a>
502
+ <a href="#">Centre d'aide</a>
503
+ <a href="#">Cartes cadeaux</a>
504
+ <a href="#">Médias</a>
505
+ <a href="#">Relations Investisseurs</a>
506
+ <a href="#">Emplois</a>
507
+ <a href="#">Conditions d'utilisation</a>
508
+ <a href="#">Confidentialité</a>
509
+ <a href="#">Mentions légales</a>
510
+ <a href="#">Préf��rences de cookies</a>
511
+ <a href="#">Informations sur l'entreprise</a>
512
+ <a href="#">Contactez-nous</a>
513
+ </div>
514
+ <p>&copy; 2023-2024 StreamFree Simulation.</p>
515
+ <div class="anycoder-badge">
516
+ Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
517
+ </div>
518
+ </footer>
519
+
520
+ <script>
521
+ /**
522
+ * DONNÉES SIMULÉES (MOCK DATA)
523
+ * Utilisation de vidéos open-source pour éviter le piratage.
524
+ * Images provenant de Picsum Photos.
525
+ */
526
+ const categories = [
527
+ { id: 'trending', title: 'Tendances actuelles' },
528
+ { id: 'originals', title: 'Productions StreamFree' },
529
+ { id: 'action', title: 'Films d\'action' },
530
+ { id: 'scifi', title: 'Science-Fiction' }
531
+ ];
532
+
533
+ // Vidéos Open Source (Big Buck Bunny, Sintel, etc.)
534
+ const videoSources = [
535
+ "https://media.w3.org/2010/05/sintel/trailer.mp4",
536
+ "https://media.w3.org/2010/05/bunny/trailer.mp4",
537
+ "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_1MB.mp4"
538
+ ];
539
+
540
+ const moviesDB = [
541
+ // Tendances
542
+ { title: "L'Odyssée Cosmique", category: 'trending', img: "https://picsum.photos/seed/cosmic/300/450", desc: "Un voyage épique à travers les galaxies.", video: videoSources[0] },
543
+ { title: "La Dernière Frontière", category: 'trending', img: "https://picsum.photos/seed/frontier/300/450", desc: "La survie de l'humanité est en jeu.", video: videoSources[1] },
544
+ { title: "Cyber Punk City", category: 'trending', img: "https://picsum.photos/seed/cyber/300/450", desc: "Dans un futur dominé par la technologie.", video: videoSources[2] },
545
+ { title: "L'Enquête", category: 'trending', img: "https://picsum.photos/seed/detective/300/450", desc: "Un thriller psychologique intense.", video: videoSources[0] },
546
+ { title: "Nature Sauvage", category: 'trending', img: "https://picsum.photos/seed/wild/300/450", desc: "Documentaire sur la faune.", video: videoSources[1] },
547
+
548
+ // Originals
549
+ { title: "Chroniques du Temps", category: 'originals', img: "https://picsum.photos/seed/time/300/450", desc: "Série exclusive StreamFree.", video: videoSources[2] },
550
+ { title: "Les Oubliés", category: 'originals', img: "https://picsum.photos/seed/forgotten/300/450", desc: "L'histoire d'un groupe perdu.", video: videoSources[0] },
551
+ { title: "Arena Master", category: 'originals', img: "https://picsum.photos/seed/arena/300/450", desc: "Le combat ultime commence.", video: videoSources[1] },
552
+
553
+ // Action
554
+ { title: "Rapide et Mortel", category: 'action', img: "https://picsum.photos/seed/fast/300/450", desc: "Poursuites effrénées.", video: videoSources[2] },
555
+ { title: "Mission Omega", category: 'action', img: "https://picsum.photos/seed/omega/300/450", desc: "Une mission impossible.", video: videoSources[0] },
556
+ { title: "Le Guerrier", category: 'action', img: "https://picsum.photos/seed/warrior/300/450", desc: "Honneur et combat.", video: videoSources[1] },
557
+ { title: "Explosion City", category: 'action', img: "https://picsum.photos/seed/boom/300/450", desc: "Action pure.", video: videoSources[2] },
558
+
559
+ // Sci-Fi
560
+ { title: "Mars Red", category: 'scifi', img: "https://picsum.photos/seed/mars/300/450", desc: "La colonisation a échoué.", video: videoSources[0] },
561
+ { title: "AI Rebellion", category: 'scifi', img: "https://picsum.photos/seed/ai/300/450", desc: "Les machines prennent le pouvoir.", video: videoSources[1] },
562
+ { title: "Deep Space", category: 'scifi', img: "https://picsum.photos/seed/space/300/450", desc: "Au-delà de l'univers connu.", video: videoSources[2] }
563
+ ];
564
+
565
+ // État Global
566
+ let currentHeroMovie = moviesDB[0];
567
+
568
+ /**
569
+ * INITIALISATION
570
+ */
571
+ document.addEventListener('DOMContentLoaded', () => {
572
+ setupHeaderScroll();
573
+ setupSearch();
574
+ loadHeroSection();
575
+ renderAllCategories();
576
+ });
577
+
578
+ /**
579
+ * GESTION DU HEADER
580
+ * Change la couleur du background au scroll
581
+ */
582
+ function setupHeaderScroll() {
583
+ const header = document.getElementById('main-header');
584
+ window.addEventListener('scroll', () => {
585
+ if (window.scrollY > 50) {
586
+ header.classList.add('scrolled');
587
+ } else {
588
+ header.classList.remove('scrolled');
589
+ }
590
+ });
591
+ }
592
+
593
+ /**
594
+ * CHARGEMENT DU HERO
595
+ */
596
+ function loadHeroSection() {
597
+ // Sélectionner un film aléatoire pour le Hero
598
+ const randomMovie = moviesDB[Math.floor(Math.random() * moviesDB.length)];
599
+ currentHeroMovie = randomMovie;
600
+
601
+ const heroSection = document.getElementById('hero-section');
602
+ const heroTitle = document.getElementById('hero-title');
603
+ const heroDesc = document.getElementById('hero-desc');
604
+
605
+ // Mise à jour de l'image de fond
606
+ heroSection.style.backgroundImage = `url('${randomMovie.img.replace('300/450', '1920/1080')}')`; // Image HD
607
+
608
+ heroTitle.textContent = randomMovie.title;
609
+ heroDesc.textContent = randomMovie.desc;
610
+ }
611
+
612
+ /**
613
+ * LECTURE DU FILM HERO
614
+ */
615
+ function playHeroMovie() {
616
+ openPlayer(currentHeroMovie);
617
+ }
618
+
619
+ /**
620
+ * RENDU DES CATÉGORIES ET FILMS
621
+ */
622
+ function renderAllCategories() {
623
+ const contentArea = document.getElementById('content-area');
624
+ contentArea.innerHTML = ''; // Reset
625
+
626
+ categories.forEach(cat => {
627
+ // Créer la section HTML
628
+ const section = document.createElement('section');
629
+ section.className = 'category-section';
630
+
631
+ const title = document.createElement('h3');
632
+ title.className = 'category-title';
633
+ title.textContent = cat.title;
634
+
635
+ const carouselContainer = document.createElement('div');
636
+ carouselContainer.className = 'carousel-container';
637
+
638
+ const carousel = document.createElement('div');
639
+ carousel.className = 'carousel';
640
+ carousel.id = `carousel-${cat.id}`;
641
+
642
+ // Filtrer les films pour cette catégorie
643
+ const moviesInCategory = moviesDB.filter(m => m.category === cat.id);
644
+
645
+ if (moviesInCategory.length > 0) {
646
+ moviesInCategory.forEach(movie => {
647
+ const card = createMovieCard(movie);
648
+ carousel.appendChild(card);
649
+ });
650
+ } else {
651
+ // Fallback si vide (afficher quelques films aléatoires)
652
+ moviesDB.slice(0, 5).forEach(movie => {
653
+ const card = createMovieCard(movie);
654
+ carousel.appendChild(card);
655
+ });
656
+ }
657
+
658
+ carouselContainer.appendChild(carousel);
659
+ section.appendChild(title);
660
+ section.appendChild(carouselContainer);
661
+ contentArea.appendChild(section);
662
+ });
663
+ }
664
+
665
+ /**
666
+ * CRÉATION D'UNE CARTE FILM
667
+ */
668
+ function createMovieCard(movie) {
669
+ const card = document.createElement('div');
670
+ card.className = 'movie-card';
671
+ card.onclick = () => openPlayer(movie);
672
+
673
+ const img = document.createElement('img');
674
+ img.src = movie.img;
675
+ img.alt = movie.title;
676
+ img.loading = "lazy"; // Performance
677
+
678
+ const info = document.createElement('div');
679
+ info.className = 'card-info';
680
+
681
+ const title = document.createElement('div');
682
+ title.className = 'card-title';
683
+ title.textContent = movie.title;
684
+
685
+ const meta = document.createElement('div');
686
+ meta.className = 'card-meta';
687
+ meta.textContent = '98% Match';
688
+
689
+ info.appendChild(title);
690
+ info.appendChild(meta);
691
+ card.appendChild(img);
692
+ card.appendChild(info);
693
+
694
+ return card;
695
+ }
696
+
697
+ /**
698
+ * GESTION DU PLAYER VIDÉO (MODAL)
699
+ */
700
+ const modal = document.getElementById('videoModal');
701
+ const videoContainer = document.getElementById('videoContainer');
702
+ const modalDetails = document.getElementById('modalDetails');
703
+
704
+ function openPlayer(movie) {
705
+ modal.classList.add('active');
706
+
707
+ // Injecter la balise vidéo HTML5
708
+ videoContainer.innerHTML = `
709
+ <video controls autoplay>
710
+ <source src="${movie.video}" type="video/mp4">
711
+ Votre navigateur ne supporte pas la balise vidéo.
712
+ </video>
713
+ `;
714
+
715
+ // Afficher les détails
716
+ modalDetails.innerHTML = `
717
+ <h2>${movie.title}</h2>
718
+ <p>${movie.desc}</p>
719
+ <div style="margin-top:10px; font-size: 0.9rem; color: #aaa;">
720
+ <span style="color:#46d369; font-weight:bold;">98% Match</span> &nbsp;|&nbsp;
721
+ <span>2023</span> &nbsp;|&nbsp;
722
+ <span>1h 45m</span> &nbsp;|&nbsp;
723
+ <span>HD</span>
724
+ </div>
725
+ `;
726
+
727
+ document.body.style.overflow = 'hidden'; // Empêcher le scroll arrière-plan
728
+ }
729
+
730
+ function closePlayer() {
731
+ modal.classList.remove('active');
732
+ videoContainer.innerHTML = ''; // Arrêter la vidéo
733
+ document.body.style.overflow = 'auto';
734
+ }
735
+
736
+ // Fermer la modal en cliquant en dehors
737
+ modal.addEventListener('click', (e) => {
738
+ if (e.target === modal) {
739
+ closePlayer();
740
+ }
741
+ });
742
+
743
+ /**
744
+ * BARRE DE RECHERCHE
745
+ */
746
+ function setupSearch() {
747
+ const searchInput = document.getElementById('searchInput');
748
+
749
+ searchInput.addEventListener('input', (e) => {
750
+ const query = e.target.value.toLowerCase();
751
+
752
+ if (query.length > 0) {
753
+ filterMovies(query);
754
+ } else {
755
+ renderAllCategories(); // Retour à la normale
756
+ }
757
+ });
758
+ }
759
+
760
+ function filterMovies(query) {
761
+ const contentArea = document.getElementById('content-area');
762
+ contentArea.innerHTML = '';
763
+
764
+ // Filtrer la base de données
765
+ const filteredMovies = moviesDB.filter(m =>
766
+ m.title.toLowerCase().includes(query) ||
767
+ m.desc.toLowerCase().includes(query)
768
+ );
769
+
770
+ if (filteredMovies.length === 0) {
771
+ contentArea.innerHTML = '<div style="padding: 50px; text-align: center; color: #666;">Aucun résultat trouvé.</div>';
772
+ return;
773
+ }
774
+
775
+ // Créer une section spéciale "Résultats"
776
+ const section = document.createElement('section');
777
+ section.className = 'category-section';
778
+
779
+ const title = document.createElement('h3');
780
+ title.className = 'category-title';
781
+ title.textContent = `Résultats pour "${query}"`;
782
+
783
+ const carousel = document.createElement('div');
784
+ carousel.className = 'carousel';
785
+ // Flex wrap pour la recherche afin de tout monter en grille si besoin, ou scroll horizontal
786
+ carousel.style.display = 'flex';
787
+ carousel.style.flexWrap = 'wrap';
788
+
789
+ filteredMovies.forEach(movie => {
790
+ const card = createMovieCard(movie);
791
+ carousel.appendChild(card);
792
+ });
793
+
794
+ section.appendChild(title);
795
+ section.appendChild(carousel);
796
+ contentArea.appendChild(section);
797
+ }
798
+
799
+ </script>
800
+ </body>
801
+ </html>