From 54359d51c4c2bd11e4012c717318506e3c9e2920 Mon Sep 17 00:00:00 2001 From: Jones Jankovic Date: Tue, 3 Nov 2026 14:41:37 +1030 Subject: [PATCH] refactor: switch icons to lucide and tidy ui --- package-lock.json | 17 ++ package.json | 2 + src/css/documentload.scss | 199 +++++--------- src/css/injected.scss | 250 +++++++++--------- src/css/tailwind.css | 26 +- src/declarations.d.ts | 1 - src/interface/components/Button.svelte | 10 +- src/interface/components/CloudPanel.svelte | 2 +- .../components/ConnectMobileApp.svelte | 5 +- src/interface/components/FeedbackModal.svelte | 6 +- .../components/PlainCloseButton.svelte | 15 +- .../components/RemoteConfigStatusStrip.svelte | 6 +- src/interface/components/Select.svelte | 23 +- .../components/TabbedContainer.svelte | 4 +- .../colourPicker/GradientPicker.svelte | 44 +-- .../OwnerThemeDetailModal.svelte | 3 +- src/interface/components/fontPickerModal.css | 17 -- .../components/icons/LucideMoon.svelte | 15 -- .../components/icons/LucideSun.svelte | 15 -- .../components/store/Backgrounds.svelte | 6 +- .../components/store/CloudHeader.svelte | 5 +- .../components/store/CoverSwiper.svelte | 19 +- src/interface/components/store/Header.svelte | 26 +- .../components/store/ThemeCard.svelte | 34 +-- .../components/store/ThemeModal.svelte | 69 ++--- .../themes/BackgroundUploader.svelte | 6 +- .../components/themes/ThemeSelector.svelte | 20 +- src/interface/contentShadow.css | 6 - src/interface/index.css | 6 - src/interface/index.ts | 19 -- src/interface/pages/settings.svelte | 52 ++-- src/interface/pages/settings/shortcuts.svelte | 12 +- src/interface/pages/settings/theme.svelte | 5 +- src/interface/pages/themeCreator.svelte | 42 +-- src/lib/extensionAssetUrl.test.ts | 6 +- src/lib/icon.ts | 19 ++ src/lib/icons/lucideMoon.ts | 5 - src/lib/icons/lucideSun.ts | 5 - .../built-in/assessmentsAverage/index.ts | 4 +- .../built-in/assessmentsAverage/rubricCopy.ts | 12 +- .../built-in/assessmentsAverage/utils.ts | 8 +- .../AssessmentsOverview.svelte | 35 +-- .../assessmentsOverview/ErrorState.svelte | 4 +- .../assessmentsOverview/OverviewIcon.svelte | 32 --- .../assessmentsOverview/SkeletonLoader.svelte | 15 +- .../built-in/assessmentsOverview/icons.ts | 80 ++---- .../built-in/assessmentsOverview/styles.css | 10 +- .../BackgroundMusicSetting.svelte | 3 +- .../built-in/enhancedNavigation/index.ts | 6 +- .../src/components/Calculator.svelte | 3 +- .../src/components/SearchBar.svelte | 17 +- .../src/components/SearchIcon.svelte | 48 ++++ .../components/items/AssessmentItem.svelte | 3 +- .../src/components/items/ForumItem.svelte | 3 +- .../src/components/items/GenericItem.svelte | 28 +- .../src/components/items/SubjectItem.svelte | 5 +- .../globalSearch/src/core/commands.ts | 19 +- .../globalSearch/src/core/mountSearchBar.ts | 5 +- .../globalSearch/src/core/searchIcons.ts | 34 +++ .../globalSearch/src/indexing/jobs/courses.ts | 1 - .../src/indexing/jobs/documents.ts | 1 - .../globalSearch/src/indexing/jobs/folio.ts | 1 - .../globalSearch/src/indexing/jobs/goals.ts | 1 - .../globalSearch/src/indexing/jobs/notices.ts | 1 - .../globalSearch/src/indexing/jobs/portals.ts | 1 - .../globalSearch/src/indexing/jobs/reports.ts | 1 - .../src/indexing/passiveObserver.ts | 1 - .../gradeAnalytics/ClassGroupsPanel.svelte | 8 +- .../gradeAnalytics/GradeAnalyticsPage.svelte | 7 +- .../gradeAnalytics/GradeInferencePanel.svelte | 7 +- .../gradeAnalytics/injectAnalyticsMenuItem.ts | 4 +- .../built-in/gradeAnalytics/styles.css | 20 +- src/plugins/built-in/messageFolders/index.ts | 189 +++++++------ .../built-in/messageFolders/styles.css | 6 +- .../injectArchivedNotifications.ts | 4 +- .../ProfilePictureSetting.svelte | 6 +- .../timetable/CalendarSyncControl.svelte | 8 +- src/plugins/built-in/timetable/index.ts | 17 +- .../ClassmatesToolbarChip.svelte | 3 +- .../TimetableClassmatesOptInPopup.svelte | 3 +- .../classmatesToolbarChip.css | 1 - src/plugins/built-in/timetableEdit/index.ts | 5 +- src/plugins/built-in/timetableEdit/styles.css | 7 +- src/plugins/monofile.ts | 18 -- src/resources/fonts/IconFamily.woff | Bin 576720 -> 0 bytes src/resources/icons/betterseqta-icon.svg | 5 - src/seqta/content/MenuItemSVGKey.json | 13 - src/seqta/icons/assessmentsIcon.ts | 5 - src/seqta/icons/coursesIcon.ts | 5 - src/seqta/ui/AddBetterSEQTAElements.ts | 55 ++-- src/seqta/ui/dev/hideSensitiveContent.ts | 2 +- src/seqta/ui/fonts/Manager.ts | 13 +- src/seqta/ui/titlebar/TitleBar.svelte | 16 +- src/seqta/utils/fixedTooltip.ts | 59 ----- src/seqta/utils/founderBadges.ts | 22 +- src/seqta/utils/loaders/LoadEngageHomePage.ts | 10 +- src/seqta/utils/loaders/LoadHomePage.ts | 34 +-- .../openers/OpenCoursesAssessmentsFixPopup.ts | 11 +- .../utils/openers/OpenThemeOfTheMonthPopup.ts | 10 +- src/seqta/utils/pageIcons.ts | 45 ++++ src/seqta/utils/remoteConfig/runtime.ts | 7 +- src/seqta/utils/sidebarMenuIcons.ts | 8 +- src/seqta/utils/tooltip.ts | 35 +++ 103 files changed, 940 insertions(+), 1132 deletions(-) delete mode 100644 src/interface/components/icons/LucideMoon.svelte delete mode 100644 src/interface/components/icons/LucideSun.svelte create mode 100644 src/lib/icon.ts delete mode 100644 src/lib/icons/lucideMoon.ts delete mode 100644 src/lib/icons/lucideSun.ts delete mode 100644 src/plugins/built-in/assessmentsOverview/OverviewIcon.svelte create mode 100644 src/plugins/built-in/globalSearch/src/components/SearchIcon.svelte create mode 100644 src/plugins/built-in/globalSearch/src/core/searchIcons.ts delete mode 100644 src/resources/fonts/IconFamily.woff delete mode 100644 src/resources/icons/betterseqta-icon.svg delete mode 100644 src/seqta/content/MenuItemSVGKey.json delete mode 100644 src/seqta/icons/assessmentsIcon.ts delete mode 100644 src/seqta/icons/coursesIcon.ts delete mode 100644 src/seqta/utils/fixedTooltip.ts create mode 100644 src/seqta/utils/pageIcons.ts create mode 100644 src/seqta/utils/tooltip.ts diff --git a/package-lock.json b/package-lock.json index eac056e7..ee4c9aaa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "@codemirror/state": "^6.7.6", "@codemirror/view": "^6.43.15", "@huggingface/transformers": "^3.8.1", + "@lucide/svelte": "^1.66.0", "@uiw/codemirror-extensions-color": "^4.25.12", "@uiw/codemirror-theme-github": "^4.25.12", "canvas-confetti": "^1.9.4", @@ -31,6 +32,7 @@ "fuse.js": "^7.5.0", "layerchart": "^2.9.2", "localforage": "^1.10.0", + "lucide-static": "^1.66.0", "mathjs": "^15.2.0", "motion": "^14.9.0", "pdfjs-dist": "^6.5.438", @@ -2463,6 +2465,15 @@ "@lezer/common": "^1.0.0" } }, + "node_modules/@lucide/svelte": { + "version": "1.66.0", + "resolved": "https://registry.npmjs.org/@lucide/svelte/-/svelte-1.66.0.tgz", + "integrity": "sha512-G2qFyutQpgk9TY0QYgqXk9rQtUt8p509mFpQzmTpyc894hfRSFhGNcGAVAUgB8znAyVsp5WTF/2vmCwprnNQ/w==", + "license": "ISC", + "peerDependencies": { + "svelte": "^5" + } + }, "node_modules/@marijn/find-cluster-break": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.4.tgz", @@ -8555,6 +8566,12 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, + "node_modules/lucide-static": { + "version": "1.66.0", + "resolved": "https://registry.npmjs.org/lucide-static/-/lucide-static-1.66.0.tgz", + "integrity": "sha512-j8Bjf/f21PtlD8p0wx1lRxyOrs98WZ1QEImkWmfskuJ8mOCwTN7Dwc6EHUzJDSzh79aB+Bo7SWcoTCM2zEjnJg==", + "license": "ISC" + }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", diff --git a/package.json b/package.json index 0376b668..e8e62bcc 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@codemirror/state": "^6.7.6", "@codemirror/view": "^6.43.15", "@huggingface/transformers": "^3.8.1", + "@lucide/svelte": "^1.66.0", "@uiw/codemirror-extensions-color": "^4.25.12", "@uiw/codemirror-theme-github": "^4.25.12", "canvas-confetti": "^1.9.4", @@ -57,6 +58,7 @@ "fuse.js": "^7.5.0", "layerchart": "^2.9.2", "localforage": "^1.10.0", + "lucide-static": "^1.66.0", "mathjs": "^15.2.0", "motion": "^14.9.0", "pdfjs-dist": "^6.5.438", diff --git a/src/css/documentload.scss b/src/css/documentload.scss index 3c83367f..87fd2f11 100644 --- a/src/css/documentload.scss +++ b/src/css/documentload.scss @@ -26,28 +26,17 @@ font-display: swap; } -@font-face { - font-family: "IconFamily"; - src: url("@/resources/fonts/IconFamily.woff") format("woff"); - font-weight: normal; - font-style: normal; - font-display: block; -} - @layer base, override; @layer override { .legacy-root, - .legacy-root *:not(.iconFamily) { + .legacy-root * { font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; } +} - .iconFamily, - .iconFamily *, - [class~="iconFamily"], - [class~="iconFamily"] * { - font-family: "IconFamily" !important; - } +:root { + --bsplus-focus-ring: 2px solid var(--text-primary, currentColor); } html { @@ -56,126 +45,78 @@ html { font-family: Roboto, system-ui, -apple-system, sans-serif !important; } -.tooltip svg { - fill: var(--theme-primary); -} -.tooltip { - display: inline-block; - z-index: 5 !important; - width: 28px; - background: none; - box-shadow: none; - padding: 2px; - position: absolute; -} -.tooltip .tooltiptext { - width: 120px; - transform: scale(0); - transition: transform 0.2s; - transform-origin: top; - background: var(--background-primary); - color: var(--text-primary); +.bsplus-tooltip-bubble { + position: fixed; + inset: auto; + margin: 0; + min-width: 50px; + max-width: 220px; + padding: 4px; + border: 0; + border-radius: 8px; + overflow: visible; + background: var(--text-primary); + color: var(--background-primary); text-align: center; - border-radius: 6px; - padding: 2px; - position: absolute; - z-index: 1; - top: 105%; - left: 50%; - margin-left: -62px; + transform: translateX(-50%) scale(0); + transform-origin: top center; + transition: + transform 0.15s, + overlay 0.15s allow-discrete, + display 0.15s allow-discrete; + + &:popover-open { + transform: translateX(-50%) scale(1); + } + + &::before { + content: ""; + position: absolute; + bottom: 100%; + left: 0; + width: 100%; + height: 8px; + } + + &::after { + content: ""; + position: absolute; + bottom: 100%; + left: 50%; + margin-left: -5px; + border: 5px solid transparent; + border-bottom-color: var(--text-primary); + } + + a, + button { + display: block; + width: 100%; + border-radius: 6px; + padding: 2px 8px; + color: inherit; + text-decoration: none; + transition: background 200ms; + + &:hover { + background: color-mix(in srgb, var(--background-primary) 20%, transparent); + } + } } -.tooltip .tooltiptext::after { - content: ""; - position: absolute; - bottom: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: transparent transparent var(--text-primary) transparent; +.bsplus-tooltip:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; + border-radius: 50%; } -.tooltiptext p:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.3) !important; - transition: 200ms; -} -.tooltiptext p { - border-radius: 8px !important; - padding-top: 2px; - padding-bottom: 2px; - margin: 2px; -} -.tooltip:hover .tooltiptext { - transform: scale(1); - transform-origin: top; - transition: transform 0.2s; -} -body:has(.outside-container:not(.hide)) #AddedSettings.tooltip:hover > .tooltiptext { - transform: scale(0); -} -.assessmenttooltip svg { - fill: var(--text-primary); +@starting-style { + .bsplus-tooltip-bubble:popover-open { + transform: translateX(-50%) scale(0); + } } .assessmenttooltip { - bottom: 0px; + position: absolute; + bottom: 0; left: 5px; -} -.topmenutooltip { - top: 115% !important; - background: var(--text-primary) !important; - color: var(--theme-primary) !important; -} -.fixed-tooltip { - display: inline-block; - z-index: 5 !important; width: 28px; - background: none; - box-shadow: none; padding: 2px; - position: absolute; -} -.fixed-tooltip svg { - fill: var(--theme-primary); -} -.tooltiptext-fixed { - width: 120px; - transform: scale(0); - transition: transform 0.2s; - transform-origin: top; - background: var(--background-primary); - color: var(--text-primary); - text-align: center; - border-radius: 6px; - padding: 2px; - position: fixed; - z-index: 1000; - top: 0; - left: 0; - margin-left: -62px; -} -.tooltiptext-fixed::after { - content: ""; - position: absolute; - bottom: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: transparent transparent var(--text-primary) transparent; -} -.tooltiptext-fixed.show { - transform: scale(1); - transform-origin: top; - transition: transform 0.2s; -} -.tooltiptext-fixed p:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.3) !important; - transition: 200ms; -} -.tooltiptext-fixed p { - border-radius: 8px !important; - padding-top: 2px; - padding-bottom: 2px; - margin: 2px; } diff --git a/src/css/injected.scss b/src/css/injected.scss index 9bc8e0ba..96f04e20 100644 --- a/src/css/injected.scss +++ b/src/css/injected.scss @@ -31,20 +31,23 @@ pointer-events: none; } -.hidden { - display: none; +@mixin lucide-icon($name, $size) { + content: ""; + display: inline-block; + width: $size; + height: $size; + background: currentColor; + mask: url("lucide-static/icons/#{$name}.svg") center / contain no-repeat; } -button.timetable-zoom.iconFamily, -button.bsplus-timetable-control.iconFamily, -.iconFamily { - font-family: "IconFamily" !important; +.hidden { + display: none; } body, .legacy-root input, .legacy-root textarea, -.legacy-root button:not(.iconFamily), +.legacy-root button, .legacy-root select, .legacy-root option, .legacy-root .input, @@ -87,14 +90,16 @@ select:hover { } select:focus { - outline: none !important; background: var(--theme-secondary, var(--background-secondary)) !important; border-color: color-mix( in srgb, var(--text-primary) 18%, var(--theme-offset-bg, var(--theme-secondary, var(--background-secondary))) 82% ) !important; - box-shadow: 0 0 0 1px color-mix(in srgb, var(--text-primary) 12%, transparent) !important; +} +select:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } select:not([multiple]):not([size]), @@ -133,7 +138,7 @@ select option { background: var(--auto-background) !important; } .legacy-root, -.legacy-root *:not(.iconFamily) { +.legacy-root * { font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; } @@ -210,9 +215,6 @@ html:not(.dark) .legacy-root { pointer-events: none !important; } -.connectedNotificationsWrapper > div > button > svg > g { - fill: var(--theme-primary) !important; -} #main { color: var(--text-primary); position: relative; @@ -269,7 +271,7 @@ html:not(.dark) .legacy-root { } &:focus-visible { - outline: 2px solid var(--better-main); + outline: var(--bsplus-focus-ring) !important; outline-offset: 2px; } } @@ -363,6 +365,10 @@ html:not(.dark) .legacy-root { cursor: pointer; padding: 4px 8px; } +.legacy-root .bsplus-timetable-control > svg { + width: 16px; + height: 16px; +} #main > .dashboard { grid-template-columns: repeat(autofit, minmax(200px, 400px)) !important; @@ -447,7 +453,6 @@ ul.magicDelete > li.deleting { display: block; margin: 0; flex-shrink: 0; - fill: var(--theme-primary); color: var(--theme-primary); } #menu, @@ -1232,15 +1237,12 @@ td.colourBar { padding-left: 30px; } #toolbar span:has(.search)::before { - content: "\eca5"; + @include lucide-icon("search", 16px); position: absolute; left: 8px; z-index: 10; top: 50%; transform: translateY(-50%); - color: currentColor; - font-size: 16px; - font-family: "IconFamily"; pointer-events: none; } #container #content .search { @@ -1368,6 +1370,10 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l .assessmentsWrapper .message { display: none; } +#menu li, +#menu section { + cursor: pointer; +} #menu li:hover:not(.active) { background: rgba(0, 0, 0, 0.15) !important; } @@ -1377,8 +1383,8 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l #menu li:focus-visible, #menu section:focus-visible { - outline: 1px solid rgb(from currentColor r g b / 0.55); - outline-offset: -1px; + outline: var(--bsplus-focus-ring) !important; + outline-offset: -2px; background: rgba(0, 0, 0, 0.2) !important; } @@ -2027,6 +2033,15 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l z-index: 21 !important; color: var(--better-sub); padding: 8px; + + > svg { + display: none; + } + + &::before { + @include lucide-icon(bell, 24px); + background: var(--theme-primary); + } } .legacy-root button > svg, .legacy-root a > svg { @@ -2038,12 +2053,6 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l width: 25px; height: 25px; } -.dark .legacy-root button.iconFamily::after { - background: white; -} -.legacy-root button.iconFamily::after { - background: currentColor; -} .legacy-root button:not([disabled]):focus { border-color: var(--better-sub); } @@ -2057,8 +2066,6 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l margin-bottom: 4px !important; > [class*="notifications__dismiss___"] { - background: rgba(0, 0, 0, 0.1) !important; - color: var(--text-primary); margin: auto 0; } @@ -2100,10 +2107,27 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l } [class*="notifications__actions___"] { background: var(--auto-background); +} +[class*="notifications__actions___"] button, +[class*="notifications__dismiss___"] { + border: none !important; + border-radius: 8px !important; + box-shadow: none !important; + background: color-mix(in srgb, var(--text-primary) 10%, transparent) !important; + color: var(--text-primary) !important; + transition: background 200ms; - button { - background: none !important; - border: 1px solid white; + &::after { + content: none !important; + } + + &:hover { + background: color-mix(in srgb, var(--text-primary) 18%, transparent) !important; + } + + &:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } } [class*="notifications__details___"] { @@ -2140,7 +2164,6 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l content: ""; font-size: 12px; margin-right: 4px; - font-family: "IconFamily"; pointer-events: none; } @@ -2176,7 +2199,6 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l font-size: 16px; margin-left: 8px; margin-top: auto; - font-family: "IconFamily"; pointer-events: none; } [class*="Input__Input___"] { @@ -3252,18 +3274,40 @@ body:not(.clr-open) .clr-picker, justify-content: space-between; align-items: center; } -.logout { +.bsplus-tooltip-bubble .bsplus-logout { + display: flex; + align-items: center; + justify-content: center; + width: 36px; + height: 32px; + padding: 0; + border: none !important; + border-radius: 6px; + box-shadow: none !important; background: none !important; - padding: 5px 10px; -} + color: var(--background-primary) !important; + opacity: 1; + cursor: pointer; + transition: opacity 150ms; -#logouttooltip { - width: 50px !important; - margin-left: -28px !important; - top: 105% !important; + &::after { + content: none !important; + } - .uiButton svg g { - color: var(--background-primary) !important; + svg { + width: 20px; + height: 20px; + fill: none !important; + stroke: currentColor !important; + } + + &:hover { + opacity: 0.7; + } + + &:focus-visible { + outline: 2px solid var(--background-primary) !important; + outline-offset: -2px; } } .svg { @@ -3300,35 +3344,23 @@ body:not(.clr-open) .clr-picker, align-items: center; } [data-label="inbox"] > [class*="LabelList__name___"]::before { - content: "\eb70"; - color: currentColor; - font-size: 16px; + @include lucide-icon("inbox", 16px); margin-right: 8px; - font-family: "IconFamily"; pointer-events: none; } [data-label="outbox"] > [class*="LabelList__name___"]::before { - content: "\eca6"; - color: currentColor; - font-size: 16px; + @include lucide-icon("send", 16px); margin-right: 8px; - font-family: "IconFamily"; pointer-events: none; } [data-label="starred"] > [class*="LabelList__name___"]::before { - content: "\ece8"; - color: currentColor; - font-size: 16px; + @include lucide-icon("star", 16px); margin-right: 8px; - font-family: "IconFamily"; pointer-events: none; } [data-label="trash"] > [class*="LabelList__name___"]::before { - content: "\ed2c"; - color: currentColor; - font-size: 16px; + @include lucide-icon("trash", 16px); margin-right: 8px; - font-family: "IconFamily"; pointer-events: none; } .outer-circle { @@ -3365,6 +3397,7 @@ body:not(.clr-open) .clr-picker, width: 25px; position: absolute; bottom: 20px; + color: inherit; } #userActions > .details > .code { text-transform: initial; @@ -3785,11 +3818,9 @@ div.day-empty { color 0.2s ease-in-out; } -.engage-child-select:focus { - outline: none; - box-shadow: - 0 0 0 2px var(--background-primary), - 0 0 0 4px rgba(59, 130, 246, 0.45); +.engage-child-select:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } #engage-day-container:has(> .day-empty) { @@ -3806,27 +3837,6 @@ div.day-empty { text-align: center; } -#engage-logouttooltip { - width: 50px !important; - margin-left: -28px !important; - top: 105% !important; - - .engage-logout { - background: none !important; - border: none; - cursor: pointer; - color: var(--background-primary) !important; - width: 100%; - display: flex; - align-items: center; - justify-content: center; - padding: 5px; - - svg { - fill: var(--background-primary) !important; - } - } -} .pagename { align-items: center; display: flex; @@ -3924,7 +3934,7 @@ div.day-empty { visibility 0s linear 0.45s; } .titlebar .bsplus-titlebar-badge:focus-visible { - outline: 2px solid var(--theme-primary); + outline: var(--bsplus-focus-ring) !important; outline-offset: 2px; } .bsplus-founder-badge-slot--static .bsplus-titlebar-badge { @@ -3973,17 +3983,9 @@ div.day-empty { .bsplus-founder-badge:hover { transform: scale(1.02); } -.bsplus-founder-badge:focus { - outline: none; -} -.bsplus-founder-badge:focus-visible .bsplus-founder-badge__glass { - box-shadow: - inset 0 0 0 1px rgba(255, 255, 255, 0.78), - inset 0 1px 0 rgba(255, 255, 255, 0.52), - inset 0 2px 8px rgba(255, 255, 255, 0.14), - inset 0 -1px 0 rgba(0, 0, 0, 0.08), - 0 0 0 2px var(--theme-primary, #f97316), - 0 0 0 4px rgba(249, 115, 22, 0.35); +.bsplus-founder-badge:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-founder-badge__glass { position: relative; @@ -4155,10 +4157,8 @@ div.day-empty { transition: all 0.2s ease; } .bsplus-founder-badge-actions .bsplus-cal-btn:focus-visible { - outline: none; - box-shadow: - 0 0 0 2px var(--background-primary, #fff), - 0 0 0 4px var(--better-main, #3b82f6); + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-founder-badge-actions .bsplus-cal-btn--ghost { background: color-mix(in srgb, var(--text-primary, #111) 8%, transparent); @@ -4186,6 +4186,9 @@ div.day-empty { z-index: 3; position: absolute; } +.userInfosvg path { + transition: fill 200ms; +} .userInfosvgdiv { width: 50px !important; height: 50px !important; @@ -4207,9 +4210,7 @@ div.day-empty { left: 15%; transition: background 200ms; } -.userInfosvg path { - transition: fill 200ms; -} + .userInfohouse { padding: 2px 8px; font-size: 14px; @@ -4484,14 +4485,9 @@ div.day-empty { transition: all 0.2s ease-in-out; } - .bsplus-tos-btn:focus { - outline: none; - } - .bsplus-tos-btn:focus-visible { - box-shadow: - 0 0 0 2px var(--background-primary), - 0 0 0 4px color-mix(in srgb, var(--text-primary) 45%, transparent); + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-tos-btn--primary { @@ -4599,6 +4595,13 @@ div.day-empty { .whatsnewFooter a { border: none; } +.whatsnewFooter .socials { + display: flex; + align-items: center; + margin: 0 5px; + padding: 0; + background: none !important; +} .whatsnewFooter div { margin: 0 15px; display: flex; @@ -4613,10 +4616,7 @@ div.day-empty { cursor: pointer; } #whatsnewclosebutton::before { - content: "\ed8a"; - color: currentColor; - font-size: 24px; - font-family: "IconFamily"; + @include lucide-icon("x", 24px); pointer-events: none; } .whatsnewTextContainer h1:not(.whatsnewTextHeader) { @@ -5243,12 +5243,19 @@ div.day-empty { .popup-media-fullscreenable:hover { opacity: 0.95; } -.popup-media-fullscreenable:focus { - outline: none; +[class*="Input__Input___"]:has(> input:focus-visible) { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; +} +.betterseqta-weight-input:focus-visible, +#betterseqta-weight-override:focus-visible, +#theme-of-the-month-card button:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .popup-media-fullscreenable:focus-visible { - outline: 2px solid color-mix(in srgb, var(--text-primary) 70%, transparent); - outline-offset: 4px; + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-popup-media-overlay-backdrop { @@ -5934,10 +5941,7 @@ h2.home-subtitle { } .bsplus-ld-surprise-close::before { - content: "\ed8a"; - font-family: "IconFamily"; - font-size: 20px; - line-height: 1; + @include lucide-icon("x", 20px); pointer-events: none; } diff --git a/src/css/tailwind.css b/src/css/tailwind.css index 835483b5..90311e3c 100644 --- a/src/css/tailwind.css +++ b/src/css/tailwind.css @@ -26,8 +26,6 @@ --text-13xl: 16rem; --text-14xl: 18rem; - --font-IconFamily: IconFamily; - --animate-spin-fast: spin 0.4s linear infinite; --aspect-theme: 5 / 1; @@ -45,4 +43,28 @@ button { cursor: pointer; } + + :root, + :host { + --bsplus-focus-ring: 2px solid var(--color-zinc-900); + } + + .dark { + --bsplus-focus-ring: 2px solid var(--color-white); + } + + input:focus, + textarea:focus, + select:focus { + box-shadow: none !important; + } + + :focus-visible, + input:focus-visible, + [type]:focus-visible, + textarea:focus-visible, + select:focus-visible { + outline: var(--bsplus-focus-ring); + outline-offset: 2px; + } } diff --git a/src/declarations.d.ts b/src/declarations.d.ts index c1e8d554..5bf1d525 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -1,6 +1,5 @@ declare module "*.mp4"; declare module "*.webm"; -declare module "*.woff"; declare module "*.scss"; declare module "*.png"; declare module "*.webp"; diff --git a/src/interface/components/Button.svelte b/src/interface/components/Button.svelte index 7750f52f..7b56d0d5 100644 --- a/src/interface/components/Button.svelte +++ b/src/interface/components/Button.svelte @@ -1,17 +1,19 @@ - - diff --git a/src/interface/components/icons/LucideSun.svelte b/src/interface/components/icons/LucideSun.svelte deleted file mode 100644 index 97a9cab0..00000000 --- a/src/interface/components/icons/LucideSun.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/src/interface/components/store/Backgrounds.svelte b/src/interface/components/store/Backgrounds.svelte index 4301274f..89462266 100644 --- a/src/interface/components/store/Backgrounds.svelte +++ b/src/interface/components/store/Backgrounds.svelte @@ -1,4 +1,6 @@
- +

