111 lines
5.8 KiB
HTML
111 lines
5.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>CantiCristiani</title>
|
|
|
|
<base href="/"/>
|
|
|
|
<!-- SEO & OpenGraph Meta Tags -->
|
|
<meta name="description" content="Testi e accordi di canti cristiani e liturgici, sempre con te anche offline." />
|
|
<meta property="og:title" content="Canti Cristiani" />
|
|
<meta property="og:description" content="Testi e accordi di canti cristiani e liturgici, sempre con te anche offline." />
|
|
<meta property="og:image" content="assets/icon/favicon.png" />
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:url" content="https://www.canticristiani.it/" />
|
|
|
|
<meta name="color-scheme" content="light dark"/>
|
|
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
|
<meta name="format-detection" content="telephone=no"/>
|
|
<meta name="msapplication-tap-highlight" content="no"/>
|
|
|
|
<link rel="icon" type="image/png" href="assets/icon/favicon.png"/>
|
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Outfit:wght@300;500;700&display=swap" rel="stylesheet">
|
|
|
|
<!-- add to homescreen for ios -->
|
|
<meta name="mobile-web-app-capable" content="yes"/>
|
|
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
|
|
<link rel="manifest" href="manifest.webmanifest">
|
|
</head>
|
|
|
|
<body>
|
|
<app-root>
|
|
<div id="pwa-boot-loader" style="position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: #121212; color: #ffffff; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 99999; font-family: 'Outfit', sans-serif;">
|
|
<div style="text-align: center; padding: 20px; max-width: 400px; width: 100%;">
|
|
<div style="margin-bottom: 25px; display: inline-block;">
|
|
<img src="assets/icon/favicon.png" alt="CantiCristiani" style="width: 80px; height: 80px; border-radius: 20px; box-shadow: 0 8px 24px rgba(230, 126, 34, 0.3); border: 2px solid rgba(230, 126, 34, 0.2);">
|
|
</div>
|
|
<h2 id="pwa-boot-title" style="font-size: 1.8rem; font-weight: 600; margin-bottom: 5px; color: #ffffff; font-family: 'Outfit', sans-serif; -webkit-font-smoothing: antialiased;">Avvio in corso</h2>
|
|
<p id="pwa-boot-desc" style="font-size: 1rem; color: rgba(255, 255, 255, 0.6); margin-bottom: 15px; font-family: 'Outfit', sans-serif; -webkit-font-smoothing: antialiased;">Caricamento dei componenti dell'applicazione...</p>
|
|
<div id="pwa-boot-version" style="font-size: 0.85rem; color: rgba(255, 255, 255, 0.45); margin-bottom: 20px; font-family: 'Outfit', sans-serif; -webkit-font-smoothing: antialiased; font-weight: 500;">Ricerca versione...</div>
|
|
<div id="pwa-boot-phase" style="font-size: 0.95rem; font-weight: 600; color: #fdcb6e; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1.5px; font-family: 'Outfit', sans-serif;">Fase: Avvio</div>
|
|
<div style="background: rgba(255, 255, 255, 0.1); border-radius: 10px; height: 8px; width: 100%; overflow: hidden; margin-bottom: 15px;">
|
|
<div id="pwa-boot-bar" style="background: #e67e22; height: 100%; width: 0%; transition: width 0.1s ease; border-radius: 10px;"></div>
|
|
</div>
|
|
<div id="pwa-boot-percent" style="font-size: 1.2rem; font-weight: 700; color: #e67e22; font-family: 'Outfit', sans-serif; -webkit-font-smoothing: antialiased;">0%</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
(function() {
|
|
const isUpdate = window.location.search.includes('update');
|
|
const titleEl = document.getElementById('pwa-boot-title');
|
|
const descEl = document.getElementById('pwa-boot-desc');
|
|
const phaseEl = document.getElementById('pwa-boot-phase');
|
|
|
|
// Detect if it is the first installation (no active service worker controlling the page yet)
|
|
const isFirstInstall = 'serviceWorker' in navigator && !navigator.serviceWorker.controller;
|
|
|
|
if (isUpdate) {
|
|
if (titleEl) titleEl.textContent = 'Aggiornamento completato';
|
|
if (descEl) descEl.textContent = 'Ottimizzazione e avvio della nuova versione...';
|
|
if (phaseEl) phaseEl.textContent = 'Fase: Avvio';
|
|
} else if (isFirstInstall) {
|
|
if (titleEl) titleEl.textContent = 'Download in corso';
|
|
if (descEl) descEl.textContent = 'Scaricamento dei componenti dell\'applicazione...';
|
|
if (phaseEl) phaseEl.textContent = 'Fase: Download';
|
|
}
|
|
|
|
const versionEl = document.getElementById('pwa-boot-version');
|
|
fetch('/version.json?cb=' + Date.now())
|
|
.then(res => {
|
|
if (res.ok) return res.json();
|
|
throw new Error('Fallback');
|
|
})
|
|
.then(data => {
|
|
if (data && data.version && versionEl) {
|
|
versionEl.textContent = 'Versione ' + data.version;
|
|
}
|
|
})
|
|
.catch(e => {
|
|
if (versionEl) {
|
|
versionEl.textContent = '';
|
|
}
|
|
});
|
|
|
|
let percent = 0;
|
|
const bar = document.getElementById('pwa-boot-bar');
|
|
const pctText = document.getElementById('pwa-boot-percent');
|
|
|
|
const interval = setInterval(() => {
|
|
if (percent < 98) {
|
|
percent += Math.floor(Math.random() * 8) + 3;
|
|
if (percent > 98) percent = 98;
|
|
if (bar) bar.style.width = percent + '%';
|
|
if (pctText) pctText.textContent = percent + '%';
|
|
} else {
|
|
clearInterval(interval);
|
|
}
|
|
}, 80);
|
|
})();
|
|
</script>
|
|
</app-root>
|
|
<noscript>Please enable JavaScript to continue using this application.</noscript>
|
|
</body>
|
|
|
|
</html>
|