Spaces:
Running
Running
`; } } customElements.define('custom-navbar', CustomNavbar); `; const playButton = this.shadowRoot.getElementById('play-button'); playButton.addEventListener('click', () => { const videoPlayer = document.querySelector('custom-video-player'); if (videoPlayer) { videoPlayer.playVideo(videoUrl); } }); } } customElements.define('custom-video-card', CustomVideoCard); `; const modal = this.shadowRoot.querySelector('.video-player-modal'); const videoElement = this.shadowRoot.getElementById('video-element'); const closeButton = this.shadowRoot.getElementById('close-player'); closeButton.addEventListener('click', () => { modal.classList.remove('active'); videoElement.pause(); videoElement.currentTime = 0; }); // Expose playVideo method to be called from outside this.playVideo = (videoUrl) => { videoElement.src = videoUrl; modal.classList.add('active'); videoElement.play(); }; } } customElements.define('custom-video-player', CustomVideoPlayer);
63462ac
verified
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Video Vortex Showcase</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/video-player.js"></script> | |
| <script src="components/video-card.js"></script> | |
| <script src="components/search-bar.js"></script> | |
| </head> | |
| <body class="bg-gray-100"> | |
| <custom-navbar></custom-navbar> | |
| <main class="container mx-auto px-4 py-8"> | |
| <h1 class="text-3xl font-bold mb-4 text-center">Video Vortex Showcase</h1> | |
| <search-bar></search-bar> | |
| <div id="video-grid" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"> | |
| <!-- Video cards will be inserted here by JavaScript --> | |
| </div> | |
| <div id="loading-spinner" class="flex justify-center my-8 hidden"> | |
| <div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-purple-500"></div> | |
| </div> | |
| </main> | |
| <custom-video-player></custom-video-player> | |
| <script src="script.js"></script> | |
| <script> | |
| feather.replace(); | |
| </script> | |
| <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script> | |
| </body> | |
| </html> |