diff --git a/src/css/injected.scss b/src/css/injected.scss index 90023d81..162e113a 100644 --- a/src/css/injected.scss +++ b/src/css/injected.scss @@ -158,6 +158,16 @@ select { color: var(--text-primary); position: relative; } +#main { + > .timetablepage { + > .quickbar { + .gutter { + border-bottom-left-radius: 15px; + border-bottom-right-radius: 15px; + } + } + } +} .forums { color: var(--text-color); } @@ -823,11 +833,18 @@ div > ol:has(.uiFileHandlerWrapper) { box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.2); } -html.transparencyEffects [class*="ResourceList__ResourceItem___voTSd"], -html.transparencyEffects [class*="ResourceList__ResourceItem___voTSd"] [class*="ResourceList__name___ydvDT"] { +html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li { border-bottom: none !important; } +html.transparencyEffects + [class*="BasicPanel__BasicPanel___q92_U"] + > ol + > li + + li { + border-top: 1px solid var(--theme-offset-bg); +} + .assessmentsWrapper .message { display: none; } @@ -983,7 +1000,7 @@ html.transparencyEffects [class*="ResourceList__ResourceItem___voTSd"] [class*=" top: 72px; left: 0px; z-index: 10; - + @media (min-width: 1401px) { position: absolute; left: 402px; @@ -1690,7 +1707,7 @@ iframe.userHTML { } .programmeNavigator { - box-shadow: 0 0 40px 0px rgba(0,0,0,0.05); + box-shadow: 0 0 40px 0px rgba(0, 0, 0, 0.05); overflow-y: scroll; height: 100%; @@ -1749,7 +1766,7 @@ iframe.userHTML { &.selected { background: transparent !important; } - + &::before { content: ""; position: absolute; @@ -1761,7 +1778,9 @@ iframe.userHTML { background: var(--auto-background); opacity: 0; scale: 0.95; - transition: opacity 0.2s ease-out, scale 0.1s ease-out; + transition: + opacity 0.2s ease-out, + scale 0.1s ease-out; z-index: -1; pointer-events: none; } @@ -1775,13 +1794,12 @@ iframe.userHTML { opacity: 1; scale: 1; } - } } } .pane { - .content:has(.programmeNavigator) { + .content:has(.programmeNavigator) { margin: 0; } @@ -1799,7 +1817,9 @@ iframe.userHTML { .dark .programmeNavigator .navigator { .search { background: var(--background-secondary) !important; - box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1), inset 0px 0px 15px 0px rgba(0, 0, 0, 0.1) !important; + box-shadow: + 0px 0px 10px 0px rgba(0, 0, 0, 0.1), + inset 0px 0px 15px 0px rgba(0, 0, 0, 0.1) !important; } } .dark #main > .course > .content > h1 { @@ -2028,7 +2048,7 @@ div.entry.new { div.liveEntry { border-radius: 4px; -} +} div.dailycalMarker { border-radius: 4px; @@ -2179,24 +2199,23 @@ div.bar.flat { background: var(--background-secondary) !important; } -.dashlet-motd { - padding: 7px !important; - .message { - font-size: 24px !important; - border-radius: 12px !important; - border: none !important; - box-shadow: none !important; - color: #fff !important; - padding: 16px !important; - margin: 0 !important; - height: 100% !important; - max-height: none !important; - display: flex !important; - align-items: flex-start !important; - overflow: hidden !important; + .dashlet-motd { + padding: 7px !important; + .message { + font-size: 24px !important; + border-radius: 12px !important; + border: none !important; + box-shadow: none !important; + color: #fff !important; + padding: 16px !important; + margin: 0 !important; + height: 100% !important; + max-height: none !important; + display: flex !important; + align-items: flex-start !important; + overflow: hidden !important; + } } -} - .cke_toolbox > .cke_toolbar > .cke_toolgroup > .cke_button { background: var(--background-secondary) !important; @@ -3750,14 +3769,19 @@ div.day-empty { } .notice-unified-content { - h1, h2, h3, h4, h5, h6 { + h1, + h2, + h3, + h4, + h5, + h6 { margin: 0 !important; padding: 0 !important; font-weight: inherit !important; color: inherit !important; text-shadow: none !important; } - + .notice-header { display: flex; justify-content: space-between; @@ -3766,7 +3790,7 @@ div.day-empty { margin-bottom: 12px; gap: 16px; } - + .notice-content-title { font-size: 20px !important; // Nice middle ground - not too big, not too small font-weight: 600 !important; @@ -3775,7 +3799,7 @@ div.day-empty { line-height: 1.3 !important; flex-shrink: 0; } - + .notice-content-body { font-size: 14px !important; color: var(--text-secondary) !important; @@ -3787,72 +3811,73 @@ div.day-empty { min-width: 600px; // Ensure tables have consistent width for layout width: 100%; } - + // The ONLY difference between states is clipping! - &.notice-card-state { + &.notice-card-state { .notice-content-body { // Clip to show only 2 lines but keep full layout overflow: hidden; max-height: 3em; // ~2 lines worth of height } } - + &.notice-modal-state { .notice-close-btn { opacity: 1; } - + .notice-content-body { // Show full content with scrolling overflow-y: auto; - + // Custom scrollbar for long content &::-webkit-scrollbar { width: 6px; } - + &::-webkit-scrollbar-track { background: transparent; } - + &::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; } - - &::-webkit-scrollbar-thumb:hover { - background: rgba(255, 255, 255, 0.3); - } - // Style content elements nicely - p { - margin-bottom: 12px; - - &:last-child { - margin-bottom: 0; - } - } + &::-webkit-scrollbar-thumb:hover { + background: rgba(255, 255, 255, 0.3); + } - a { - color: var(--theme-primary); - text-decoration: none; + // Style content elements nicely + p { + margin-bottom: 12px; - &:hover { - text-decoration: underline; - } - } + &:last-child { + margin-bottom: 0; + } + } - ul, ol { - margin: 12px 0; - padding-left: 20px; - } + a { + color: var(--theme-primary); + text-decoration: none; - li { - margin-bottom: 4px; - } - } - } - } + &:hover { + text-decoration: underline; + } + } + + ul, + ol { + margin: 12px 0; + padding-left: 20px; + } + + li { + margin-bottom: 4px; + } + } + } +} .notice-header { display: flex; @@ -3952,21 +3977,21 @@ button.notice-close-btn { color: var(--text-secondary); flex: 1; overflow-y: auto; - + // Custom scrollbar &::-webkit-scrollbar { width: 6px; } - + &::-webkit-scrollbar-track { background: transparent; } - + &::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; } - + &::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); } @@ -3974,7 +3999,7 @@ button.notice-close-btn { // Style content elements p { margin-bottom: 12px; - + &:last-child { margin-bottom: 0; } @@ -3989,7 +4014,8 @@ button.notice-close-btn { } } - ul, ol { + ul, + ol { margin: 12px 0; padding-left: 20px; } @@ -4003,7 +4029,7 @@ button.notice-close-btn { .dark { .notice-card { border-color: rgba(255, 255, 255, 0.05); - + &:hover { border-color: rgba(255, 255, 255, 0.1); } @@ -4036,7 +4062,7 @@ button.notice-close-btn { .notice-card { padding: 12px; } - + .notice-preview { font-size: 13px; } diff --git a/src/interface/pages/settings.svelte b/src/interface/pages/settings.svelte index 5be5f0d2..e97079f8 100644 --- a/src/interface/pages/settings.svelte +++ b/src/interface/pages/settings.svelte @@ -11,8 +11,8 @@ import { closeExtensionPopup } from "@/seqta/utils/Closers/closeExtensionPopup"; import { OpenAboutPage } from "@/seqta/utils/Openers/OpenAboutPage"; - import { OpenWhatsNewPopup } from "@/seqta/utils/Whatsnew"; - import { OpenMinecraftServerPopup } from "@/seqta/utils/AboutMinecraftServer"; + import { OpenWhatsNewPopup } from "@/seqta/utils/Openers/OpenWhatsNewPopup"; + import { OpenMinecraftServerPopup } from "@/seqta/utils/Openers/OpenMinecraftServerPopup"; import ColourPicker from "../components/ColourPicker.svelte"; import { settingsPopup } from "../hooks/SettingsPopup"; @@ -103,7 +103,7 @@ {#if !standalone} diff --git a/src/plugins/built-in/notificationCollector/index.ts b/src/plugins/built-in/notificationCollector/index.ts index 9763f4dd..dc4576c1 100644 --- a/src/plugins/built-in/notificationCollector/index.ts +++ b/src/plugins/built-in/notificationCollector/index.ts @@ -39,7 +39,7 @@ const notificationCollectorPlugin: Plugin<{}, NotificationCollectorStorage> = { "[class*='notifications__bubble___']", ) as HTMLElement; - if (api.storage.lastNotificationCount !== 0) { + if (alertDiv && api.storage.lastNotificationCount !== 0) { alertDiv.textContent = api.storage.lastNotificationCount.toString(); } @@ -63,7 +63,7 @@ const notificationCollectorPlugin: Plugin<{}, NotificationCollectorStorage> = { const notificationCount = data.payload.notifications.length; api.storage.lastNotificationCount = notificationCount; api.storage.lastCheckedTime = new Date().toISOString(); - + // Reset error count on success api.storage.consecutiveErrors = 0; @@ -74,31 +74,36 @@ const notificationCollectorPlugin: Plugin<{}, NotificationCollectorStorage> = { } } catch (error) { console.error("[BetterSEQTA+] Error fetching notifications:", error); - api.storage.consecutiveErrors = (api.storage.consecutiveErrors || 0) + 1; + api.storage.consecutiveErrors = + (api.storage.consecutiveErrors || 0) + 1; } }; const getNextInterval = () => { // Exponential backoff on errors, max 5 minutes - const errorMultiplier = Math.min(Math.pow(2, api.storage.consecutiveErrors || 0), 10); + const errorMultiplier = Math.min( + Math.pow(2, api.storage.consecutiveErrors || 0), + 10, + ); return Math.min(baseInterval * errorMultiplier, maxInterval); }; const startPolling = () => { if (pollInterval) return; // Already polling checkNotifications(); - + const scheduleNext = () => { const interval = getNextInterval(); pollInterval = window.setTimeout(() => { checkNotifications().then(() => { - if (pollInterval) { // Only continue if not stopped + if (pollInterval) { + // Only continue if not stopped scheduleNext(); } }); }, interval); }; - + scheduleNext(); }; @@ -124,14 +129,16 @@ const notificationCollectorPlugin: Plugin<{}, NotificationCollectorStorage> = { isVisible = !document.hidden; if (isVisible && !pollInterval) { // Resume polling when tab becomes visible - const alertDiv = document.querySelector("[class*='notifications__bubble___']"); + const alertDiv = document.querySelector( + "[class*='notifications__bubble___']", + ); if (alertDiv) { startPolling(); } } }; - document.addEventListener('visibilitychange', handleVisibilityChange); + document.addEventListener("visibilitychange", handleVisibilityChange); api.seqta.onMount("[class*='notifications__bubble___']", (_) => { startPolling(); @@ -139,7 +146,7 @@ const notificationCollectorPlugin: Plugin<{}, NotificationCollectorStorage> = { return () => { stopPolling(); - document.removeEventListener('visibilitychange', handleVisibilityChange); + document.removeEventListener("visibilitychange", handleVisibilityChange); }; }, }; diff --git a/src/plugins/monofile.ts b/src/plugins/monofile.ts index 4a692dad..ecd5f780 100644 --- a/src/plugins/monofile.ts +++ b/src/plugins/monofile.ts @@ -23,12 +23,9 @@ import { updateAllColors } from "@/seqta/ui/colors/Manager"; import loading from "@/seqta/ui/Loading"; import { SendNewsPage } from "@/seqta/utils/SendNewsPage"; import { loadHomePage } from "@/seqta/utils/Loaders/LoadHomePage"; -import { OpenWhatsNewPopup } from "@/seqta/utils/Whatsnew"; -//import { OpenMinecraftServerPopup } from "@/seqta/utils/AboutMinecraftServer"; +import { OpenWhatsNewPopup } from "@/seqta/utils/Openers/OpenWhatsNewPopup"; -import { - updateTimetableTimes, -} from "@/seqta/utils/updateTimetableTimes"; +import { updateTimetableTimes } from "@/seqta/utils/updateTimetableTimes"; // JSON content import MenuitemSVGKey from "@/seqta/content/MenuItemSVGKey.json"; diff --git a/src/seqta/utils/Openers/OpenAboutPage.ts b/src/seqta/utils/Openers/OpenAboutPage.ts index f06b6785..450daf44 100644 --- a/src/seqta/utils/Openers/OpenAboutPage.ts +++ b/src/seqta/utils/Openers/OpenAboutPage.ts @@ -1,25 +1,17 @@ import stringToHTML from "../stringToHTML"; import { settingsState } from "../listeners/SettingsState"; -import { animate, stagger } from "motion"; -import { DeleteWhatsNew } from "../Whatsnew"; +import { openPopup } from "./PopupManager"; export function OpenAboutPage() { - const background = document.createElement("div"); - background.id = "whatsnewbk"; - background.classList.add("whatsnewBackground"); - - const container = document.createElement("div"); - container.classList.add("whatsnewContainer"); - - var header: any = stringToHTML( + const header = stringToHTML( /* html */ `
About the extension
The official BetterSEQTA+ Minecraft Server