diff --git a/src/css/injected.scss b/src/css/injected.scss index 7130e166..e31230a0 100644 --- a/src/css/injected.scss +++ b/src/css/injected.scss @@ -3524,6 +3524,26 @@ div.day-empty { font-size: 1em; color: var(--text-primary); } +.whatsnewHeader.engageParentsAnnouncementHeader { + height: auto; + min-height: unset; +} +.whatsnewHeader.engageParentsAnnouncementHeader h1 { + line-height: 1.2; +} +.whatsnewHeader.engageParentsAnnouncementHeader .engageParentsSubheading { + margin-top: 0.35rem; + font-size: 1.05rem; + font-weight: 600; + opacity: 0.92; +} +.seqtaEngageAccent { + color: #ea580c; + font-weight: 700; +} +.dark .seqtaEngageAccent { + color: #fb923c; +} .whatsnewBackground { width: 100%; height: 100%; @@ -3652,6 +3672,25 @@ div.day-empty { object-fit: cover; margin-bottom: 12px; } +.whatsnewTextContainer .engageParentsPromoWrap { + width: 100%; + margin-bottom: 12px; + border-radius: 16px; + overflow: hidden; + aspect-ratio: 16 / 9; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.28); + background: color-mix(in srgb, var(--background-secondary) 88%, var(--text-primary) 12%); +} +.whatsnewTextContainer .engageParentsPromoWrap .engageParentsPromoImg { + display: block; + width: 100%; + height: 100%; + margin: 0; + border-radius: 0; + aspect-ratio: unset; + object-fit: contain; + object-position: center; +} @keyframes shimmer { 0% { diff --git a/src/plugins/monofile.ts b/src/plugins/monofile.ts index 353386e3..1a65bb96 100644 --- a/src/plugins/monofile.ts +++ b/src/plugins/monofile.ts @@ -29,8 +29,7 @@ import { updateEngageHomeMenuActive, } from "@/seqta/utils/Loaders/LoadEngageHomePage"; import { loadHomePage } from "@/seqta/utils/Loaders/LoadHomePage"; -import { OpenWhatsNewPopup } from "@/seqta/utils/Openers/OpenWhatsNewPopup"; -import { showPrivacyNotification } from "@/seqta/utils/Openers/OpenPrivacyNotification"; +import { runStartupPopupQueue } from "@/seqta/utils/Openers/StartupPopupQueue"; import { updateTimetableTimes } from "@/seqta/utils/updateTimetableTimes"; @@ -106,14 +105,7 @@ export async function finishLoad() { console.error("Error during loading cleanup:", err); } - // Check and show privacy statement notification (before what's new) - if (!document.getElementById("privacy-notification")) { - await showPrivacyNotification(); - } - - if (settingsState.justupdated && !document.getElementById("whatsnewbk") && !document.getElementById("privacy-notification")) { - OpenWhatsNewPopup(); - } + runStartupPopupQueue(); } export function GetCSSElement(file: string) { diff --git a/src/resources/bq+engage.png b/src/resources/bq+engage.png new file mode 100644 index 00000000..298ce3b6 Binary files /dev/null and b/src/resources/bq+engage.png differ diff --git a/src/seqta/utils/Openers/OpenEngageParentsAnnouncement.ts b/src/seqta/utils/Openers/OpenEngageParentsAnnouncement.ts new file mode 100644 index 00000000..ca8b4747 --- /dev/null +++ b/src/seqta/utils/Openers/OpenEngageParentsAnnouncement.ts @@ -0,0 +1,59 @@ +import stringToHTML from "../stringToHTML"; +import { settingsState } from "../listeners/SettingsState"; +import { openPopup } from "./PopupManager"; + +/** Same hosting pattern as the privacy statement branding images (avoids page-relative extension URLs on Engage). */ +const ENGAGE_PROMO_IMG_URL = + "https://raw.githubusercontent.com/BetterSEQTA/BetterSEQTA-Plus/main/src/resources/bq%2Bengage.png"; + +export function shouldShowEngageParentsAnnouncement(): boolean { + return !settingsState.engageParentsAnnouncementShown; +} + +/** + * One-time announcement that BetterSEQTA Plus works on SEQTA Engage (parents). + */ +export function showEngageParentsAnnouncement(onDismissed?: () => void) { + if (document.getElementById("whatsnewbk")) { + onDismissed?.(); + return; + } + if (!shouldShowEngageParentsAnnouncement()) { + onDismissed?.(); + return; + } + + const header = stringToHTML( + /* html */ + `
Buy your mom a BetterSEQTA Plus
++ SEQTA Engage is the portal many parents use for notices, messages, and day-to-day school info. + Before anything else: BetterSEQTA Plus now supports SEQTA Engage, so parents get the same kinds of improvements you are used to on SEQTA Learn—themes, a clearer home experience, and other Plus polish while browsing Engage. +
++ The title is a bit of fun; if the extension saves you time, you can always support development via Open Collective or Ko-fi from the What is New changelog or related links in settings. +
++ Close this dialog when you are done. We will not show this announcement again. +
+