index.html
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <title>Redirecting...</title> 7 <script> 8 // Get the current URL 9 const currentUrl = new URL(window.location.href); 10 11 // Set a flag in localStorage to indicate we're in livestream mode 12 localStorage.setItem('daokotube_livestream_mode', 'true'); 13 14 // Get the date parameter if it exists 15 const urlParams = new URLSearchParams(currentUrl.search); 16 const dateParam = urlParams.get('v'); 17 18 // If we have a date parameter, store it for later use 19 if (dateParam && /^\d{8}$/.test(dateParam)) { 20 localStorage.setItem('daokotube_livestream_date', dateParam); 21 console.info(`Livestream date parameter detected: ${dateParam}`); 22 } else { 23 // If no specific date requested, we'll select a random entry later 24 localStorage.setItem('daokotube_livestream_random', 'true'); 25 console.info('No specific livestream requested, will select random entry'); 26 } 27 28 // Replace /live/ with /app/ in the path 29 const newPath = currentUrl.pathname.replace(/^\/live(\/|$)/, '/app$1'); 30 31 // Create the new URL with the updated path while preserving query parameters 32 currentUrl.pathname = newPath; 33 34 // Log the redirection for debugging 35 console.info(`Redirecting from ${window.location.pathname} to ${newPath} (with query params: ${currentUrl.search})`); 36 37 // Redirect to the new URL 38 window.location.href = currentUrl.toString(); 39 </script> 40 <style> 41 :root { 42 --cursor-butterfly: url('https://img.icons8.com/neon/24/butterfly.png') 12 12, auto; 43 } 44 body { 45 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 46 background-color: #f9f9f9; 47 color: #333; 48 text-align: center; 49 padding: 50px 20px; 50 margin: 0; 51 line-height: 1.6; 52 cursor: var(--cursor-butterfly); 53 } 54 .container { 55 max-width: 600px; 56 margin: 0 auto; 57 background-color: white; 58 padding: 30px; 59 border-radius: 8px; 60 box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 61 } 62 h1 { 63 margin-top: 0; 64 color: #333; 65 } 66 p { 67 margin-bottom: 20px; 68 } 69 .loader { 70 display: inline-block; 71 width: 50px; 72 height: 50px; 73 border: 3px solid rgba(0, 0, 0, 0.1); 74 border-radius: 50%; 75 border-top-color: #3498db; 76 animation: spin 1s ease-in-out infinite; 77 margin-bottom: 20px; 78 } 79 @keyframes spin { 80 to { transform: rotate(360deg); } 81 } 82 .link { 83 color: #3498db; 84 text-decoration: none; 85 cursor: var(--cursor-butterfly); 86 } 87 .link:hover { 88 text-decoration: underline; 89 } 90 </style> 91 92 </head> 93 <body> 94 <div class="container"> 95 <div class="loader"></div> 96 <h1>Redirecting...</h1> 97 <p>If you are not redirected automatically, please <a class="link" href="../app/">click here</a>.</p> 98 <p><small>Note: This page preserves query parameters when redirecting.</small></p> 99 </div> 100 </body> 101 </html>