diff --git a/app/js/main.js b/app/js/main.js index 052d3b9..3c12819 100644 --- a/app/js/main.js +++ b/app/js/main.js @@ -8,7 +8,6 @@ * @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ - let deferredPrompt; const installPrompt = document.getElementById("install-prompt"); const installButton = document.getElementById("install-button"); @@ -19,7 +18,8 @@ if (!localStorage.getItem("pwaInstallDismissed")) { window.addEventListener("beforeinstallprompt", (event) => { event.preventDefault(); deferredPrompt = event; - installPrompt.classList.add("show"); // Show the prompt + installPrompt.classList.remove("d-none"); + installPrompt.classList.add("d-block"); // Show the prompt }); } @@ -29,13 +29,14 @@ if ( installButton ) { if (deferredPrompt) { deferredPrompt.prompt(); const { outcome } = await deferredPrompt.userChoice; - + if (outcome === "dismissed") { setInstallDismissed(); // Store that the user dismissed the prompt } - + deferredPrompt = null; // Reset prompt - installPrompt.classList.remove("show"); // Hide the prompt + installPrompt.classList.remove("d-block"); + installPrompt.classList.add("d-none"); } }); } @@ -50,14 +51,15 @@ if ( dismissButton ) { // Function to remember user choice for 7 days function setInstallDismissed() { localStorage.setItem("pwaInstallDismissed", Date.now() + 7 * 24 * 60 * 60 * 1000); - installPrompt.classList.remove("show"); // Hide the prompt + installPrompt.classList.remove("d-block"); // Hide the prompt + installPrompt.classList.add("d-none"); } // Check if the 7-day period has passed if (localStorage.getItem("pwaInstallDismissed")) { const dismissUntil = parseInt(localStorage.getItem("pwaInstallDismissed"), 10); if (Date.now() < dismissUntil) { - installPrompt.classList.remove("show"); // Ensure it's hidden + // } else { localStorage.removeItem("pwaInstallDismissed"); // Reset after 7 days } diff --git a/app/views/pwa.html b/app/views/pwa.html index 13505f6..200ae97 100644 --- a/app/views/pwa.html +++ b/app/views/pwa.html @@ -1,9 +1,9 @@ -
+
diff --git a/images/icon-maskWhite.png b/images/icon-maskWhite.png new file mode 100644 index 0000000..d93d196 Binary files /dev/null and b/images/icon-maskWhite.png differ diff --git a/manifest.webmanifest b/manifest.webmanifest index 3c82045..7af15a5 100644 --- a/manifest.webmanifest +++ b/manifest.webmanifest @@ -7,8 +7,8 @@ "background_color": "#7d7f83", "theme_color": "#3fa9f5", "icons": [ - { "src": "/images/logo192.png", "type": "image/png", "sizes": "192x192" }, - { "src": "/images/logo512.png", "type": "image/png", "sizes": "512x512" }, + { "src": "/images/logoWhite192.png", "type": "image/png", "sizes": "192x192" }, + { "src": "/images/logoWhite512.png", "type": "image/png", "sizes": "512x512" }, { "src": "/images/icon-mask.png", "type": "image/png", "sizes": "512x512", "purpose": "maskable" } ], "screenshots": [