Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>VStream - Premium Content Platform</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| :root { | |
| --bg-dark: #0a0a0f; | |
| --bg-card: #16161e; | |
| --bg-hover: #20202b; | |
| --primary: #6366f1; /* Modern Indigo */ | |
| --primary-glow: rgba(99, 102, 241, 0.4); | |
| --accent: #ec4899; /* Pink accent for highlights */ | |
| --text-main: #f3f4f6; | |
| --text-secondary: #9ca3af; | |
| --border-color: #27272a; | |
| --gradient-text: linear-gradient(90deg, var(--primary), var(--accent)); | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; | |
| background-color: var(--bg-dark); | |
| color: var(--text-main); | |
| line-height: 1.6; | |
| overflow-x: hidden; | |
| } | |
| a { text-decoration: none; color: inherit; } | |
| ul { list-style: none; } | |
| /* --- Navigation --- */ | |
| header { | |
| position: sticky; | |
| top: 0; | |
| z-index: 1000; | |
| background: rgba(10, 10, 15, 0.85); | |
| backdrop-filter: blur(12px); | |
| border-bottom: 1px solid var(--border-color); | |
| padding: 1rem 4%; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| font-size: 1.75rem; | |
| font-weight: 800; | |
| letter-spacing: -0.5px; | |
| background: var(--gradient-text); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| } | |
| .nav-left, .nav-right { display: flex; align-items: center; gap: 20px; } | |
| .search-container { | |
| position: relative; | |
| width: 300px; | |
| transition: width 0.3s ease; | |
| } | |
| .search-container.active { width: 400px; } | |
| .search-input { | |
| width: 100%; | |
| background: var(--bg-card); | |
| border: 1px solid var(--border-color); | |
| padding: 10px 40px 10px 15px; | |
| border-radius: 8px; | |
| color: white; | |
| font-size: 0.95rem; | |
| transition: all 0.3s; | |
| } | |
| .search-input:focus { | |
| border-color: var(--primary); | |
| box-shadow: 0 0 0 2px var(--primary-glow); | |
| outline: none; | |
| } | |
| .search-icon { | |
| position: absolute; | |
| right: 15px; | |
| top: 50%; | |
| transform: translateY(-50%); | |
| color: var(--text-secondary); | |
| cursor: pointer; | |
| } | |
| .nav-btn { | |
| background: var(--bg-card); | |
| border: 1px solid var(--border-color); | |
| color: var(--text-main); | |
| padding: 8px 16px; | |
| border-radius: 8px; | |
| font-size: 0.9rem; | |
| cursor: pointer; | |
| transition: all 0.2s; | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| } | |
| .nav-btn:hover { background: var(--bg-hover); border-color: var(--primary); } | |
| .btn-primary { background: var(--primary); border-color: var(--primary); color: white; } | |
| .btn-primary:hover { background: #4f46e5; box-shadow: 0 0 15px var(--primary-glow); } | |
| /* --- Hero Section --- */ | |
| .hero { | |
| position: relative; | |
| height: 70vh; | |
| display: flex; | |
| align-items: center; | |
| overflow: hidden; | |
| } | |
| .hero-bg { | |
| position: absolute; | |
| top: 0; left: 0; width: 100%; height: 100%; | |
| object-fit: cover; | |
| filter: brightness(0.4); | |
| z-index: 1; | |
| } | |
| .hero-overlay { | |
| position: absolute; | |
| top: 0; left: 0; width: 100%; height: 100%; | |
| background: linear-gradient(to top, var(--bg-dark) 10%, transparent 40%), | |
| linear-gradient(to right, rgba(99, 102, 241, 0.2), transparent); | |
| z-index: 2; | |
| } | |
| .hero-content { | |
| position: relative; | |
| z-index: 3; | |
| max-width: 600px; | |
| padding: 0 4%; | |
| animation: fadeInUp 1s ease; | |
| } | |
| .badge { | |
| display: inline-block; | |
| background: rgba(255,255,255,0.15); | |
| padding: 4px 12px; | |
| border-radius: 20px; | |
| font-size: 0.75rem; | |
| font-weight: 600; | |
| text-transform: uppercase; | |
| letter-spacing: 1px; | |
| margin-bottom: 15px; | |
| border: 1px solid rgba(255,255,255,0.2); | |
| } | |
| .hero h1 { | |
| font-size: 4rem; | |
| line-height: 1.1; | |
| font-weight: 800; | |
| margin-bottom: 20px; | |
| letter-spacing: -1px; | |
| } | |
| .hero p { | |
| font-size: 1.25rem; | |
| color: var(--text-secondary); | |
| margin-bottom: 30px; | |
| max-width: 90%; | |
| } | |
| .hero-actions { display: flex; gap: 15px; } | |
| .btn-play { | |
| background: white; color: black; padding: 15px 35px; | |
| border-radius: 50px; font-weight: 700; display: flex; align-items: center; gap: 10px; | |
| transition: transform 0.2s; | |
| } | |
| .btn-play:hover { transform: scale(1.05); } | |
| .btn-info { | |
| background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); | |
| padding: 15px 35px; border-radius: 50px; font-weight: 600; backdrop-filter: blur(5px); | |
| } | |
| /* --- Main Layout --- */ | |
| main { padding: 2rem 4%; max-width: 1600px; margin: 0 auto; } | |
| .section-header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| margin-bottom: 1.5rem; | |
| } | |
| .section-title { | |
| font-size: 1.5rem; | |
| font-weight: 700; | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| } | |
| .section-title span { color: var(--primary); } | |
| /* --- Categories --- */ | |
| .category-scroll { | |
| display: flex; | |
| gap: 10px; | |
| margin-bottom: 2rem; | |
| overflow-x: auto; | |
| padding-bottom: 10px; | |
| scrollbar-width: none; | |
| } | |
| .category-scroll::-webkit-scrollbar { display: none; } | |
| .category-chip { | |
| background: var(--bg-card); | |
| padding: 8px 20px; | |
| border-radius: 20px; | |
| font-size: 0.9rem; | |
| white-space: nowrap; | |
| cursor: pointer; | |
| transition: all 0.2s; | |
| border: 1px solid var(--border-color); | |
| color: var(--text-secondary); | |
| } | |
| .category-chip.active, .category-chip:hover { | |
| background: var(--primary); color: white; border-color: var(--primary); | |
| } | |
| /* --- Video Grid (Modern) --- */ | |
| .video-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | |
| gap: 2rem; | |
| } | |
| .video-card { | |
| background: var(--bg-card); | |
| border-radius: 16px; | |
| overflow: hidden; | |
| transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); | |
| cursor: pointer; | |
| position: relative; | |
| group: "card"; | |
| } | |
| .video-card:hover { | |
| transform: translateY(-8px); | |
| box-shadow: 0 20px 40px rgba(0,0,0,0.5); | |
| border: 1px solid var(--primary-glow); | |
| } | |
| .thumb-container { | |
| position: relative; | |
| width: 100%; | |
| aspect-ratio: 16/9; | |
| overflow: hidden; | |
| } | |
| .thumb-container img { | |
| width: 100%; | |
| height: 100%; | |
| object-fit: cover; | |
| transition: transform 0.5s ease; | |
| } | |
| .video-card:hover .thumb-container img { transform: scale(1.1); } | |
| .play-overlay { | |
| position: absolute; top: 0; left: 0; width: 100%; height: 100%; | |
| background: rgba(0,0,0,0.4); display: flex; justify-content: center; align-items: center; | |
| opacity: 0; transition: opacity 0.3s; | |
| } | |
| .video-card:hover .play-overlay { opacity: 1; } | |
| .play-icon-large { | |
| width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: white; | |
| display: flex; justify-content: center; align-items: center; font-size: 1.5rem; | |
| box-shadow: 0 0 20px var(--primary-glow); transform: scale(0.8); transition: transform 0.3s; | |
| } | |
| .video-card:hover .play-icon-large { transform: scale(1); } | |
| .duration { | |
| position: absolute; bottom: 10px; right: 10px; | |
| background: rgba(0,0,0,0.8); padding: 4px 8px; border-radius: 4px; | |
| font-size: 0.8rem; font-weight: 700; backdrop-filter: blur(2px); | |
| } | |
| .video-info { | |
| padding: 16px; | |
| display: flex; gap: 12px; | |
| } | |
| .channel-avatar { | |
| width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; | |
| } | |
| .info-text { display: flex; flex-direction: column; gap: 4px; } | |
| .video-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); line-height: 1.4; } | |
| .video-meta { font-size: 0.85rem; color: var(--text-secondary); } | |
| .channel-name { color: var(--text-secondary); font-weight: 500; } | |
| .action-btn { | |
| margin-left: auto; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; | |
| } | |
| .action-btn:hover { color: var(--accent); } | |
| /* --- Continue Watching (Horizontal) --- */ | |
| .continue-watching { | |
| margin-bottom: 3rem; | |
| } | |
| .cw-list { | |
| display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; | |
| scrollbar-width: thin; | |
| } | |
| .cw-card { | |
| min-width: 300px; background: var(--bg-card); border-radius: 12px; overflow: hidden; | |
| transition: transform 0.3s; flex-shrink: 0; cursor: pointer; | |
| } | |
| .cw-card:hover { transform: scale(1.02); } | |
| .cw-thumb { width: 100%; height: 170px; object-fit: cover; } | |
| .cw-content { padding: 12px; } | |
| .cw-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } | |
| .cw-subtitle { font-size: 0.8rem; color: var(--text-secondary); display: flex; gap: 8px; } | |
| .progress-bar { height: 4px; background: #333; margin-top: 10px; border-radius: 2px; overflow: hidden; } | |
| .progress-fill { height: 100%; background: var(--primary); width: 65%; } | |
| /* --- Footer --- */ | |
| footer { | |
| background: #050508; padding: 3rem 4%; border-top: 1px solid var(--border-color); margin-top: 4rem; | |
| } | |
| .footer-grid { | |
| display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; max-width: 1400px; margin: 0 auto; | |
| } | |
| .footer-col h4 { color: white; margin-bottom: 1.5rem; font-size: 1rem; } | |
| .footer-col ul li { margin-bottom: 10px; color: var(--text-secondary); font-size: 0.9rem; } | |
| .footer-col ul li:hover { color: var(--primary); cursor: pointer; } | |
| .footer-bottom { text-align: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #1a1a1a; color: #666; font-size: 0.9rem; } | |
| /* --- Modal (Player) --- */ | |
| .modal { | |
| display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; | |
| background: rgba(0,0,0,0.9); align-items: center; justify-content: center; backdrop-filter: blur(5px); | |
| } | |
| .modal-content { | |
| background: var(--bg-dark); width: 80%; max-width: 1000px; border-radius: 20px; overflow: hidden; | |
| box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); animation: popIn 0.3s ease; | |
| display: flex; flex-direction: column; | |
| } | |
| .close-modal { | |
| position: absolute; top: 20px; right: 30px; color: white; font-size: 2rem; cursor: pointer; z-index: 10; | |
| background: rgba(0,0,0,0.5); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; | |
| } | |
| .player-container { width: 100%; position: relative; padding-bottom: 56.25%; background: black; } | |
| .player-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } | |
| .video-details-modal { padding: 2rem; } | |
| .video-details-modal h2 { font-size: 2rem; margin-bottom: 1rem; } | |
| .vd-meta { display: flex; gap: 20px; color: var(--text-secondary); margin-bottom: 20px; font-size: 0.9rem; } | |
| .vd-actions { display: flex; gap: 15px; margin-top: 20px; } | |
| .vd-btn { padding: 10px 20px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-card); color: white; cursor: pointer; display: flex; align-items: center; gap: 8px; } | |
| .vd-btn:hover { background: var(--primary); border-color: var(--primary); } | |
| /* --- Responsive --- */ | |
| @media (max-width: 1024px) { | |
| .footer-grid { grid-template-columns: 1fr 1fr; } | |
| .hero h1 { font-size: 3rem; } | |
| } | |
| @media (max-width: 768px) { | |
| .nav-right { gap: 10px; } | |
| .nav-btn span { display: none; } | |
| .search-container { width: 40px; } | |
| .search-container.active { width: 200px; } | |
| .hero h1 { font-size: 2.5rem; } | |
| .hero-actions { flex-direction: column; width: 100%; } | |
| .hero-actions button { width: 100%; justify-content: center; } | |
| .footer-grid { grid-template-columns: 1fr; } | |
| .video-grid { grid-template-columns: 1fr; } | |
| } | |
| @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } | |
| @keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } } | |
| .anycoder-link { | |
| margin-top: 10px; | |
| display: inline-block; | |
| font-size: 0.8rem; | |
| color: var(--text-secondary); | |
| text-decoration: none; | |
| } | |
| .anycoder-link:hover { color: var(--primary); } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- Navigation --> | |
| <header> | |
| <div class="nav-left"> | |
| <div class="logo"> | |
| <i class="fa-solid fa-play"></i> VStream | |
| </div> | |
| <nav style="display: flex; gap: 20px; margin-left: 20px; display: none; /* Hidden on small screens */"> | |
| <a href="#" style="color: white; font-weight: 500;">Home</a> | |
| <a href="#" style="color: var(--text-secondary);">Movies</a> | |
| <a href="#" style="color: var(--text-secondary);">TV Shows</a> | |
| <a href="#" style="color: var(--text-secondary);">Live Sports</a> | |
| </nav> | |
| </div> | |
| <div class="search-container" id="searchContainer"> | |
| <input type="text" class="search-input" id="searchInput" placeholder="Search movies, series, creators..."> | |
| <i class="fa-solid fa-search search-icon" onclick="toggleSearch()"></i> | |
| </div> | |
| <div class="nav-right"> | |
| <button class="nav-btn" onclick="toggleSearch()"><i class="fa-solid fa-magnifying-glass"></i> <span>Search</span></button> | |
| <button class="nav-btn"><i class="fa-solid fa-bell"></i> <span>Alerts</span></button> | |
| <button class="nav-btn"><i class="fa-solid fa-circle-user"></i> <span>Profile</span></button> | |
| <button class="btn-primary"><i class="fa-solid fa-plus"></i> <span>Upload</span></button> | |
| </div> | |
| </header> | |
| <!-- Hero Section --> | |
| <section class="hero"> | |
| <img src="https://picsum.photos/id/1048/1920/1080" alt="Hero Background" class="hero-bg"> | |
| <div class="hero-overlay"></div> | |
| <div class="hero-content"> | |
| <span class="badge" style="background: var(--primary); border-color: var(--primary);">Featured Premiere</span> | |
| <h1>Cyber Horizons: The Next Epoch</h1> | |
| <p>Experience the cutting edge of digital storytelling in this breathtaking sci-fi epic. Navigate a dystopian future where technology and humanity collide.</p> | |
| <div class="hero-actions"> | |
| <button class="btn-play" onclick="openModal('https://www.w3schools.com/html/mov_bbb.mp4')"> | |
| <i class="fa-solid fa-play"></i> Watch Trailer | |
| </button> | |
| <button class="btn-info" onclick="openModal('https://www.w3schools.com/html/movie.mp4')"> | |
| <i class="fa-solid fa-circle-info"></i> More Info | |
| </button> | |
| </div> | |
| </div> | |
| </section> | |
| <main> | |
| <!-- Categories --> | |
| <div class="category-scroll"> | |
| <div class="category-chip active" onclick="filterCategory(this)">All Content</div> | |
| <div class="category-chip" onclick="filterCategory(this)">Action & Adventure</div> | |
| <div class="category-chip" onclick="filterCategory(this)">Sci-Fi</div> | |
| <div class="category-chip" onclick="filterCategory(this)">Documentary</div> | |
| <div class="category-chip" onclick="filterCategory(this)">Comedy</div> | |
| <div class="category-chip" onclick="filterCategory(this)">Thriller</div> | |
| <div class="category-chip" onclick="filterCategory(this)">Indie Films</div> | |
| </div> | |
| <!-- Continue Watching --> | |
| <div class="continue-watching"> | |
| <div class="section-header"> | |
| <h2 class="section-title"><i class="fa-solid fa-circle-play"></i> Continue Watching</h2> | |
| <a href="#" style="color: var(--primary); font-size: 0.9rem;">See all</a> | |
| </div> | |
| <div class="cw-list"> | |
| <div class="cw-card" onclick="openModal('https://www.w3schools.com/html/mov_bbb.mp4')"> | |
| <img src="https://picsum.photos/id/1015/400/225" class="cw-thumb" alt="Continued"> | |
| <div class="cw-content"> | |
| <div class="cw-title">Amazing Nature: 4K Landscape</div> | |
| <div class="cw-subtitle"> | |
| <span>Earth Scapes</span> • <span>20 min left</span> | |
| </div> | |
| <div class="progress-bar"><div class="progress-fill"></div></div> | |
| </div> | |
| </div> | |
| <div class="cw-card" onclick="openModal('https://www.w3schools.com/html/movie.mp4')"> | |
| <img src="https://picsum.photos/id/1039/400/225" class="cw-thumb" alt="Continued"> | |
| <div class="cw-content"> | |
| <div class="cw-title">JavaScript Crash Course 2024</div> | |
| <div class="cw-subtitle"> | |
| <span>Code Master</span> • <span>5 min left</span> | |
| </div> | |
| <div class="progress-bar"><div class="progress-fill" style="width: 85%"></div></div> | |
| </div> | |
| </div> | |
| <div class="cw-card" onclick="openModal('https://www.w3schools.com/html/mov_bbb.mp4')"> | |
| <img src="https://picsum.photos/id/1069/400/225" class="cw-thumb" alt="Continued"> | |
| <div class="cw-content"> | |
| <div class="cw-title">Ultimate Home Workout</div> | |
| <div class="cw-subtitle"> | |
| <span>Fitness Pro</span> • <span>45 min left</span> | |
| </div> | |
| <div class="progress-bar"><div class="progress-fill" style="width: 30%"></div></div> | |
| </div> | |
| </div> | |
| <div class="cw-card" onclick="openModal('https://www.w3schools.com/html/movie.mp4')"> | |
| <img src="https://picsum.photos/id/1064/400/225" class="cw-thumb" alt="Continued"> | |
| <div class="cw-content"> | |
| <div class="cw-title">Hidden Gems of Japan</div> | |
| <div class="cw-subtitle"> | |
| <span>Wanderlust</span> • <span>12 min left</span> | |
| </div> | |
| <div class="progress-bar"><div class="progress-fill" style="width: 60%"></div></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Trending Grid --> | |
| <div class="section-header"> | |
| <h2 class="section-title"><i class="fa-solid fa-fire"></i> <span>Trending Now</span></h2> | |
| </div> | |
| <div class="video-grid" id="videoGrid"> | |
| <!-- Grid generated by JS --> | |
| </div> | |
| <div style="margin-top: 3rem;" class="section-header"> | |
| <h2 class="section-title"><i class="fa-solid fa-newspaper"></i> <span>Latest Releases</span></h2> | |
| </div> | |
| <div class="video-grid" id="newReleasesGrid"> | |
| <!-- Grid generated by JS --> | |
| </div> | |
| </main> | |
| <footer> | |
| <div class="footer-grid"> | |
| <div class="footer-col"> | |
| <div class="logo" style="margin-bottom: 20px; color: white;">VStream</div> | |
| <p style="color: var(--text-secondary); max-width: 300px;">The premier destination for high-definition streaming. Watch your favorite movies, TV shows, and exclusive content anytime, anywhere.</p> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" class="anycoder-link" target="_blank">Built with anycoder</a> | |
| </div> | |
| <div class="footer-col"> | |
| <h4>Navigation</h4> | |
| <ul> | |
| <li>Home</li> | |
| <li>Movies</li> | |
| <li>TV Shows</li> | |
| <li>Live Sports</li> | |
| </ul> | |
| </div> | |
| <div class="footer-col"> | |
| <h4>Support</h4> | |
| <ul> | |
| <li>Help Center</li> | |
| <li>Terms of Service</li> | |
| <li>Privacy Policy</li> | |
| <li>Contact Us</li> | |
| </ul> | |
| </div> | |
| <div class="footer-col"> | |
| <h4>Connect</h4> | |
| <ul> | |
| <li>Twitter</li> | |
| <li>Facebook</li> | |
| <li>Instagram</li> | |
| <li>YouTube</li> | |
| </ul> | |
| </div> | |
| </div> | |
| <div class="footer-bottom"> | |
| © 2024 VStream Inc. All rights reserved. | |
| </div> | |
| </footer> | |
| <!-- Video Player Modal --> | |
| <div id="videoModal" class="modal" onclick="closeModal(event)"> | |
| <span class="close-modal" onclick="closeModal(event)">×</span> | |
| <div class="modal-content"> | |
| <div class="player-container"> | |
| <iframe id="playerFrame" src="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | |
| </div> | |
| <div class="video-details-modal"> | |
| <h2 id="modalTitle">Video Title</h2> | |
| <div class="vd-meta"> | |
| <span id="modalViews">1.2M views</span> | |
| <span id="modalDate">2 days ago</span> | |
| <span id="modalDuration">10:05</span> | |
| </div> | |
| <p style="color: var(--text-secondary); margin-bottom: 20px;"> | |
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris. | |
| </p> | |
| <div class="vd-actions"> | |
| <button class="vd-btn" onclick="toggleLike(this)"><i class="fa-regular fa-thumbs-up"></i> Like</button> | |
| <button class="vd-btn"><i class="fa-regular fa-share-from-square"></i> Share</button> | |
| <button class="vd-btn"><i class="fa-solid fa-list-plus"></i> Add to List</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Mock Data | |
| const videos = [ | |
| { title: "Amazing Nature: 4K Landscape Collection", channel: "Earth Scapes", views: "1.2M views", time: "2 days ago", duration: "10:05", img: "https://picsum.photos/id/1015/400/225" }, | |
| { title: "Top 10 Tech Gadgets You Need in 2024", channel: "Tech Insider", views: "850K views", time: "1 week ago", duration: "14:20", img: "https://picsum.photos/id/1048/400/225" }, | |
| { title: "Learn JavaScript in 30 Minutes - Crash Course", channel: "Code Master", views: "2.4M views", time: "3 months ago", duration: "30:00", img: "https://picsum.photos/id/1039/400/225" }, | |
| { title: "Ultimate Home Workout - No Equipment", channel: "Fitness Pro", views: "500K views", time: "5 days ago", duration: "22:15", img: "https://picsum.photos/id/1069/400/225" }, | |
| { title: "Travel Guide: Hidden Gems of Japan", channel: "Wanderlust", views: "3.1M views", time: "1 year ago", duration: "18:45", img: "https://picsum.photos/id/1064/400/225" }, | |
| { title: "Cinematic Lo-Fi Beats to Study/Relax", channel: "Chill Hop", views: "10M views", time: "Live", duration: "LIVE", img: "https://picsum.photos/id/103/400/225" }, | |
| { title: "Advanced CSS Grid Layouts Tutorial", channel: "Web Dev Simplified", views: "150K views", time: "2 weeks ago", duration: "45:30", img: "https://picsum.photos/id/1011/400/225" }, | |
| { title: "Best Street Food in Thailand", channel: "Foodie Adventures", views: "900K views", time: "3 weeks ago", duration: "12:10", img: "https://picsum.photos/id/1059/400/225" }, | |
| { title: "Sci-Fi Movie Review: The New Frontier", channel: "Cinema Review", views: "450K views", time: "1 day ago", duration: "15:00", img: "https://picsum.photos/id/1033/400/225" }, | |
| { title: "Deep Sea Exploration: The Unknown", channel: "Ocean Blue", views: "2.1M views", time: "4 months ago", duration: "42:10", img: "https://picsum.photos/id/1028/400/225" }, | |
| { title: "Minimalist Desk Setup 2024", channel: "Tech Setup", views: "600K views", time: "2 weeks ago", duration: "08:30", img: "https://picsum.photos/id/1035/400/225" }, | |
| { title: "Mastering the Art of Photography", channel: "Visual Arts", views: "1.8M views", time: "6 months ago", duration: "25:00", img: "https://picsum.photos/id/1040/400/225" } | |
| ]; | |
| // Generate HTML for video cards | |
| function generateVideoCards(videoData, containerId) { | |
| const container = document.getElementById(containerId); | |
| let htmlContent = ''; | |
| videoData.forEach(video => { | |
| htmlContent += ` | |
| <div class="video-card" onclick="openModal('https://www.w3schools.com/html/mov_bbb.mp4')"> | |
| <div class="thumb-container"> | |
| <img src="${video.img}" alt="${video.title}"> | |
| <div class="play-overlay"> | |
| <div class="play-icon-large"><i class="fa-solid fa-play"></i></div> | |
| </div> | |
| <div class="duration">${video.duration}</div> | |
| </div> | |
| <div class="video-info"> | |
| <img src="https://picsum.photos/id/237/50/50" class="channel-avatar" alt="Avatar"> | |
| <div class="info-text"> | |
| <h3 class="video-title">${video.title}</h3> | |
| <div class="channel-name">${video.channel}</div> | |
| <div class="video-meta">${video.views} • ${video.time}</div> | |
| </div> | |
| <div class="action-btn" onclick="event.stopPropagation(); toggleLike(this)"> | |
| <i class="fa-regular fa-heart"></i> | |
| </div> | |
| </div> | |
| </div>`; | |
| }); | |
| container.innerHTML = htmlContent; | |
| } | |
| // Initialize the app | |
| document.addEventListener('DOMContentLoaded', () => { | |
| generateVideoCards(videos, 'videoGrid'); | |
| generateVideoCards(videos.slice(0, 6), 'newReleasesGrid'); | |
| }); | |
| // Interactive Functions | |
| function toggleSearch() { | |
| const container = document.getElementById('searchContainer'); | |
| container.classList.toggle('active'); | |
| if(container.classList.contains('active')) { | |
| document.getElementById('searchInput').focus(); | |
| } | |
| } | |
| function filterCategory(element) { | |
| document.querySelectorAll('.category-chip').forEach(chip => chip.classList.remove('active')); | |
| element.classList.add('active'); | |
| // In a real app, this would filter the API results | |
| console.log(`Filtering by: ${element.innerText}`); | |
| } | |
| function toggleLike(btn) { | |
| const icon = btn.querySelector('i'); | |
| if (icon.classList.contains('fa-heart')) { | |
| icon.classList.remove('fa-regular', 'fa-heart'); | |
| icon.classList.add('fa-solid', 'fa-heart'); | |
| icon.style.color = '#ec4899'; | |
| } else { | |
| icon.classList.remove('fa-solid', 'fa-heart'); | |
| icon.classList.add('fa-regular', 'fa-heart'); | |
| icon.style.color = 'inherit'; | |
| } | |
| } | |
| // Modal Logic | |
| const modal = document.getElementById('videoModal'); | |
| const playerFrame = document.getElementById('playerFrame'); | |
| const modalTitle = document.getElementById('modalTitle'); | |
| function openModal(videoUrl) { | |
| modal.style.display = 'flex'; | |
| // Using a generic video source for demonstration since external iframe sources might block embedding | |
| playerFrame.src = videoUrl; | |
| // Simulate dynamic title based on context (simplified) | |
| modalTitle.innerText = "Now Playing: " + (document.title.includes("VStream") ? "Premium Content" : "Featured Video"); | |
| } | |
| function closeModal(event) { | |
| if (event.target === modal || event.target.classList.contains('close-modal')) { | |
| modal.style.display = 'none'; | |
| playerFrame.src = ""; // Stop video playback | |
| } | |
| } | |
| // Add simple hover effect for buttons | |
| document.querySelectorAll('.nav-btn').forEach(btn => { | |
| btn.addEventListener('mouseenter', function() { | |
| this.style.transform = 'translateY(-2px)'; | |
| }); | |
| btn.addEventListener('mouseleave', function() { | |
| this.style.transform = 'translateY(0)'; | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |