Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Offline - Zenith Fraud Detection</title> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| min-height: 100vh; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| padding: 20px; | |
| } | |
| .container { | |
| background: white; | |
| border-radius: 16px; | |
| padding: 48px; | |
| max-width: 500px; | |
| text-align: center; | |
| box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); | |
| } | |
| .icon { | |
| width: 80px; | |
| height: 80px; | |
| margin: 0 auto 24px; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| border-radius: 50%; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-size: 40px; | |
| } | |
| h1 { | |
| font-size: 28px; | |
| color: #1a202c; | |
| margin-bottom: 16px; | |
| font-weight: 700; | |
| } | |
| p { | |
| font-size: 16px; | |
| color: #4a5568; | |
| line-height: 1.6; | |
| margin-bottom: 24px; | |
| } | |
| .retry-button { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| color: white; | |
| border: none; | |
| padding: 14px 32px; | |
| border-radius: 8px; | |
| font-size: 16px; | |
| font-weight: 600; | |
| cursor: pointer; | |
| transition: transform 0.2s, box-shadow 0.2s; | |
| } | |
| .retry-button:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4); | |
| } | |
| .retry-button:active { | |
| transform: translateY(0); | |
| } | |
| .status { | |
| margin-top: 24px; | |
| padding: 12px; | |
| background: #f7fafc; | |
| border-radius: 8px; | |
| font-size: 14px; | |
| color: #718096; | |
| } | |
| .spinner { | |
| display: inline-block; | |
| width: 16px; | |
| height: 16px; | |
| border: 2px solid #e2e8f0; | |
| border-top-color: #667eea; | |
| border-radius: 50%; | |
| animation: spin 1s linear infinite; | |
| margin-right: 8px; | |
| vertical-align: middle; | |
| } | |
| @keyframes spin { | |
| to { transform: rotate(360deg); } | |
| } | |
| .hidden { | |
| display: none; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <div class="icon">📡</div> | |
| <h1>You're Offline</h1> | |
| <p> | |
| It looks like you've lost your internet connection. | |
| Zenith requires an active connection to access fraud detection services. | |
| </p> | |
| <p> | |
| Don't worry - your work is saved locally and will sync when you're back online. | |
| </p> | |
| <button class="retry-button" onclick="retryConnection()"> | |
| Retry Connection | |
| </button> | |
| <div class="status hidden" id="status"> | |
| <span class="spinner"></span> | |
| <span id="statusText">Checking connection...</span> | |
| </div> | |
| </div> | |
| <script> | |
| function retryConnection() { | |
| const status = document.getElementById('status'); | |
| const statusText = document.getElementById('statusText'); | |
| status.classList.remove('hidden'); | |
| statusText.textContent = 'Checking connection...'; | |
| fetch('/api/v1/health', { method: 'HEAD' }) | |
| .then(() => { | |
| statusText.textContent = 'Connection restored! Redirecting...'; | |
| setTimeout(() => { | |
| window.location.href = '/'; | |
| }, 1000); | |
| }) | |
| .catch(() => { | |
| statusText.textContent = 'Still offline. Please try again.'; | |
| setTimeout(() => { | |
| status.classList.add('hidden'); | |
| }, 3000); | |
| }); | |
| } | |
| // Auto-retry every 30 seconds | |
| setInterval(() => { | |
| fetch('/api/v1/health', { method: 'HEAD' }) | |
| .then(() => { | |
| window.location.href = '/'; | |
| }) | |
| .catch(() => { | |
| console.log('Still offline...'); | |
| }); | |
| }, 30000); | |
| </script> | |
| </body> | |
| </html> | |