Failed to load assessments

{error}

diff --git a/src/plugins/built-in/assessmentsOverview/OverviewIcon.svelte b/src/plugins/built-in/assessmentsOverview/OverviewIcon.svelte deleted file mode 100644 index f8597cd3..00000000 --- a/src/plugins/built-in/assessmentsOverview/OverviewIcon.svelte +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/src/plugins/built-in/assessmentsOverview/SkeletonLoader.svelte b/src/plugins/built-in/assessmentsOverview/SkeletonLoader.svelte index 10272384..aec940e1 100644 --- a/src/plugins/built-in/assessmentsOverview/SkeletonLoader.svelte +++ b/src/plugins/built-in/assessmentsOverview/SkeletonLoader.svelte @@ -1,18 +1,17 @@ @@ -40,7 +39,7 @@
- + {column.title} … diff --git a/src/plugins/built-in/assessmentsOverview/icons.ts b/src/plugins/built-in/assessmentsOverview/icons.ts index e953ac92..02a2412e 100644 --- a/src/plugins/built-in/assessmentsOverview/icons.ts +++ b/src/plugins/built-in/assessmentsOverview/icons.ts @@ -1,60 +1,28 @@ -/** Heroicons v2 outline paths (https://heroicons.com) */ -export type OverviewIconName = - | "calendar-days" - | "clock" - | "exclamation-triangle" - | "document-check" - | "check-circle" - | "book-open" - | "calendar" - | "chart-bar" - | "queue-list" - | "eye" - | "clipboard-document-list" - | "ellipsis-vertical" - | "exclamation-circle"; +import BookOpenIcon from "@lucide/svelte/icons/book-open"; +import CalendarIcon from "@lucide/svelte/icons/calendar"; +import CalendarDaysIcon from "@lucide/svelte/icons/calendar-days"; +import ChartColumnIcon from "@lucide/svelte/icons/chart-column"; +import CircleCheckIcon from "@lucide/svelte/icons/circle-check"; +import ClockIcon from "@lucide/svelte/icons/clock"; +import FileCheckIcon from "@lucide/svelte/icons/file-check"; +import ListIcon from "@lucide/svelte/icons/list"; +import TriangleAlertIcon from "@lucide/svelte/icons/triangle-alert"; -export const OVERVIEW_ICON_PATHS: Record = { - "calendar-days": - "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5", - clock: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z", - "exclamation-triangle": - "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z", - "document-check": - "M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9zm3.75 8.625a2.625 2.625 0 100-5.25 2.625 2.625 0 000 5.25zm0 0l-3 3m3-3l3 3", - "check-circle": "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z", - "book-open": - "M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25", - calendar: - "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5", - "chart-bar": - "M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z", - "queue-list": - "M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z", - eye: [ - "M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z", - "M15 12a3 3 0 11-6 0 3 3 0 016 0z", - ], - "clipboard-document-list": [ - "M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zM3.75 12h.007v.008H3.75V12zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zM3.75 17.25h.007v.008H3.75v-.008zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z", - "M8.25 6.75V4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V6.75H8.25z", - ], - "ellipsis-vertical": - "M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z", - "exclamation-circle": "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z", +export type OverviewIcon = typeof ListIcon; + +export const DEFAULT_COLUMN_ICON: OverviewIcon = ListIcon; + +export const STATUS_COLUMN_ICONS: Record = { + UPCOMING: CalendarDaysIcon, + DUE_SOON: ClockIcon, + OVERDUE: TriangleAlertIcon, + SUBMITTED: FileCheckIcon, + MARKS_RELEASED: CircleCheckIcon, }; -export const STATUS_COLUMN_ICONS: Record = { - UPCOMING: "calendar-days", - DUE_SOON: "clock", - OVERDUE: "exclamation-triangle", - SUBMITTED: "document-check", - MARKS_RELEASED: "check-circle", -}; - -export const GROUP_SORT_ICONS: Record = { - year: "calendar", - subject: "book-open", - grade: "chart-bar", - title: "queue-list", +export const GROUP_SORT_ICONS: Record = { + year: CalendarIcon, + subject: BookOpenIcon, + grade: ChartColumnIcon, + title: ListIcon, }; diff --git a/src/plugins/built-in/assessmentsOverview/styles.css b/src/plugins/built-in/assessmentsOverview/styles.css index dd5dea16..689b2910 100644 --- a/src/plugins/built-in/assessmentsOverview/styles.css +++ b/src/plugins/built-in/assessmentsOverview/styles.css @@ -150,10 +150,9 @@ color: var(--bsplus-overview-text); } -.filter-select:focus { - outline: none; - border-color: var(--bsplus-overview-accent); - box-shadow: 0 0 0 3px color-mix(in srgb, var(--bsplus-overview-accent) 22%, transparent); +.filter-select:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .filter-select:hover { @@ -365,7 +364,8 @@ } .menu-button:focus-visible { - box-shadow: 0 0 0 2px color-mix(in srgb, var(--bsplus-overview-accent) 35%, transparent) !important; + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .menu-dropdown { diff --git a/src/plugins/built-in/backgroundMusic/BackgroundMusicSetting.svelte b/src/plugins/built-in/backgroundMusic/BackgroundMusicSetting.svelte index d69c43de..5a2624be 100644 --- a/src/plugins/built-in/backgroundMusic/BackgroundMusicSetting.svelte +++ b/src/plugins/built-in/backgroundMusic/BackgroundMusicSetting.svelte @@ -1,4 +1,5 @@ + + diff --git a/src/plugins/built-in/globalSearch/src/components/items/AssessmentItem.svelte b/src/plugins/built-in/globalSearch/src/components/items/AssessmentItem.svelte index 939a2bbb..5489ebdd 100644 --- a/src/plugins/built-in/globalSearch/src/components/items/AssessmentItem.svelte +++ b/src/plugins/built-in/globalSearch/src/components/items/AssessmentItem.svelte @@ -1,4 +1,5 @@ - + +
${slides .map( @@ -212,8 +214,8 @@ function renderGallerySlidesHtml(slides: PopupGallerySlide[]): string { `; } -const POPOUT_EXPAND_SVG = /* svg */ ``; -const POPOUT_COLLAPSE_SVG = /* svg */ ``; +const POPOUT_EXPAND_SVG = /* svg */ icon(Maximize2, { size: 15 }); +const POPOUT_COLLAPSE_SVG = /* svg */ icon(Minimize2, { size: 15 }); const TOTM_MARGIN_PX = 18; const TOTM_EXPANDED_SHELL_MAX_PX = 560; diff --git a/src/seqta/utils/pageIcons.ts b/src/seqta/utils/pageIcons.ts new file mode 100644 index 00000000..8c8ed91b --- /dev/null +++ b/src/seqta/utils/pageIcons.ts @@ -0,0 +1,45 @@ +import { icon } from "@/lib/icon"; +import { + AppWindow, + BookOpen, + Calendar, + ChartLine, + ClipboardList, + FileChartColumn, + FolderOpen, + GraduationCap, + Hand, + House, + LayoutDashboard, + Megaphone, + MessageSquare, + MessagesSquare, + Newspaper, + Settings, + Target, +} from "lucide-static"; + +const PAGE_ICONS: Record = { + analytics: ChartLine, + assessments: ClipboardList, + courses: BookOpen, + dashboard: LayoutDashboard, + documents: FolderOpen, + forums: MessagesSquare, + goals: Target, + home: House, + messages: MessageSquare, + myed: GraduationCap, + news: Newspaper, + notices: Megaphone, + portals: AppWindow, + reports: FileChartColumn, + settings: Settings, + timetable: Calendar, + welcome: Hand, +}; + +export function pageIcon(key: string): string | undefined { + const svg = PAGE_ICONS[key]; + return svg && icon(svg); +} diff --git a/src/seqta/utils/remoteConfig/runtime.ts b/src/seqta/utils/remoteConfig/runtime.ts index d2c08f50..ad7b9499 100644 --- a/src/seqta/utils/remoteConfig/runtime.ts +++ b/src/seqta/utils/remoteConfig/runtime.ts @@ -1,3 +1,5 @@ +import { icon } from "@/lib/icon"; +import { Wrench } from "lucide-static"; import browser from "@/lib/browser"; import stringToHTML from "@/seqta/utils/stringToHTML"; import { addExtensionSettings } from "@/seqta/utils/adders/AddExtensionSettings"; @@ -278,10 +280,7 @@ export async function ensureKilledModeSettingsAccess(): Promise { parent.append( stringToHTML(/* html */ ` `).firstChild!, ); diff --git a/src/seqta/utils/sidebarMenuIcons.ts b/src/seqta/utils/sidebarMenuIcons.ts index 7eb51748..669cf59e 100644 --- a/src/seqta/utils/sidebarMenuIcons.ts +++ b/src/seqta/utils/sidebarMenuIcons.ts @@ -1,4 +1,4 @@ -import MenuitemSVGKey from "@/seqta/content/MenuItemSVGKey.json"; +import { pageIcon } from "@/seqta/utils/pageIcons"; import { ChangeMenuItemPositions } from "@/seqta/utils/openers/menuOrder"; import { isMenuOptionsOpen } from "@/seqta/utils/openers/menuOptionsState"; import { settingsState } from "@/seqta/utils/listeners/SettingsState"; @@ -61,9 +61,9 @@ export function replaceMenuSVG(element: HTMLElement, svg: string) { export function processMenuItemNode(node: HTMLElement) { if (!isTopLevelSidebarItem(node) || isMenuOptionsOpen()) return; - const key = node.dataset.key as keyof typeof MenuitemSVGKey | undefined; - if (key && MenuitemSVGKey[key]) { - replaceMenuSVG(node, MenuitemSVGKey[key]); + const svg = node.dataset.key ? pageIcon(node.dataset.key) : undefined; + if (svg) { + replaceMenuSVG(node, svg); } else { const label = getMenuLabel(node); if (label) wrapMenuLabelText(label); diff --git a/src/seqta/utils/tooltip.ts b/src/seqta/utils/tooltip.ts new file mode 100644 index 00000000..5d143f7d --- /dev/null +++ b/src/seqta/utils/tooltip.ts @@ -0,0 +1,35 @@ +const GAP_PX = 8; + +export function attachTooltip(anchor: HTMLElement) { + const bubble = anchor.querySelector(":scope > .bsplus-tooltip-bubble"); + if (!bubble || bubble.popover) return; + bubble.popover = "manual"; + + const isOpen = () => bubble.matches(":popover-open"); + + const show = () => { + if (isOpen()) return; + const rect = anchor.getBoundingClientRect(); + bubble.style.left = `${rect.left + rect.width / 2}px`; + bubble.style.top = `${rect.bottom + GAP_PX}px`; + bubble.showPopover(); + }; + const hide = () => { + if (isOpen()) bubble.hidePopover(); + }; + + anchor.addEventListener("pointerenter", show); + anchor.addEventListener("pointerleave", hide); + anchor.addEventListener("focusin", show); + anchor.addEventListener("focusout", (event) => { + if (!anchor.contains(event.relatedTarget as Node | null)) hide(); + }); + anchor.addEventListener("keydown", (event) => { + if (event.key === "Escape") hide(); + }); + bubble.addEventListener("click", hide); +} + +export function setupTooltips(root: ParentNode = document) { + root.querySelectorAll(".bsplus-tooltip").forEach(attachTooltip); +}