diff --git a/src/interface/pages/settings.svelte b/src/interface/pages/settings.svelte index e97079f8..3ad94570 100644 --- a/src/interface/pages/settings.svelte +++ b/src/interface/pages/settings.svelte @@ -55,6 +55,11 @@ closeExtensionPopup(); }; + const openPrivacyStatement = () => { + window.open("https://betterseqta.org/privacy", "_blank"); + closeExtensionPopup(); + }; + let { standalone } = $props<{ standalone?: boolean }>(); let showColourPicker = $state(false); @@ -101,25 +106,34 @@ /> {#if !standalone} - +
+ - + - + + +
{/if} diff --git a/src/plugins/monofile.ts b/src/plugins/monofile.ts index ecd5f780..93b3b15a 100644 --- a/src/plugins/monofile.ts +++ b/src/plugins/monofile.ts @@ -24,6 +24,7 @@ import loading from "@/seqta/ui/Loading"; import { SendNewsPage } from "@/seqta/utils/SendNewsPage"; import { loadHomePage } from "@/seqta/utils/Loaders/LoadHomePage"; import { OpenWhatsNewPopup } from "@/seqta/utils/Openers/OpenWhatsNewPopup"; +import { showPrivacyNotification } from "@/seqta/utils/Openers/OpenPrivacyNotification"; import { updateTimetableTimes } from "@/seqta/utils/updateTimetableTimes"; @@ -93,7 +94,13 @@ export async function finishLoad() { console.error("Error during loading cleanup:", err); } - if (settingsState.justupdated && !document.getElementById("whatsnewbk")) { + // Show privacy statement notification on first open of this version (before what's new) + if (!settingsState.privacyStatementShown && !document.getElementById("whatsnewbk")) { + showPrivacyNotification(); + settingsState.privacyStatementShown = true; + } + + if (settingsState.justupdated && !document.getElementById("whatsnewbk") && !document.getElementById("privacy-notification")) { OpenWhatsNewPopup(); } } diff --git a/src/seqta/utils/Openers/OpenPrivacyNotification.ts b/src/seqta/utils/Openers/OpenPrivacyNotification.ts new file mode 100644 index 00000000..b2275ace --- /dev/null +++ b/src/seqta/utils/Openers/OpenPrivacyNotification.ts @@ -0,0 +1,85 @@ +import stringToHTML from "../stringToHTML"; +import { settingsState } from "../listeners/SettingsState"; +import { animate } from "motion"; +import { OpenWhatsNewPopup } from "./OpenWhatsNewPopup"; + +export function showPrivacyNotification() { + if (document.getElementById("privacy-notification")) return; + + const popupBackground = document.createElement("div"); + popupBackground.id = "privacy-notification"; + popupBackground.classList.add("whatsnewBackground"); + popupBackground.style.zIndex = "10000001"; + + const container = document.createElement("div"); + container.classList.add("whatsnewContainer"); + container.style.height = "auto"; + container.style.maxWidth = "800px"; + container.style.width = "90%"; + + const header = stringToHTML( + /* html */ + `
+

Privacy Statement

+

Important Information

+
`, + ).firstChild as HTMLElement; + + const text = stringToHTML(/* html */ ` +
+

+ It has come to our attention that several schools have expressed concerns about BetterSEQTA+. This is very disheartening, so we have decided to release a statement on the situation. +

+

+ To view our privacy policy, please click the shield icon in the settings menu, or click here. +

+

+ We never collect any information from you, and aim to provide the best features possible. +

+
+ `).firstChild as HTMLElement; + + if (header) container.append(header); + container.append(text); + + const closeButton = document.createElement("div"); + closeButton.id = "whatsnewclosebutton"; + container.append(closeButton); + + popupBackground.append(container); + document.getElementById("container")?.append(popupBackground); + + if (settingsState.animations) { + animate([popupBackground as HTMLElement], { opacity: [0, 1] }); + } + + popupBackground.addEventListener("click", (event) => { + if (event.target === popupBackground) { + popupBackground.remove(); + // Show what's new if it was waiting + if (settingsState.justupdated && !document.getElementById("whatsnewbk")) { + OpenWhatsNewPopup(); + } + } + }); + + closeButton.addEventListener("click", () => { + popupBackground.remove(); + // Show what's new if it was waiting + if (settingsState.justupdated && !document.getElementById("whatsnewbk")) { + OpenWhatsNewPopup(); + } + }); + + // Handle privacy link click - ensure it opens in new tab + setTimeout(() => { + const privacyLink = document.getElementById("privacy-link"); + if (privacyLink) { + privacyLink.addEventListener("click", (e) => { + e.preventDefault(); + window.open("https://betterseqta.org/privacy", "_blank", "noopener,noreferrer"); + }); + } + }, 100); +} + diff --git a/src/seqta/utils/Openers/OpenPrivacyStatement.ts b/src/seqta/utils/Openers/OpenPrivacyStatement.ts new file mode 100644 index 00000000..4fc52682 --- /dev/null +++ b/src/seqta/utils/Openers/OpenPrivacyStatement.ts @@ -0,0 +1,48 @@ +import stringToHTML from "../stringToHTML"; +import { openPopup } from "./PopupManager"; + +export function OpenPrivacyStatement() { + const header = stringToHTML( + /* html */ + `
+

Privacy Statement

+

Our commitment to your privacy

+
`, + ).firstChild as HTMLElement; + + const text = stringToHTML(/* html */ ` +
+

Privacy Policy

+

At BetterSEQTA+, we take your privacy seriously. We want to be completely transparent about how we handle your data.

+ +

Data Collection

+

We never collect any information from you. BetterSEQTA+ is designed to work entirely on your device. All processing happens locally in your browser, and we do not send any data to external servers.

+ +

What We Don't Do

+ + +

Local Storage

+

BetterSEQTA+ uses your browser's local storage to save your preferences and settings. This data remains on your device and is never transmitted anywhere. You can clear this data at any time through your browser's settings.

+ +

Open Source

+

BetterSEQTA+ is an open-source project. You can review our code on GitHub to verify our privacy practices. We believe in transparency and encourage you to inspect the code yourself.

+ +

Our Commitment

+

We are committed to providing the best features possible while respecting your privacy. We understand that schools and students have concerns about data privacy, and we want to assure you that BetterSEQTA+ is designed with privacy as a core principle.

+ +

If you have any questions or concerns about our privacy practices, please reach out to us through our GitHub repository.

+
+ `).firstChild as HTMLElement; + + openPopup({ + header, + content: [text], + }); +} + diff --git a/src/types/storage.ts b/src/types/storage.ts index a085567d..5b6e7c1d 100644 --- a/src/types/storage.ts +++ b/src/types/storage.ts @@ -30,6 +30,7 @@ export interface SettingsState { subjectfilters: Record; transparencyEffects: boolean; justupdated?: boolean; + privacyStatementShown?: boolean; timeFormat?: string; animations: boolean; defaultPage: string;