Video Grid - Continuous Loop with Play Icon /* Reset & Base Styles */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; background: linear-gradient(45deg, #ff9a9e, #fecfef, #fecfef, #fecfef); background-size: 400% 400%; animation: rainbow-background 15s ease infinite; padding: 20px 0; min-height: 100vh; overflow-x: auto; position: relative; } /* Animated Rainbow Background */ body::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(45deg, rgba(255, 0, 150, 0.1), rgba(0, 255, 150, 0.1), rgba(150, 0, 255, 0.1), rgba(255, 150, 0, 0.1), rgba(0, 150, 255, 0.1), rgba(255, 0, 150, 0.1)); background-size: 600% 600%; animation: rainbow-shift 20s ease infinite; z-index: -1; pointer-events: none; } /* Rainbow Particles */ body::after { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: radial-gradient(circle at 20% 80%, rgba(255, 0, 150, 0.3) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(0, 255, 150, 0.3) 0%, transparent 50%), radial-gradient(circle at 40% 40%, rgba(150, 0, 255, 0.3) 0%, transparent 50%), radial-gradient(circle at 60% 60%, rgba(255, 150, 0, 0.3) 0%, transparent 50%), radial-gradient(circle at 10% 10%, rgba(0, 150, 255, 0.3) 0%, transparent 50%); animation: particle-float 25s ease-in-out infinite; z-index: -1; pointer-events: none; } /* Video Grid Layout */ .video-row { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin: 30px auto; max-width: 1200px; padding: 0 10px; } .video-column { position: relative; width: 116px; height: 207px; overflow: hidden; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 100, 200, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1); transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; border: 2px solid transparent; background: linear-gradient(45deg, rgba(255, 0, 150, 0.2), rgba(0, 255, 150, 0.2), rgba(150, 0, 255, 0.2), rgba(255, 150, 0, 0.2)) border-box; background-clip: padding-box; } .video-column:hover { transform: scale(1.08); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 100, 200, 0.6), 0 0 40px rgba(100, 200, 255, 0.4), 0 0 50px rgba(255, 200, 100, 0.3), inset 0 0 30px rgba(255, 255, 255, 0.2); } .video-bg { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; filter: blur(2px); } /* Always-Visible Play Button with Animations */ .play-button { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50px; height: 50px; background: rgba(255, 255, 255, 0.95); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 10; opacity: 1; pointer-events: none; backdrop-filter: blur(4px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 255, 255, 0.8); animation: pulse 2s infinite, glow 3s ease-in-out infinite alternate; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .play-button::before { content: ''; display: inline-block; margin-left: 3px; border-style: solid; border-width: 10px 0 10px 15px; border-color: transparent transparent transparent #333; animation: triangle-pulse 2s infinite; transition: all 0.3s ease; } .play-button::after { content: ''; position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; animation: ripple 2s infinite; } /* Hover effects for video containers */ .video-column:hover .play-button { transform: translate(-50%, -50%) scale(1.15); background: rgba(255, 255, 255, 1); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 255, 255, 0.8), 0 0 0 8px rgba(255, 255, 255, 0.2); animation: pulse 1s infinite, glow 1.5s ease-in-out infinite alternate, hover-bounce 0.6s ease-out; } .video-column:hover .play-button::before { border-color: transparent transparent transparent #000; animation: triangle-pulse 1s infinite, triangle-wiggle 0.8s ease-in-out infinite; } .video-column:active .play-button { transform: translate(-50%, -50%) scale(0.95); animation: click-flash 0.3s ease-out; } /* Keyframe Animations */ @keyframes pulse { 0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 255, 255, 0.8); } 50% { box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4), 0 0 0 8px rgba(255, 255, 255, 0.4); } } @keyframes glow { 0% { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3)); } 100% { filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8)); } } @keyframes ripple { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } } @keyframes triangle-pulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } } @keyframes triangle-wiggle { 0%, 100% { transform: translateX(0) scale(1); } 25% { transform: translateX(-1px) scale(1.05); } 75% { transform: translateX(1px) scale(1.05); } } @keyframes hover-bounce { 0% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.2); } 100% { transform: translate(-50%, -50%) scale(1.15); } } @keyframes click-flash { 0% { background: rgba(255, 255, 255, 1); transform: translate(-50%, -50%) scale(0.95); } 50% { background: rgba(255, 215, 0, 0.9); transform: translate(-50%, -50%) scale(1.05); } 100% { background: rgba(255, 255, 255, 1); transform: translate(-50%, -50%) scale(0.95); } } /* Floating animation for extra appeal */ @keyframes float { 0%, 100% { transform: translate(-50%, -50%) translateY(0px); } 50% { transform: translate(-50%, -50%) translateY(-3px); } } .play-button { animation: pulse 2s infinite, glow 3s ease-in-out infinite alternate, float 4s ease-in-out infinite; } .video-status { display: none; } /* Responsive: Mobile - 3 Columns */ @media (max-width: 768px) { .video-row { gap: 15px; } .video-column { width: calc(33.33% - 10px); height: auto; aspect-ratio: 9/16; min-width: 80px; max-width: 120px; } .play-button { width: 40px; height: 40px; animation: pulse-colorful 2s infinite, rainbow-glow 3s ease-in-out infinite alternate, float 4s ease-in-out infinite, rainbow-bg 4s ease-in-out infinite; } .play-button::before { border-width: 8px 0 8px 12px; margin-left: 2px; } .video-column:hover .play-button { transform: translate(-50%, -50%) scale(1.1); animation: pulse-colorful 1s infinite, rainbow-glow 1.5s ease-in-out infinite alternate, hover-bounce-colorful 0.6s ease-out, rainbow-bg 2s ease-in-out infinite; } } @media (max-width: 480px) { .video-row { gap: 12px; padding: 0 5px; } .video-column { width: calc(33.33% - 8px); min-width: 70px; max-width: 100px; } .play-button { width: 35px; height: 35px; animation: pulse-colorful 2s infinite, rainbow-glow 3s ease-in-out infinite alternate, float 4s ease-in-out infinite, rainbow-bg 4s ease-in-out infinite; } .play-button::before { border-width: 7px 0 7px 10px; margin-left: 2px; } .video-column:hover .play-button { transform: translate(-50%, -50%) scale(1.08); animation: pulse-colorful 1s infinite, rainbow-glow 1.5s ease-in-out infinite alternate, hover-bounce-colorful 0.6s ease-out, rainbow-bg 2s ease-in-out infinite; } } @media (max-width: 360px) { .video-column { width: calc(33.33% - 6px); min-width: 60px; } .play-button { width: 30px; height: 30px; animation: pulse-colorful 2s infinite, rainbow-glow 3s ease-in-out infinite alternate, float 4s ease-in-out infinite, rainbow-bg 4s ease-in-out infinite; } .play-button::before { border-width: 6px 0 6px 9px; margin-left: 2px; } .video-column:hover .play-button { transform: translate(-50%, -50%) scale(1.05); animation: pulse-colorful 1s infinite, rainbow-glow 1.5s ease-in-out infinite alternate, hover-bounce-colorful 0.6s ease-out, rainbow-bg 2s ease-in-out infinite; } } Your browser does not support the video tag. Ready Your browser does not support the video tag. Ready Your browser does not support the video tag. Ready let videosInitialized = false; let playAttempted = false; // Function to start all videos function startAllVideos() { if (playAttempted) return; playAttempted = true; const videos = document.querySelectorAll('video'); const statusElements = document.querySelectorAll('.video-status'); videos.forEach((video, index) => { const status = statusElements[index]; // Ensure video properties are set video.muted = true; video.loop = true; video.playsInline = true; // Try to play const playPromise = video.play(); if (playPromise !== undefined) { playPromise.then(() => { console.log(`Video ${index + 1} started playing`); status.textContent = 'Playing'; status.style.background = 'rgba(0, 150, 0, 0.7)'; }).catch(error => { console.warn(`Video ${index + 1} autoplay failed:`, error); status.textContent = 'Click to play'; status.style.background = 'rgba(150, 0, 0, 0.7)'; }); } }); } // Function to open website in new window function openWebsite() { window.open('https://waeck.net', '_blank'); } // Function to toggle individual video (for manual control) function toggleVideo(container) { const video = container.querySelector('video'); const status = container.querySelector('.video-status'); if (video.paused) { video.play().then(() => { status.textContent = 'Playing'; status.style.background = 'rgba(0, 150, 0, 0.7)'; }).catch(error => { console.error('Failed to play video:', error); status.textContent = 'Error'; status.style.background = 'rgba(150, 0, 0, 0.7)'; }); } else { video.pause(); status.textContent = 'Paused'; status.style.background = 'rgba(150, 150, 0, 0.7)'; } } // Initialize on page load function initializeVideos() { if (videosInitialized) return; videosInitialized = true; // Wait a moment for videos to load metadata setTimeout(() => { startAllVideos(); }, 500); } // Multiple event listeners to handle different scenarios document.addEventListener('DOMContentLoaded', initializeVideos); window.addEventListener('load', initializeVideos); // Handle user interaction to unlock autoplay on mobile function handleUserInteraction() { startAllVideos(); // Remove listeners after first interaction document.removeEventListener('touchstart', handleUserInteraction); document.removeEventListener('click', handleUserInteraction); } document.addEventListener('touchstart', handleUserInteraction, { passive: true }); document.addEventListener('click', handleUserInteraction); // Handle visibility change (when tab becomes visible) document.addEventListener('visibilitychange', () => { if (!document.hidden) { setTimeout(startAllVideos, 100); } }); // Ensure videos keep looping (fallback) setInterval(() => { document.querySelectorAll('video').forEach((video, index) => { if (!video.paused && video.currentTime > 0 && video.ended) { video.currentTime = 0; video.play(); } }); }, 1000); // Handle video events document.querySelectorAll('video').forEach((video, index) => { const status = document.querySelectorAll('.video-status')[index]; video.addEventListener('ended', () => { video.currentTime = 0; video.play(); }); video.addEventListener('error', (e) => { console.error(`Video ${index + 1} error:`, e); status.textContent = 'Error'; status.style.background = 'rgba(150, 0, 0, 0.7)'; }); video.addEventListener('loadstart', () => { status.textContent = 'Loading'; status.style.background = 'rgba(0, 0, 150, 0.7)'; }); video.addEventListener('canplay', () => { if (status.textContent === 'Loading') { status.textContent = 'Ready'; status.style.background = 'rgba(100, 100, 100, 0.7)'; } }); });