From 2f90f845a2d9c9b24dd6fcf319eca58fdb31d0f3 Mon Sep 17 00:00:00 2001 From: Keep Creating Online <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:01:10 -0500 Subject: [PATCH 01/10] reduced the need to constantly click "i understand" on the disclaimer modal. --- src/index.html | 66 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/src/index.html b/src/index.html index 4867ad0..a3e29fc 100644 --- a/src/index.html +++ b/src/index.html @@ -475,32 +475,66 @@ if (appModal) { appModal.classList.add("hidden"); } + // ADDED: If user has not seen disclaimer yet, show it after application modal is closed + if (!localStorage.getItem("hasSeenDisclaimer")) { + const disclaimerModal = + document.getElementById("disclaimerModal"); + if (disclaimerModal) { + disclaimerModal.classList.remove("hidden"); + } + } }); } // // 5) ?modal=appeals => open content appeals form + // ?modal=application => open application form // const urlParams = new URLSearchParams(window.location.search); const modalParam = urlParams.get("modal"); + if (modalParam === "appeals") { const appealsModal = document.getElementById("contentAppealsModal"); if (appealsModal) { appealsModal.classList.remove("hidden"); } - } - // - // 5.1) ?modal=application => open application form - // - else if (modalParam === "application") { + + // ADDED: After user closes appeals, show disclaimer if needed + const closeAppealsBtn = document.getElementById( + "closeContentAppealsModal" + ); + if (closeAppealsBtn) { + closeAppealsBtn.addEventListener("click", () => { + appealsModal.classList.add("hidden"); + if (!localStorage.getItem("hasSeenDisclaimer")) { + const disclaimerModal = + document.getElementById("disclaimerModal"); + if (disclaimerModal) { + disclaimerModal.classList.remove("hidden"); + } + } + }); + } + } else if (modalParam === "application") { + // Show application form, but DO NOT show disclaimer until user closes const appModal = document.getElementById("nostrFormModal"); if (appModal) { appModal.classList.remove("hidden"); } + // Note: The close event above (closeNostrFormBtn) handles the disclaimer after closing. + } else { + // If there's no special param in the URL, we can consider showing the disclaimer right away + const hasSeenDisclaimer = localStorage.getItem("hasSeenDisclaimer"); + if (!hasSeenDisclaimer) { + const disclaimerModal = document.getElementById("disclaimerModal"); + if (disclaimerModal) { + disclaimerModal.classList.remove("hidden"); + } + } } // - // 6) Close content appeals modal + // 6) Close content appeals modal (needed if user navigates w/o param, then opens appeals) // const closeAppealsBtn = document.getElementById( "closeContentAppealsModal" @@ -515,23 +549,23 @@ } // - // 7) Show disclaimer modal on page load, hide on "I Understand" + // 7) Disclaimer 'I Understand' Button // - const disclaimerModal = document.getElementById("disclaimerModal"); const acceptDisclaimerBtn = document.getElementById("acceptDisclaimer"); - if (disclaimerModal) { - // Show immediately - disclaimerModal.classList.remove("hidden"); - if (acceptDisclaimerBtn) { - acceptDisclaimerBtn.addEventListener("click", () => { + if (acceptDisclaimerBtn) { + acceptDisclaimerBtn.addEventListener("click", () => { + // Hide disclaimer + const disclaimerModal = document.getElementById("disclaimerModal"); + if (disclaimerModal) { disclaimerModal.classList.add("hidden"); - }); - } + } + // Store the fact that user has seen it + localStorage.setItem("hasSeenDisclaimer", "true"); + }); } // // 8) Query param checks for the three new forms - // // https://bitvid.network?modal=feedback => open generalFeedbackModal // https://bitvid.network?modal=feature => open featureRequestModal // https://bitvid.network?modal=bug => open bugFixModal From f5e3484cbc76f882b6bef9f91206450c1d6f26fc Mon Sep 17 00:00:00 2001 From: Keep Creating Online <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:33:16 -0500 Subject: [PATCH 02/10] update --- src/site.webmanifest => site.webmanifest | 12 +- src/components/application-form.html | 2 +- src/components/bug-fix-form.html | 2 +- src/components/content-appeals-form.html | 2 +- src/components/feature-request-form.html | 2 +- src/components/general-feedback-form.html | 2 +- .../iframe_forms/iframe-application-form.html | 434 ++++++++++++------ .../iframe_forms/iframe-bug-fix-form.html | 405 ++++++++++------ .../iframe-content-appeals-form.html | 396 ++++++++++------ .../iframe_forms/iframe-feedback-form.html | 351 +++++++++----- .../iframe_forms/iframe-request-form.html | 370 +++++++++------ src/sw.min.js | 257 ++++++----- 12 files changed, 1425 insertions(+), 810 deletions(-) rename src/site.webmanifest => site.webmanifest (70%) diff --git a/src/site.webmanifest b/site.webmanifest similarity index 70% rename from src/site.webmanifest rename to site.webmanifest index c0112e3..b09d923 100644 --- a/src/site.webmanifest +++ b/site.webmanifest @@ -4,32 +4,32 @@ "description": "seed. zap. subscribe.", "icons": [ { - "src": "assets/png/android-chrome-192x192.png", + "src": "src/assets/png/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, { - "src": "assets/png/android-chrome-512x512.png", + "src": "src/assets/png/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }, { - "src": "assets/png/apple-touch-icon.png", + "src": "src/assets/png/apple-touch-icon.png", "sizes": "180x180", "type": "image/png" }, { - "src": "assets/png/favicon-32x32.png", + "src": "src/assets/png/favicon-32x32.png", "sizes": "32x32", "type": "image/png" }, { - "src": "assets/png/favicon-16x16.png", + "src": "src/assets/png/favicon-16x16.png", "sizes": "16x16", "type": "image/png" } ], - "start_url": "/index.html", + "start_url": "src/index.html", "display": "standalone", "background_color": "#0f172a", "theme_color": "#0f172a", diff --git a/src/components/application-form.html b/src/components/application-form.html index 7c871c6..ba61e44 100644 --- a/src/components/application-form.html +++ b/src/components/application-form.html @@ -67,7 +67,7 @@