.pwa-landing-wrapper { display: flex; justify-content: center; align-items: center; min-height: 70vh; padding: 20px; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif; } .pwa-card { background: #ffffff; border-radius: 20px; padding: 35px 25px; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); border: 1px solid #f0f0f0; } .pwa-logo { width: 90px; height: 90px; border-radius: 20px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); object-fit: cover; } .pwa-title { font-size: 22px; font-weight: 700; color: #1a1a1a; margin: 0 0 10px 0; } .pwa-desc { font-size: 15px; color: #666; line-height: 1.5; margin: 0 0 25px 0; } .cta-btn { display: block; width: 100%; background: #1877f2; color: #fff; border: none; padding: 16px 20px; font-size: 16px; font-weight: 600; border-radius: 12px; cursor: pointer; box-sizing: border-box; text-decoration: none; transition: transform 0.1s ease, background-color 0.2s; } .cta-btn:active { transform: scale(0.98); } .cta-btn.secondary { background: #f0f2f5; color: #1a1a1a; margin-top: 10px; } .sub-text { font-size: 13px; color: #888; margin-top: 10px; } .ios-instruction-box { background: #f8f9fb; border: 1px solid #e5e8ec; border-radius: 14px; padding: 18px 20px; text-align: left; } .ios-heading { font-size: 15px; font-weight: 600; color: #1a1a1a; margin: 0 0 12px 0; } .ios-steps { margin: 0; padding-left: 20px; font-size: 14px; color: #444; line-height: 1.6; } .ios-icon { font-size: 16px; font-weight: bold; color: #007aff; } .success-badge { color: #2e7d32; font-weight: 600; font-size: 15px; }

Scarica l’App Ufficiale

Accedi a contenuti, mappe e aggiornamenti rapidi direttamente dal tuo dispositivo.

document.addEventListener(‘DOMContentLoaded’, () => { let deferredPrompt; const androidFlow = document.getElementById(‘android-flow’); const iosFlow = document.getElementById(‘ios-flow’); const installedFlow = document.getElementById(‘installed-flow’); const genericFlow = document.getElementById(‘generic-flow’); const installBtn = document.getElementById(‘main-install-btn’); const isIos = () => /iphone|ipad|ipod/.test(window.navigator.userAgent.toLowerCase()); const isInStandalone = () => (‘standalone’ in window.navigator && window.navigator.standalone) || window.matchMedia(‘(display-mode: standalone)’).matches; // 1. App già aperta in modalità standalone if (isInStandalone()) { installedFlow.style.display = ‘block’; return; } // 2. Dispositivo iOS if (isIos()) { iosFlow.style.display = ‘block’; return; } // 3. Android / Chrome: intercettazione prompt nativo window.addEventListener(‘beforeinstallprompt’, (e) => { e.preventDefault(); deferredPrompt = e; androidFlow.style.display = ‘block’; genericFlow.style.display = ‘none’; }); installBtn.addEventListener(‘click’, async () => { if (!deferredPrompt) return; deferredPrompt.prompt(); const { outcome } = await deferredPrompt.userChoice; if (outcome === ‘accepted’) { androidFlow.style.display = ‘none’; installedFlow.style.display = ‘block’; } deferredPrompt = null; }); // 4. Fallback temporale se non scatta il prompt setTimeout(() => { if (!deferredPrompt && !isIos() && !isInStandalone()) { genericFlow.style.display = ‘block’; } }, 1500); window.addEventListener(‘appinstalled’, () => { androidFlow.style.display = ‘none’; installedFlow.style.display = ‘block’; }); });

App created by Giuseppe Ragucci

____________________________________