window.addEventListener('DOMContentLoaded', () => { const video = document.querySelector('.hero-content video.video-player'); if (!video) return; const overlay = document.createElement('div'); overlay.id = 'video-click-overlay'; overlay.style.position = 'absolute'; overlay.style.zIndex = 0; overlay.style.cursor = 'pointer'; overlay.style.background = 'rgba(0,0,0,0)'; document.body.appendChild(overlay); function positionOverlay() { const rect = video.getBoundingClientRect(); overlay.style.top = `${rect.top + window.scrollY}px`; overlay.style.left = `${rect.left + window.scrollX}px`; overlay.style.width = `${rect.width}px`; overlay.style.height = `${rect.height}px`; } positionOverlay(); window.addEventListener('resize', positionOverlay); window.addEventListener('scroll', positionOverlay); overlay.addEventListener('click', () => { const videoSrc = video.currentSrc || video.src; if (!videoSrc) return alert('Video source not found.'); const newTab = window.open('', '_blank'); if (newTab) { newTab.document.write(` Fullscreen Video html, body { margin: 0; padding: 0; background: black; height: 100%; } video { width: 100%; height: 100%; object-fit: contain; } const vid = document.getElementById('fsVideo'); vid.addEventListener('loadedmetadata', () => { if (vid.requestFullscreen) vid.requestFullscreen(); else if (vid.webkitRequestFullscreen) vid.webkitRequestFullscreen(); else if (vid.mozRequestFullScreen) vid.mozRequestFullScreen(); else if (vid.msRequestFullscreen) vid.msRequestFullscreen(); }); `); newTab.document.close(); } }); });