Readur/frontend/public/offline.html

169 lines
4.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Offline - Readur</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #fff;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px);
}
.container {
text-align: center;
max-width: 500px;
padding: 40px 20px;
}
.icon {
width: 120px;
height: 120px;
margin: 0 auto 30px;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(10px);
}
.icon svg {
width: 60px;
height: 60px;
stroke: #fff;
stroke-width: 2;
fill: none;
}
h1 {
font-size: 32px;
font-weight: 700;
margin-bottom: 16px;
letter-spacing: -0.5px;
}
p {
font-size: 18px;
line-height: 1.6;
margin-bottom: 32px;
opacity: 0.9;
}
.status {
background: rgba(255, 255, 255, 0.15);
border-radius: 12px;
padding: 16px 24px;
margin-bottom: 32px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
}
.status-text {
font-size: 14px;
opacity: 0.8;
}
.retry-button {
background: #fff;
color: #667eea;
border: none;
border-radius: 12px;
padding: 16px 32px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.retry-button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}
.retry-button:active {
transform: translateY(0);
}
@media (max-width: 480px) {
h1 {
font-size: 28px;
}
p {
font-size: 16px;
}
.icon {
width: 100px;
height: 100px;
}
.icon svg {
width: 50px;
height: 50px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="icon">
<svg viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.288 15.038a5.25 5.25 0 017.424 0M5.106 11.856c3.807-3.808 9.98-3.808 13.788 0M1.924 8.674c5.565-5.565 14.587-5.565 20.152 0M12.53 18.22l-.53.53-.53-.53a.75.75 0 011.06 0z" />
<line x1="2" y1="2" x2="22" y2="22" stroke-linecap="round" />
</svg>
</div>
<h1>You're Offline</h1>
<p>It looks like you've lost your internet connection. Don't worry, Readur will be back once you're online again.</p>
<div class="status">
<p class="status-text" id="status">Checking connection...</p>
</div>
<button class="retry-button" onclick="window.location.reload()">
Try Again
</button>
</div>
<script>
function updateConnectionStatus() {
const statusEl = document.getElementById('status');
if (navigator.onLine) {
statusEl.textContent = 'Connection restored! Click "Try Again" to continue.';
} else {
statusEl.textContent = 'No internet connection detected.';
}
}
// Update status immediately
updateConnectionStatus();
// Listen for online/offline events
window.addEventListener('online', updateConnectionStatus);
window.addEventListener('offline', updateConnectionStatus);
// Auto-reload when connection is restored
window.addEventListener('online', () => {
setTimeout(() => {
window.location.reload();
}, 1000);
});
</script>
</body>
</html>