diff --git a/kjvstudy_org/templates/offline.html b/kjvstudy_org/templates/offline.html index e3661dc..9d99154 100644 --- a/kjvstudy_org/templates/offline.html +++ b/kjvstudy_org/templates/offline.html @@ -230,6 +230,63 @@ color: var(--success-color); font-weight: 600; } + .status-card { + display: flex; + align-items: flex-start; + gap: 1rem; + padding: 1.25rem; + border-radius: 8px; + margin-bottom: 1.5rem; + border: 1px solid var(--border-color); + background: var(--bg-color); + } + .status-card.status-ok { + border-color: var(--success-color); + background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); + } + .status-card.status-error { + border-color: var(--error-color); + background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); + } + .status-card.status-warning { + border-color: #f59e0b; + background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); + } + [data-theme="dark"] .status-card.status-ok { + background: linear-gradient(135deg, #14532d 0%, #166534 100%); + } + [data-theme="dark"] .status-card.status-error { + background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%); + } + [data-theme="dark"] .status-card.status-warning { + background: linear-gradient(135deg, #78350f 0%, #92400e 100%); + } + .status-icon { + font-size: 2rem; + line-height: 1; + } + .status-content { + flex: 1; + } + .status-title { + font-weight: 600; + font-size: 1.1rem; + margin-bottom: 0.25rem; + } + .status-detail { + color: var(--text-secondary); + font-size: 0.9rem; + line-height: 1.5; + } + .status-detail code { + background: rgba(0,0,0,0.1); + padding: 0.1rem 0.3rem; + border-radius: 3px; + font-size: 0.85em; + } + [data-theme="dark"] .status-detail code { + background: rgba(255,255,255,0.1); + } .quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); @@ -279,6 +336,14 @@
KJV Study - Available without internet
+Download the entire site for offline use: all Bible chapters, individual verse pages with commentary, stories, study guides, and resources. The sitemap will be parsed to find all available pages.
@@ -362,6 +427,19 @@ const cachedLinks = document.getElementById('cached-links'); const cachedCount = document.getElementById('cached-count'); + // Status card elements + const statusCard = document.getElementById('status-card'); + const statusIcon = document.getElementById('status-icon'); + const statusTitle = document.getElementById('status-title'); + const statusDetail = document.getElementById('status-detail'); + + function updateStatusCard(type, icon, title, detail) { + statusCard.className = 'status-card status-' + type; + statusIcon.textContent = icon; + statusTitle.textContent = title; + statusDetail.innerHTML = detail; + } + // Update connection status function updateConnectionStatus() { if (navigator.onLine) { @@ -381,21 +459,56 @@ if ('serviceWorker' in navigator) { try { const registration = await navigator.serviceWorker.getRegistration(); - if (registration) { + if (registration && registration.active) { const state = registration.active ? 'Active' : registration.waiting ? 'Waiting' : registration.installing ? 'Installing' : 'Unknown'; swStatus.innerHTML = '✓ Registered (' + state + ')'; swStatus.innerHTML += 'https:// or localhost');
}
} catch (err) {
swStatus.innerHTML = '✗ Error: ' + err.message + '';
+ updateStatusCard('error', '❌', 'Error checking service worker',
+ 'Error: ' + err.message + '