refactor: switch icons to lucide and tidy ui

This commit is contained in:
Jones Jankovic committed 2026-11-03 14:41:37 +10:30
1 parent 64126439c6
commit 54359d51c4
103 files changed
+940 -1132

No files matched your search

+17
View File
@@ -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",
+2
View File
@@ -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",
+70 -129
View File
@@ -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;
}
+127 -123
View File
@@ -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;
}
+24 -2
View File
@@ -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;
}
}
-1
View File
@@ -1,6 +1,5 @@
declare module "*.mp4";
declare module "*.webm";
declare module "*.woff";
declare module "*.scss";
declare module "*.png";
declare module "*.webp";
+6 -4
View File
@@ -1,17 +1,19 @@
<script lang="ts">
import type { Component } from "svelte";
let {
onClick,
text,
disabled = false,
variant = "secondary",
icon,
icon: Icon,
class: className = "",
}: {
onClick: () => void;
text: string;
disabled?: boolean;
variant?: "primary" | "secondary" | "ghost";
icon?: string;
icon?: Component<{ class?: string; size?: string | number }>;
class?: string;
} = $props();
@@ -26,8 +28,8 @@
type="button"
onclick={onClick}
disabled={disabled}
class="inline-flex items-center justify-center gap-1.5 px-5 py-1.5 text-[0.75rem] shadow-2xl border rounded-lg transition enabled:active:scale-[0.96] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-zinc-400 disabled:cursor-not-allowed disabled:opacity-50 {variants[variant]} {className}"
class="inline-flex items-center justify-center gap-1.5 px-5 py-1.5 text-[0.75rem] shadow-2xl border rounded-lg transition enabled:active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-50 {variants[variant]} {className}"
>
{#if icon}<span class="font-IconFamily text-base" aria-hidden="true">{icon}</span>{/if}
{#if Icon}<Icon size="1em" class="text-base" />{/if}
{text}
</button>
+1 -1
View File
@@ -140,7 +140,7 @@
<p class="text-sm text-zinc-600 dark:text-zinc-400">
Sign in to sync settings across devices, use your cloud profile picture, and more.
</p>
<Button class="w-full" icon={""} text="Sign in with BetterSEQTA Cloud" onClick={handleSignIn} />
<Button class="w-full" text="Sign in with BetterSEQTA Cloud" onClick={handleSignIn} />
{#if loginError}
<p class="text-xs text-red-600 dark:text-red-400">{loginError}</p>
{/if}
@@ -1,4 +1,5 @@
<script lang="ts">
import XIcon from "@lucide/svelte/icons/x";
import { fade } from "svelte/transition";
import browser from "@/lib/browser";
import QRCode from "qrcode";
@@ -138,9 +139,7 @@
onclick={closeModal}
class="p-2 rounded-lg transition-colors text-zinc-500 hover:text-zinc-700 hover:bg-zinc-100 dark:hover:text-zinc-400 dark:hover:bg-zinc-700"
aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
<XIcon class="w-5 h-5" />
</button>
</div>
<div class="flex justify-center p-4 bg-white rounded-xl dark:bg-zinc-900">
@@ -57,9 +57,9 @@
: "background-color:#fff;color:#18181b;border-color:#e4e4e7;color-scheme:light",
);
const field =
"feedback-field w-full px-3 py-2.5 text-[18px] rounded-lg border focus:outline-hidden focus:ring-2 focus:ring-zinc-400";
"feedback-field w-full px-3 py-2.5 text-[18px] rounded-lg border ";
const btn =
"px-4 py-2 text-[18px] font-medium rounded-lg transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-zinc-400 disabled:opacity-50";
"px-4 py-2 text-[18px] font-medium rounded-lg transition-all duration-200 hover:scale-105 active:scale-95 disabled:opacity-50";
const btnMuted = $derived(
`${btn} ${isDark ? "bg-zinc-700 text-zinc-200" : "bg-zinc-200 text-zinc-700"}`,
);
@@ -461,7 +461,7 @@
<button
type="button"
onclick={() => openStatusItem(item.id)}
class="w-full p-3 text-left rounded-lg border transition-all duration-200 hover:scale-[1.01] focus:outline-hidden focus:ring-2 focus:ring-zinc-400 {isDark
class="w-full p-3 text-left rounded-lg border transition-all duration-200 hover:scale-[1.01] {isDark
? 'border-zinc-700 bg-zinc-900/40'
: 'border-zinc-200 bg-white'}"
>
@@ -1,4 +1,5 @@
<script lang="ts">
import XIcon from "@lucide/svelte/icons/x";
let { onclick, label = "Close" }: {
onclick: () => void;
label?: string;
@@ -8,18 +9,8 @@
<button
type="button"
{onclick}
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden dark:text-zinc-400 dark:hover:text-white"
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] dark:text-zinc-400 dark:hover:text-white"
aria-label={label}
>
<svg
class="h-6 w-6"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
aria-hidden="true"
>
<path d="M6 6l12 12M18 6 6 18" />
</svg>
<XIcon class="h-6 w-6" />
</button>
@@ -65,7 +65,7 @@
{#if activeTheme?.mode === "optional" && snapshot.remoteTheme?.allowUserOptOut !== false}
<button
type="button"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95"
onclick={() => void turnOffOptionalTheme()}
>
Turn off school theme
@@ -74,7 +74,7 @@
{#if killActive && !isEffectiveBsplusEnabled() && allowOverride}
<button
type="button"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95"
onclick={enableLocalRun}
>
Run locally anyway
@@ -86,7 +86,7 @@
{/if}
<button
type="button"
class="rounded-lg border border-amber-300/80 px-3 py-1.5 text-xs font-medium transition-colors duration-200 hover:bg-amber-100/80 focus:outline-hidden focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:border-amber-800 dark:hover:bg-amber-900/50 dark:focus:ring-offset-zinc-900"
class="rounded-lg border border-amber-300/80 px-3 py-1.5 text-xs font-medium transition-colors duration-200 hover:bg-amber-100/80 dark:border-amber-800 dark:hover:bg-amber-900/50"
onclick={openGeneralSettings}
>
General settings
+4 -19
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import ChevronDownIcon from "@lucide/svelte/icons/chevron-down";
let { value, onChange, options }: {
value: string,
onChange: (newValue: string) => void,
@@ -103,13 +104,7 @@
{options.find((option) => option.value === value)?.label ?? value}
</span>
<span class="select-icon shrink-0" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="currentColor" class="h-4 w-4">
<path
fill-rule="evenodd"
d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.168l3.71-3.938a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z"
clip-rule="evenodd"
/>
</svg>
<ChevronDownIcon class="h-4 w-4" />
</span>
</button>
@@ -147,8 +142,7 @@
--sel-border: var(--theme-offset-bg, var(--theme-secondary, #e5e7eb));
--sel-bg: var(--theme-primary, #ffffff);
--sel-surface: var(--theme-secondary, #e5e7eb);
--sel-focus-border: color-mix(in srgb, var(--text-primary) 22%, var(--theme-secondary, #e5e7eb) 78%);
--sel-ring: 0 0 0 1px color-mix(in srgb, var(--text-primary) 12%, transparent);
--sel-menu-shadow:
0 10px 25px -5px rgb(0 0 0 / 0.25),
0 8px 10px -6px rgb(0 0 0 / 0.2);
@@ -160,16 +154,8 @@
color: var(--text-primary);
}
.select-trigger:hover,
.select-trigger:focus-visible {
outline: none;
.select-trigger:hover {
background: var(--sel-surface);
border-color: var(--sel-border);
}
.select-trigger:focus-visible {
border-color: var(--sel-focus-border);
box-shadow: var(--sel-ring);
}
.select-icon {
@@ -185,7 +171,6 @@
.select-menu:focus-visible {
outline: none;
box-shadow: var(--sel-menu-shadow), var(--sel-ring);
}
.select-option {
@@ -38,7 +38,7 @@
<button
role="tab"
aria-selected={activeTab === index}
class="relative z-10 flex-1 px-4 py-2 focus-visible:outline-hidden"
class="relative z-10 flex-1 px-4 py-2"
onclick={() => (activeTab = index)}
>
{title}
@@ -55,7 +55,7 @@
{#if activeTab === index}
<div
role="tabpanel"
class="focus:outline-hidden w-full h-full min-h-0 pt-2 overflow-y-auto no-scrollbar pb-6 tab active relative"
class="w-full h-full min-h-0 pt-2 overflow-y-auto no-scrollbar pb-6 tab active relative"
>
{#if tab.loader}
<LazyPanel loader={tab.loader} props={tab.props} />
@@ -1,4 +1,6 @@
<script lang="ts">
import PipetteIcon from "@lucide/svelte/icons/pipette";
import TrashIcon from "@lucide/svelte/icons/trash";
import { untrack } from "svelte";
import { slide } from "svelte/transition";
import {
@@ -245,7 +247,7 @@
type="button"
role="radio"
aria-checked={model.kind === mode.kind}
class="relative py-1 text-xs font-medium rounded-md transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-zinc-900 dark:focus-visible:outline-white {model.kind === mode.kind
class="relative py-1 text-xs font-medium rounded-md transition-colors duration-200 {model.kind === mode.kind
? 'text-zinc-900 dark:text-white'
: 'text-zinc-500 hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-white'}"
onclick={() => setMode(mode.kind)}
@@ -292,7 +294,7 @@
type="number"
min="0"
max="360"
class="p-0 w-full min-w-0 text-xs text-right bg-transparent border-0 outline-none select-text picker-number focus:ring-0"
class="p-0 w-full min-w-0 text-xs text-right bg-transparent border-0 outline-none select-text picker-number"
aria-label="Gradient angle in degrees"
value={model.angle}
oninput={(event) => {
@@ -304,14 +306,12 @@
{/if}
<button
type="button"
class="grid shrink-0 place-items-center rounded-md transition size-7 text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 disabled:opacity-30 disabled:pointer-events-none focus-visible:outline-2 focus-visible:outline-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-700 dark:hover:text-white dark:focus-visible:outline-white"
class="grid shrink-0 place-items-center rounded-md transition size-7 text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 disabled:opacity-30 disabled:pointer-events-none dark:text-zinc-300 dark:hover:bg-zinc-700 dark:hover:text-white"
aria-label="Remove selected stop"
disabled={stops.length <= 2}
onclick={() => removeStop(selected)}
>
<svg viewBox="0 0 24 24" class="size-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M3 6h18M8 6V4h8v2m-9 0 1 14h8l1-14" />
</svg>
<TrashIcon class="size-4" />
</button>
</div>
{/if}
@@ -319,7 +319,7 @@
<div
bind:this={area}
class="relative h-40 rounded-lg cursor-crosshair touch-none outline-none ring-1 ring-inset ring-black/10 focus-visible:ring-2 focus-visible:ring-zinc-900 dark:ring-white/10 dark:focus-visible:ring-white"
class="relative h-40 rounded-lg cursor-crosshair touch-none outline-none ring-1 ring-inset ring-black/10 dark:ring-white/10"
style="background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl({hsva.h} 100% 50%));"
role="slider"
tabindex="0"
@@ -345,13 +345,11 @@
{#if EyeDropper}
<button
type="button"
class="grid shrink-0 place-items-center rounded-md transition size-8 text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 focus-visible:outline-2 focus-visible:outline-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-700 dark:hover:text-white dark:focus-visible:outline-white"
class="grid shrink-0 place-items-center rounded-md transition size-8 text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-700 dark:hover:text-white"
aria-label="Pick a colour from the screen"
onclick={pickFromScreen}
>
<svg viewBox="0 0 24 24" class="size-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="m2 22 1-1h3l9-9M3 21v-3l9-9m3-3 3.5-3.5a2.1 2.1 0 0 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" />
</svg>
<PipetteIcon class="size-4" />
</button>
{/if}
<div class="flex flex-col flex-1 gap-3">
@@ -387,7 +385,7 @@
<label class="flex flex-1 gap-1.5 items-center px-2.5 min-w-0 h-8 text-xs rounded-md bg-zinc-100 dark:bg-zinc-700/70">
<span class="text-zinc-500 dark:text-zinc-400">#</span>
<input
class="flex-1 p-0 min-w-0 font-mono text-xs uppercase bg-transparent border-0 outline-none select-text focus:ring-0"
class="flex-1 p-0 min-w-0 font-mono text-xs uppercase bg-transparent border-0 outline-none select-text"
aria-label="Hex colour"
value={hex.slice(1)}
spellcheck="false"
@@ -408,7 +406,7 @@
type="number"
min="0"
max="100"
class="p-0 w-full min-w-0 text-xs text-right bg-transparent border-0 outline-none select-text picker-number focus:ring-0"
class="p-0 w-full min-w-0 text-xs text-right bg-transparent border-0 outline-none select-text picker-number"
aria-label="Opacity percent"
value={Math.round(active.a * 100)}
oninput={(event) => {
@@ -424,7 +422,7 @@
{#each shownPresets as preset (preset)}
<button
type="button"
class="rounded-md ring-1 ring-inset transition aspect-square ring-black/10 hover:scale-110 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-zinc-900 dark:ring-white/10 dark:focus-visible:outline-white"
class="rounded-md ring-1 ring-inset transition aspect-square ring-black/10 hover:scale-110 dark:ring-white/10"
style="background: {asLayer(preset)}, {CHECKERBOARD};"
aria-label="Apply preset {preset}"
onclick={() => applyPreset(preset)}
@@ -447,15 +445,6 @@
transition: transform 120ms ease, box-shadow 120ms ease;
}
.handle:focus-visible {
outline: none;
box-shadow: 0 0 0 2px rgb(24 24 27), 0 1px 3px rgb(0 0 0 / 0.3);
}
:global(.dark) .handle:focus-visible {
box-shadow: 0 0 0 2px white, 0 1px 3px rgb(0 0 0 / 0.3);
}
.handle-selected {
z-index: 1;
transform: translate(-50%, -50%) scale(1.2);
@@ -486,15 +475,6 @@
box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
}
.picker-track:focus-visible {
outline: 2px solid rgb(24 24 27);
outline-offset: 2px;
}
:global(.dark) .picker-track:focus-visible {
outline-color: white;
}
.picker-track::-webkit-slider-thumb {
appearance: none;
width: 1.125rem;
@@ -1,4 +1,5 @@
<script lang="ts">
import XIcon from "@lucide/svelte/icons/x";
import SkeletonLoader from "@/interface/components/SkeletonLoader.svelte";
import ModalFrame from "./ModalFrame.svelte";
import type { CommunityThemesState } from "@/interface/hooks/communityThemesState.svelte";
@@ -36,7 +37,7 @@
aria-label="Close"
onclick={() => communityState.closeDetail()}
>
✕
<XIcon size="1em" />
</button>
</div>
@@ -145,11 +145,6 @@
transform: scale(0.98);
}
.bsplus-font-picker-reset:focus-visible {
outline: none;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--bsplus-analytics-accent) 35%, transparent);
}
.bsplus-font-picker-reset:disabled {
opacity: 0.45;
cursor: not-allowed;
@@ -186,11 +181,6 @@
transform: scale(0.97);
}
.bsplus-font-picker-done:focus-visible {
outline: none;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--bsplus-analytics-accent) 35%, transparent);
}
.bsplus-font-picker-list {
flex: 1;
min-height: 0;
@@ -241,13 +231,6 @@
);
}
.bsplus-font-picker-option:focus-visible {
outline: none;
box-shadow:
var(--bsplus-analytics-shadow-hover),
0 0 0 3px color-mix(in srgb, var(--bsplus-analytics-accent) 30%, transparent);
}
.bsplus-font-picker-option.is-selected {
border-color: color-mix(
in srgb,
@@ -1,15 +0,0 @@
<script lang="ts">
import { LUCIDE_MOON_PATH } from "@/lib/icons/lucideMoon";
let { class: className = "w-5 h-5" }: { class?: string } = $props();
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class={className}
aria-hidden="true"
>
<path d={LUCIDE_MOON_PATH} />
</svg>
@@ -1,15 +0,0 @@
<script lang="ts">
import { LUCIDE_SUN_PATH } from "@/lib/icons/lucideSun";
let { class: className = "w-5 h-5" }: { class?: string } = $props();
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class={className}
aria-hidden="true"
>
<path d={LUCIDE_SUN_PATH} />
</svg>
@@ -1,4 +1,6 @@
<script lang="ts">
import DownloadIcon from "@lucide/svelte/icons/download";
import TrashIcon from "@lucide/svelte/icons/trash";
import { hasEnoughStorageSpace, isIndexedDBSupported, writeData, openDatabase, readAllData, deleteData } from '@/interface/hooks/BackgroundDataLoader';
import Spinner from '../Spinner.svelte';
import { settingsState } from '@/seqta/utils/listeners/SettingsState'
@@ -240,12 +242,12 @@
<Spinner />
{:else if savedBackgrounds.includes(background.id)}
<span class="flex items-center text-white">
<span class="mr-2 text-2xl not-italic font-IconFamily" aria-hidden="true">&#xed2c;</span>
<TrashIcon size="1em" class="mr-2 text-2xl" />
<span class="text-sm font-semibold">Remove</span>
</span>
{:else}
<span class="flex items-center text-white">
<span class="mr-2 text-2xl not-italic font-IconFamily" aria-hidden="true">&#xea9a;</span>
<DownloadIcon size="1em" class="mr-2 text-2xl" />
<span class="text-sm font-semibold">Install</span>
</span>
{/if}
@@ -1,4 +1,5 @@
<script lang="ts">
import CircleUserRoundIcon from "@lucide/svelte/icons/circle-user-round";
import { onMount } from "svelte";
import { cloudAuth } from "@/seqta/utils/CloudAuth";
import CloudPfpAvatar from "@/interface/components/CloudPfpAvatar.svelte";
@@ -72,7 +73,7 @@
<button
type="button"
onclick={handleButtonClick}
class="flex items-center gap-2 bg-zinc-100/80 font-medium text-zinc-700 transition-colors duration-150 hover:bg-zinc-200 hover:text-zinc-950 focus:outline-hidden dark:bg-zinc-900/50 dark:text-zinc-200 dark:hover:bg-zinc-700 dark:hover:text-white {compact ? 'h-8 rounded-lg px-3 text-[0.75rem]' : 'h-12 rounded-full px-4 text-sm'}"
class="flex items-center gap-2 bg-zinc-100/80 font-medium text-zinc-700 transition-colors duration-150 hover:bg-zinc-200 hover:text-zinc-950 dark:bg-zinc-900/50 dark:text-zinc-200 dark:hover:bg-zinc-700 dark:hover:text-white {compact ? 'h-8 rounded-lg px-3 text-[0.75rem]' : 'h-12 rounded-full px-4 text-sm'}"
>
{#if cloudState.isLoggedIn}
{#if cloudState.user?.pfpUrl}
@@ -94,7 +95,7 @@
{cloudState.user?.displayName || cloudState.user?.username || cloudState.user?.email || "User"}
</span>
{:else}
<span class="text-sm font-IconFamily" aria-hidden="true">{'\ued53'}</span>
<CircleUserRoundIcon size="1em" class="text-sm" />
<span>Sign in</span>
{/if}
</button>
@@ -1,4 +1,7 @@
<script lang="ts">
import ChevronLeftIcon from "@lucide/svelte/icons/chevron-left";
import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
import StarIcon from "@lucide/svelte/icons/star";
import { fade } from 'svelte/transition';
import type { ThemeCoverSlide } from '@/interface/types/Theme';
import emblaCarouselSvelte from 'embla-carousel-svelte';
@@ -58,13 +61,7 @@
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100 shadow-xs"
aria-label="Featured theme"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-3.5 h-3.5">
<path
fill-rule="evenodd"
d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z"
clip-rule="evenodd"
/>
</svg>
<StarIcon class="w-3.5 h-3.5" fill="currentColor" />
Featured
</span>
</div>
@@ -93,9 +90,7 @@
type="button"
class="flex justify-center items-center w-8 h-8 text-white rounded-full bg-black/50 dark:bg-zinc-800 transition-all duration-200"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m15.75 19.5-7.5-7.5 7.5-7.5" />
</svg>
<ChevronLeftIcon class="w-6 h-6" />
</button>
<button
aria-label="Next"
@@ -103,9 +98,7 @@
type="button"
class="flex justify-center items-center w-8 h-8 text-white rounded-full bg-black/50 dark:bg-zinc-800 transition-all duration-200"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
<ChevronRightIcon class="w-6 h-6" />
</button>
</div>
</div>
+10 -16
View File
@@ -1,4 +1,6 @@
<script lang="ts">
import SearchIcon from "@lucide/svelte/icons/search";
import Minimize2Icon from "@lucide/svelte/icons/minimize-2";
import darkLogo from "@/resources/icons/betterseqta-dark-full.png";
import lightLogo from "@/resources/icons/betterseqta-light-full.png";
import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
@@ -93,15 +95,7 @@
>
<label class="relative block w-40 md:w-48 xl:w-56">
<span class="sr-only">Search {activePage}</span>
<svg
class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m21 21-4.35-4.35m1.35-5.65a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z" />
</svg>
<SearchIcon class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400" />
<input
type="search"
placeholder={activePage === "themes" ? "Search themes" : "Search backgrounds"}
@@ -119,9 +113,9 @@
{#if onToggleSize}
<button type="button" onclick={onToggleSize}
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden dark:text-zinc-400 dark:hover:text-white"
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] dark:text-zinc-400 dark:hover:text-white"
aria-label="Collapse settings" title="Collapse settings" aria-expanded="true">
<span class="font-IconFamily text-2xl" aria-hidden="true">{"\uec06"}</span>
<Minimize2Icon size="1em" class="text-2xl" />
</button>
{/if}
<PlainCloseButton onclick={onClose} label="Close settings" />
@@ -150,12 +144,12 @@
}
}
.store-search,
.store-search:focus,
.store-search:focus-visible {
.store-search {
appearance: none;
border: 0 !important;
outline: 0 !important;
box-shadow: none !important;
}
.store-search:focus-visible {
outline-offset: -2px;
}
</style>
+10 -24
View File
@@ -1,4 +1,8 @@
<script lang="ts">
import CheckIcon from "@lucide/svelte/icons/check";
import DownloadIcon from "@lucide/svelte/icons/download";
import HeartIcon from "@lucide/svelte/icons/heart";
import StarIcon from "@lucide/svelte/icons/star";
import type { Theme } from '@/interface/types/Theme'
import {
masterGridDisplayDownloadCount,
@@ -95,9 +99,7 @@
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100 shadow-xs"
aria-label="Featured theme"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-3.5 h-3.5">
<path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z" clip-rule="evenodd" />
</svg>
<StarIcon class="w-3.5 h-3.5" fill="currentColor" />
Featured
</span>
</div>
@@ -108,9 +110,7 @@
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-emerald-100 text-emerald-900 dark:bg-emerald-950 dark:text-emerald-100 shadow-xs"
aria-label="Installed"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-3.5 h-3.5">
<path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" />
</svg>
<CheckIcon class="w-3.5 h-3.5" />
Installed
</span>
</div>
@@ -119,7 +119,7 @@
<button
type="button"
data-theme-favorite
class="pointer-events-none absolute right-2 top-2 z-20 flex h-10 w-10 scale-[0.25] items-center justify-center rounded-full bg-black/50 text-white opacity-0 blur-xs transition-[opacity,transform,filter,background-color] duration-200 ease-[cubic-bezier(0.2,0,0,1)] hover:bg-black/70 active:scale-[0.96] group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:blur-0 focus-visible:pointer-events-auto focus-visible:scale-100 focus-visible:opacity-100 focus-visible:blur-0 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white"
class="pointer-events-none absolute right-2 top-2 z-20 flex h-10 w-10 scale-[0.25] items-center justify-center rounded-full bg-black/50 text-white opacity-0 blur-xs transition-[opacity,transform,filter,background-color] duration-200 ease-[cubic-bezier(0.2,0,0,1)] hover:bg-black/70 active:scale-[0.96] group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:blur-0 focus-visible:pointer-events-auto focus-visible:scale-100 focus-visible:opacity-100 focus-visible:blur-0"
onclick={handleFavoriteClick}
aria-label={isLoggedIn
? theme.is_favorited
@@ -132,17 +132,7 @@
: 'Add to favourites'
: 'Sign in to favourite themes'}
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill={theme.is_favorited ? 'currentColor' : 'none'}
stroke="currentColor"
stroke-width="2"
class="h-5 w-5 {theme.is_favorited ? 'text-red-500' : ''}"
aria-hidden="true"
>
<path stroke-linecap="round" stroke-linejoin="round" d="M4.318 6.318a4.5 4.5 0 0 1 6.364 0L12 7.636l1.318-1.318a4.5 4.5 0 0 1 6.364 6.364L12 20.364l-7.682-7.682a4.5 4.5 0 0 1 0-6.364Z" />
</svg>
<HeartIcon class="h-5 w-5 {theme.is_favorited ? 'text-red-500' : ''}" fill={theme.is_favorited ? 'currentColor' : 'none'} />
</button>
{/if}
<div class="absolute bottom-1 left-3 right-3 z-10 mb-1 flex flex-col gap-0.5">
@@ -152,16 +142,12 @@
{/if}
<div class="flex gap-3 text-xs font-medium text-white/90 drop-shadow-xs">
<span class="flex items-center gap-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3.5 h-3.5">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" />
</svg>
<DownloadIcon class="w-3.5 h-3.5" />
{displayDownloadCount.toLocaleString()}
</span>
{#if showFavorites}
<span class="flex items-center gap-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill={theme.is_favorited ? 'currentColor' : 'none'} stroke="currentColor" stroke-width="1.5" class="w-3.5 h-3.5">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
</svg>
<HeartIcon class="w-3.5 h-3.5" fill={theme.is_favorited ? 'currentColor' : 'none'} />
{(theme.favorite_count ?? 0).toLocaleString()}
</span>
{/if}
@@ -1,4 +1,11 @@
<script lang="ts">
import ChevronLeftIcon from "@lucide/svelte/icons/chevron-left";
import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
import DownloadIcon from "@lucide/svelte/icons/download";
import HeartIcon from "@lucide/svelte/icons/heart";
import LoaderCircleIcon from "@lucide/svelte/icons/loader-circle";
import StarIcon from "@lucide/svelte/icons/star";
import XIcon from '@lucide/svelte/icons/x'
import type { Theme } from '@/interface/types/Theme'
import { fade } from 'svelte/transition'
import { animate } from 'motion'
@@ -220,11 +227,11 @@ tabindex="-1"
<div class="absolute top-0 right-0 flex gap-1 items-center">
<button
type="button"
class="p-2 text-xl font-bold text-gray-600 font-IconFamily dark:text-gray-200 transition-colors duration-200 rounded-lg hover:bg-black/5 dark:hover:bg-white/10 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800"
class="p-2 text-xl font-bold text-gray-600 dark:text-gray-200 transition-colors duration-200 rounded-lg hover:bg-black/5 dark:hover:bg-white/10"
onclick={() => hideModal()}
aria-label="Close"
>
{'\ued8a'}
<XIcon size="1em" />
</button>
</div>
<div class="flex flex-wrap items-center gap-2 pr-12 mb-2">
@@ -244,13 +251,7 @@ Community
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100"
aria-label="Featured theme"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-3.5 h-3.5">
<path
fill-rule="evenodd"
d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z"
clip-rule="evenodd"
/>
</svg>
<StarIcon class="w-3.5 h-3.5" fill="currentColor" />
Featured
</span>
{/if}
@@ -263,9 +264,7 @@ By {theme.author}
<div class="flex gap-4 mb-4 text-sm text-zinc-600 dark:text-zinc-400">
{#if !adminPreviewMode}
<span class="flex items-center gap-1.5">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" />
</svg>
<DownloadIcon class="w-4 h-4" />
{modalDisplayDownloadCount.toLocaleString()} downloads
</span>
{:else}
@@ -273,9 +272,7 @@ By {theme.author}
{/if}
{#if showFavorites}
<span class="flex items-center gap-1.5">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill={theme.is_favorited ? 'currentColor' : 'none'} stroke="currentColor" stroke-width="1.5" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
</svg>
<HeartIcon class="w-4 h-4" fill={theme.is_favorited ? 'currentColor' : 'none'} />
{(theme.favorite_count ?? 0).toLocaleString()} favorites
</span>
{/if}
@@ -301,22 +298,18 @@ onemblaInit={heroInit}
<button
type="button"
onclick={heroPrev}
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2"
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white"
aria-label="Previous hero slide"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-5 h-5">
<path stroke-linecap="round" stroke-linejoin="round" d="m15.75 19.5-7.5-7.5 7.5-7.5" />
</svg>
<ChevronLeftIcon class="w-5 h-5" />
</button>
<button
type="button"
onclick={heroNext}
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2"
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white"
aria-label="Next hero slide"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-5 h-5">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
<ChevronRightIcon class="w-5 h-5" />
</button>
</div>
{/if}
@@ -375,7 +368,7 @@ Remove
type="button"
onclick={() => onMasterVariantClick('install')}
disabled={installingId !== null}
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
title="Install {theme.name} (master)"
>
{#if masterThumb}
@@ -445,7 +438,7 @@ Remove
type="button"
onclick={() => onFlavourClick(flavourIdx, f.id, 'install')}
disabled={installingId !== null}
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
title="Install {f.name}"
>
{#if thumb}
@@ -474,14 +467,12 @@ title="Install {f.name}"
{#if showFavorites && toggleFavorite && theme}
<button
type="button"
class="flex items-center gap-2 px-4 py-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 {theme.is_favorited ? 'text-red-500 bg-red-500/10 dark:bg-red-500/20' : 'bg-zinc-200 dark:bg-zinc-700 dark:text-white hover:bg-zinc-300 dark:hover:bg-zinc-600'}"
class="flex items-center gap-2 px-4 py-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95 {theme.is_favorited ? 'text-red-500 bg-red-500/10 dark:bg-red-500/20' : 'bg-zinc-200 dark:bg-zinc-700 dark:text-white hover:bg-zinc-300 dark:hover:bg-zinc-600'}"
onclick={handleFavoriteClick}
title={isLoggedIn ? (theme.is_favorited ? 'Remove from favorites' : 'Add to favorites') : 'Sign in to favorite themes'}
aria-label={theme.is_favorited ? 'Unfavorite' : 'Favorite'}
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill={theme.is_favorited ? 'currentColor' : 'none'} stroke="currentColor" stroke-width="2" class="w-5 h-5">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
</svg>
<HeartIcon class="w-5 h-5" fill={theme.is_favorited ? 'currentColor' : 'none'} />
{theme.is_favorited ? 'Favorited' : 'Favorite'}
</button>
{/if}
@@ -502,12 +493,10 @@ type="button"
onclick={() => runApply(theme.id)}
disabled={installingId !== null}
style={variantApplyStyles(theme.id).apply}
class="relative flex justify-center items-center px-4 py-2 min-w-32 rounded-lg transition-all duration-200 hover:brightness-90 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-offset-2 disabled:opacity-70"
class="relative flex justify-center items-center px-4 py-2 min-w-32 rounded-lg transition-all duration-200 hover:brightness-90 active:scale-95 disabled:opacity-70"
>
{#if installingId === theme.id}
<svg class="absolute w-4 h-4 animate-spin" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke="currentColor" fill="currentColor" class="origin-center animate-spin-fast" d="M2,12A11.2,11.2,0,0,1,13,1.05C12.67,1,12.34,1,12,1a11,11,0,0,0,0,22c.34,0,.67,0,1-.05C6,23,2,17.74,2,12Z"/>
</svg>
<LoaderCircleIcon class="absolute w-4 h-4 animate-spin" />
{/if}
<span class="{installingId === theme.id ? 'opacity-0' : 'opacity-100'}">Apply</span>
</button>
@@ -516,12 +505,10 @@ class="relative flex justify-center items-center px-4 py-2 min-w-32 rounded-lg t
type="button"
onclick={() => runRemove(theme.id)}
disabled={installingId !== null}
class="relative flex justify-center items-center px-4 py-2 min-w-32 text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 disabled:opacity-70"
class="relative flex justify-center items-center px-4 py-2 min-w-32 text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 disabled:opacity-70"
>
{#if installingId === theme.id}
<svg class="absolute w-4 h-4 animate-spin" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke="currentColor" fill="currentColor" class="origin-center animate-spin-fast" d="M2,12A11.2,11.2,0,0,1,13,1.05C12.67,1,12.34,1,12,1a11,11,0,0,0,0,22c.34,0,.67,0,1-.05C6,23,2,17.74,2,12Z"/>
</svg>
<LoaderCircleIcon class="absolute w-4 h-4 animate-spin" />
{/if}
<span class="{installingId === theme.id ? 'opacity-0' : 'opacity-100'}">Remove</span>
</button>
@@ -530,12 +517,10 @@ class="relative flex justify-center items-center px-4 py-2 min-w-32 text-black r
type="button"
onclick={() => runInstall(theme.id)}
disabled={installingId !== null}
class="relative flex justify-center items-center px-4 py-2 min-w-32 text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 disabled:opacity-70"
class="relative flex justify-center items-center px-4 py-2 min-w-32 text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 disabled:opacity-70"
>
{#if installingId === theme.id}
<svg class="absolute w-4 h-4 animate-spin" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke="currentColor" fill="currentColor" class="origin-center animate-spin-fast" d="M2,12A11.2,11.2,0,0,1,13,1.05C12.67,1,12.34,1,12,1a11,11,0,0,0,0,22c.34,0,.67,0,1-.05C6,23,2,17.74,2,12Z"/>
</svg>
<LoaderCircleIcon class="absolute w-4 h-4 animate-spin" />
{/if}
<span class="{installingId === theme.id ? 'opacity-0' : 'opacity-100'}">{installActionLabel}</span>
</button>
@@ -572,7 +557,7 @@ class="relative z-0 hover:z-20 w-full cursor-pointer rounded-xl overflow-hidden
<div class="flex justify-center items-center p-8 text-zinc-600 dark:text-zinc-300">
<button
type="button"
class="px-4 py-2 rounded-lg bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800"
class="px-4 py-2 rounded-lg bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white"
onclick={() => hideModal()}
>
Close
@@ -1,4 +1,5 @@
<script lang="ts">
import PlusIcon from "@lucide/svelte/icons/plus";
let { onFileChange }: { onFileChange?: (file: File) => void } = $props();
function handleFileChange(event: Event) {
@@ -14,10 +15,9 @@
<div class="relative w-16 h-16 overflow-hidden transition rounded-xl bg-zinc-100 dark:bg-zinc-900">
<div
class="flex items-center justify-center w-full h-full text-3xl font-bold text-gray-400 transition font-IconFamily hover:text-gray-500 pointer-events-none"
class="flex items-center justify-center w-full h-full text-3xl font-bold text-gray-400 transition hover:text-gray-500 pointer-events-none"
>
<!-- Plus icon -->
<PlusIcon size="1em" />
</div>
<input
type="file"
@@ -1,4 +1,10 @@
<script lang="ts">
import HeartIcon from "@lucide/svelte/icons/heart";
import CloudUploadIcon from "@lucide/svelte/icons/cloud-upload";
import PencilIcon from "@lucide/svelte/icons/pencil";
import PlusIcon from "@lucide/svelte/icons/plus";
import ShoppingCartIcon from "@lucide/svelte/icons/shopping-cart";
import UploadIcon from "@lucide/svelte/icons/upload";
import type { CustomTheme, ThemeList } from '@/types/CustomThemes'
import { onDestroy, onMount } from 'svelte'
import browser from '@/lib/browser'
@@ -202,9 +208,7 @@
tabindex="-1"
title={cloudLoggedIn ? ((favoriteStatus[theme.id] ?? false) ? 'Remove from favorites' : 'Add to favorites') : 'Sign in to favorite themes'}
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill={(favoriteStatus[theme.id] ?? false) ? 'currentColor' : 'none'} stroke="currentColor" stroke-width="2" class="h-5 w-5">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
</svg>
<HeartIcon class="h-5 w-5" fill={(favoriteStatus[theme.id] ?? false) ? 'currentColor' : 'none'} />
</div>
{/if}
@@ -216,7 +220,7 @@
tabindex="-1"
title="Export theme"
>
<span class="text-lg font-IconFamily">&#xecb3;</span>
<UploadIcon size="1em" class="text-lg" />
</div>
{#if isLocalCustomTheme(theme)}
@@ -228,7 +232,7 @@
tabindex="-1"
title="Edit theme"
>
<span class="text-lg font-IconFamily">&#xeaa5;</span>
<PencilIcon size="1em" class="text-lg" />
</div>
<div
class="flex h-8 w-8 place-items-center rounded-full bg-black/50 p-2 text-white {submittingThemeId === theme.id ? 'opacity-60' : ''}"
@@ -238,7 +242,7 @@
tabindex="-1"
title="Submit to community"
>
<span class="text-lg font-IconFamily">&#xe9fc;</span>
<CloudUploadIcon size="1em" class="text-lg" />
</div>
{/if}
</div>
@@ -287,7 +291,7 @@
onclick={() => void openStorePage()}
class="flex justify-center items-center w-full rounded-xl transition aspect-theme bg-zinc-100 dark:bg-zinc-900 dark:text-white"
>
<span class="text-xl font-IconFamily">&#xecc5;</span>
<ShoppingCartIcon size="1em" class="text-xl" />
<span class="ml-2">Theme Store</span>
</button>
@@ -295,7 +299,7 @@
onclick={() => void openThemeCreator()}
class="flex justify-center items-center w-full rounded-xl transition aspect-theme bg-zinc-100 dark:bg-zinc-900 dark:text-white"
>
<span class="text-xl font-IconFamily">&#xec60;</span>
<PlusIcon size="1em" class="text-xl" />
<span class="ml-2">Create your own</span>
</button>
{/if}
-6
View File
@@ -4,12 +4,6 @@
display: none;
}
input {
&:focus {
box-shadow: unset !important;
}
}
.no-scrollbar {
scrollbar-width: none !important;
}
-6
View File
@@ -8,12 +8,6 @@
width: var(--tab-width);
}
input {
&:focus {
box-shadow: unset !important;
}
}
.animate-fade-in {
animation: fadeIn 0.5s ease-in-out;
}
-19
View File
@@ -1,25 +1,8 @@
import Settings from "./pages/settings.svelte";
import IconFamily from "@/resources/fonts/IconFamily.woff";
import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
import renderSvelte from "./main";
import { initializeSettingsState } from "@/seqta/utils/listeners/SettingsState";
import { initVerboseLogging, verboseInfo } from "@/utils/verboseLog";
function InjectCustomIcons() {
verboseInfo("[BetterSEQTA+] Injecting Icons");
const style = document.createElement("style");
style.setAttribute("type", "text/css");
style.innerHTML = `
@font-face {
font-family: 'IconFamily';
src: url('${resolveExtensionAssetUrl(IconFamily)}') format('woff');
font-weight: normal;
font-style: normal;
}`;
document.head.appendChild(style);
}
const mountPoint = document.getElementById("app");
if (!mountPoint) {
// In production, Rollup may put this entry in a shared chunk that content
@@ -27,8 +10,6 @@ if (!mountPoint) {
// has `#app` — never throw on SEQTA tabs.
verboseInfo("[BetterSEQTA+] Settings bootstrap skipped (no #app — not the settings page)");
} else {
InjectCustomIcons();
void (async () => {
await initializeSettingsState();
initVerboseLogging();
+17 -35
View File
@@ -1,4 +1,10 @@
<script lang="ts">
import MessageSquareIcon from "@lucide/svelte/icons/message-square";
import SearchIcon from "@lucide/svelte/icons/search";
import InfoIcon from "@lucide/svelte/icons/info";
import Maximize2Icon from "@lucide/svelte/icons/maximize-2";
import MegaphoneIcon from "@lucide/svelte/icons/megaphone";
import ShieldIcon from "@lucide/svelte/icons/shield";
import TabbedContainer from "../components/TabbedContainer.svelte";
import LazyPanel from "../components/LazyPanel.svelte";
import darkLogo from "@/resources/icons/betterseqta-dark-full.png";
@@ -465,9 +471,9 @@
};
const utilityActions = [
{ label: "About", icon: "\ueb73", onclick: openAbout },
{ label: "What's new", icon: "\ue929", onclick: openChangelog },
{ label: "Privacy", icon: "\uecba", onclick: openPrivacyStatement },
{ label: "About", icon: InfoIcon, onclick: openAbout },
{ label: "What's new", icon: MegaphoneIcon, onclick: openChangelog },
{ label: "Privacy", icon: ShieldIcon, onclick: openPrivacyStatement },
] as const;
onMount(() => {
@@ -566,25 +572,12 @@
{#if activePage === "settings"}
<label class="relative mb-4 block shrink-0">
<span class="sr-only">Search settings</span>
<svg
class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="m21 21-4.35-4.35m1.35-5.65a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"
/>
</svg>
<SearchIcon class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400" />
<input
type="search"
placeholder="Search settings"
bind:value={settingsSearch}
class="h-10 w-full rounded-lg bg-zinc-200/70 pl-9 pr-3 text-sm text-zinc-900 placeholder:text-zinc-400 transition-colors duration-200 focus:bg-white focus:outline-hidden focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:bg-zinc-800/80 dark:text-white dark:placeholder:text-zinc-500 dark:focus:bg-zinc-800 dark:focus:ring-offset-zinc-900"
class="h-10 w-full rounded-lg bg-zinc-200/70 pl-9 pr-3 text-sm text-zinc-900 placeholder:text-zinc-400 transition-colors duration-200 focus:bg-white dark:bg-zinc-800/80 dark:text-white dark:placeholder:text-zinc-500 dark:focus:bg-zinc-800"
/>
</label>
{/if}
@@ -618,9 +611,9 @@
<button
type="button"
onclick={action.onclick}
class="flex h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-[16px] font-medium text-zinc-600 transition-[color,background-color,transform] duration-150 hover:bg-zinc-200/70 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:text-zinc-300 dark:hover:bg-zinc-700/70 dark:hover:text-white dark:focus:ring-offset-zinc-900"
class="flex h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-[16px] font-medium text-zinc-600 transition-[color,background-color,transform] duration-150 hover:bg-zinc-200/70 hover:text-zinc-950 active:scale-[0.96] dark:text-zinc-300 dark:hover:bg-zinc-700/70 dark:hover:text-white"
>
<span class="w-5 text-center font-IconFamily text-[18px]" aria-hidden="true">{action.icon}</span>
<action.icon size={18} class="shrink-0" />
<span>{action.label}</span>
</button>
{/each}
@@ -628,20 +621,9 @@
<button
type="button"
onclick={() => openFeedback()}
class="mt-2 flex w-full items-center gap-3 rounded-lg bg-zinc-200/70 px-3 py-2.5 text-left text-[16px] font-medium text-zinc-700 transition-[color,background-color,transform] duration-150 hover:bg-zinc-300/80 active:scale-[0.96] focus:outline-hidden focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:bg-zinc-800/80 dark:text-zinc-200 dark:hover:bg-zinc-700 dark:focus:ring-offset-zinc-900"
class="mt-2 flex w-full items-center gap-3 rounded-lg bg-zinc-200/70 px-3 py-2.5 text-left text-[16px] font-medium text-zinc-700 transition-[color,background-color,transform] duration-150 hover:bg-zinc-300/80 active:scale-[0.96] dark:bg-zinc-800/80 dark:text-zinc-200 dark:hover:bg-zinc-700"
>
<svg
class="w-5 h-5 shrink-0"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
</svg>
<MessageSquareIcon class="w-5 h-5 shrink-0" />
<span>Send us feedback!</span>
</button>
</div>
@@ -756,9 +738,9 @@
/>
{#if !standalone}
<button type="button" onclick={toggleExpanded}
class="mt-2 flex h-11 w-11 shrink-0 self-start items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden dark:text-zinc-400 dark:hover:text-white"
class="mt-2 flex h-11 w-11 shrink-0 self-start items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] dark:text-zinc-400 dark:hover:text-white"
aria-label="Expand settings" title="Expand settings" aria-expanded="false">
<span class="font-IconFamily text-2xl" aria-hidden="true">{"\uebdb"}</span>
<Maximize2Icon size="1em" class="text-2xl" />
</button>
{/if}
</div>
@@ -1,4 +1,6 @@
<script lang="ts">
import XIcon from "@lucide/svelte/icons/x";
import UploadIcon from "@lucide/svelte/icons/upload";
import MotionDiv from '@/interface/components/MotionDiv.svelte';
import { settingsState } from "@/seqta/utils/listeners/SettingsState.ts"
import Switch from "@/interface/components/Switch.svelte"
@@ -181,12 +183,10 @@
}
}}
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
<XIcon class="w-4 h-4" />
</span>
{:else}
<span class="font-IconFamily">{ '\ued47' }</span>
<UploadIcon size="1em" />
<span class="ml-2">SVG icon <span class="text-xs italic text-zinc-400 dark:text-zinc-500">(Optional)</span></span>
{/if}
</button>
@@ -215,9 +215,7 @@
<div class="flex justify-between items-center px-4 py-3">
{shortcut.name}
<button aria-label="Delete Shortcut" onclick={() => deleteCustomShortcut(index)}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
<XIcon class="w-6 h-6" />
</button>
</div>
{/if}
+3 -2
View File
@@ -2,6 +2,8 @@
import BackgroundSelector from "@/interface/components/themes/BackgroundSelector.svelte"
import ThemeSelector from "@/interface/components/themes/ThemeSelector.svelte"
import Button from "@/interface/components/Button.svelte"
import CheckIcon from "@lucide/svelte/icons/check"
import PencilIcon from "@lucide/svelte/icons/pencil"
import { standalone } from "@/interface/utils/standalone.svelte"
let { section = "all" }: {
@@ -35,7 +37,7 @@
<Button
onClick={() => editMode = !editMode}
text={editMode ? 'Done' : 'Remove'}
icon={editMode ? '\ue9e4' : '\uec38'}
icon={editMode ? CheckIcon : PencilIcon}
/>
</div>
{/if}
@@ -48,7 +50,6 @@
<Button
variant="primary"
class="w-full mb-4"
icon={""}
text="Open theme builder"
onClick={() =>
void import("@/seqta/utils/launchPageThemeBuilder").then(({ launchPageThemeBuilder }) =>
+24 -18
View File
@@ -1,4 +1,10 @@
<script lang="ts">
import ChevronDownIcon from "@lucide/svelte/icons/chevron-down";
import Maximize2Icon from "@lucide/svelte/icons/maximize-2";
import Minimize2Icon from "@lucide/svelte/icons/minimize-2";
import CircleQuestionMarkIcon from "@lucide/svelte/icons/circle-question-mark";
import PlusIcon from "@lucide/svelte/icons/plus";
import XIcon from "@lucide/svelte/icons/x";
import { onMount } from 'svelte';
import { slide } from 'svelte/transition';
import { fade } from 'svelte/transition';
@@ -28,8 +34,8 @@
import { submitLocalThemeToCommunity } from '@/seqta/utils/customThemes/submitLocalTheme'
import { formatCustomThemeApiError } from '@/seqta/utils/customThemes/apiErrors'
import { cloudAuth } from '@/seqta/utils/CloudAuth'
import LucideMoon from '@/interface/components/icons/LucideMoon.svelte'
import LucideSun from '@/interface/components/icons/LucideSun.svelte'
import MoonIcon from '@lucide/svelte/icons/moon'
import SunIcon from '@lucide/svelte/icons/sun'
import SidebarAppearance from '@/interface/components/SidebarAppearance.svelte'
import { FONT_PRESETS, DEFAULT_FONT_ID } from '@/seqta/ui/fonts/presets'
import { applySelectedFont, ensureFontPickerFontsLoaded } from '@/seqta/ui/fonts/Manager'
@@ -137,7 +143,7 @@
function toggleAccordion(title: string, e: MouseEvent | KeyboardEvent) {
// if the target is the fullscreen button return
if (e.target instanceof HTMLButtonElement && e.target.classList.contains('fullscreen-toggle')) {
if (e.target instanceof Element && e.target.closest('.fullscreen-toggle')) {
return;
}
@@ -327,12 +333,12 @@
<div class="flex justify-center items-center h-full text-xl font-light text-zinc-500 dark:text-zinc-300">
{#if item.type === 'codeEditor'}
<!-- Fullscreen toggle button -->
<button onclick={toggleCodeEditorFullscreen} class="px-2 mr-2 text-lg font-IconFamily fullscreen-toggle">
{'\uebdb'}
<button onclick={toggleCodeEditorFullscreen} class="px-2 mr-2 text-lg fullscreen-toggle" aria-label="Expand editor">
<Maximize2Icon size="1em" />
</button>
{/if}
<span class='font-IconFamily transition-transform duration-300 {closedAccordions.includes(item.title) ? 'rotate-180' : ''}'>{'\ue9e6'}</span>
<ChevronDownIcon size="1em" class="transition-transform duration-300 {closedAccordions.includes(item.title) ? 'rotate-180' : ''}" />
</div>
{/if}
</div>
@@ -368,7 +374,7 @@
class="grow flex-3 rounded-lg border-0 bg-zinc-200 p-2 transition dark:bg-zinc-600/50 dark:placeholder-zinc-300 focus:bg-zinc-300/50 dark:focus:bg-zinc-600"
/>
<button onclick={() => onRemoveImage(image.id)} class="p-2 transition dark:text-white" type="button">
<span class='text-xl font-IconFamily'>{'\ued8c'}</span>
<XIcon size="1em" class="text-xl" />
</button>
</div>
<label class="block text-xs text-zinc-600 dark:text-zinc-300">
@@ -388,7 +394,7 @@
{/each}
<div class="flex overflow-hidden relative gap-1 justify-center place-items-center w-full h-8 rounded-lg transition bg-zinc-200 dark:bg-zinc-700">
<span class='font-IconFamily'>{'\uec60'}</span>
<PlusIcon size="1em" />
<span class='dark:text-white'>Add image</span>
<input type="file" accept='image/*' onchange={onImageUpload} class="absolute inset-0 w-full h-full opacity-0 cursor-pointer" />
</div>
@@ -404,13 +410,13 @@
out:fade={{ duration: 150 }}
>
{#if (item.props as LightDarkToggleProps).state}
<LucideMoon class="w-5 h-5" />
<MoonIcon class="w-5 h-5" />
{:else}
<LucideSun class="w-5 h-5" />
<SunIcon class="w-5 h-5" />
{/if}
</span>
{/key}
<span class="opacity-0 inline-flex"><LucideMoon class="w-5 h-5" /></span>
<span class="opacity-0 inline-flex"><MoonIcon class="w-5 h-5" /></span>
</button>
{/if}
</div>
@@ -425,7 +431,7 @@
<div class="sticky top-0 px-2 h-screen">
<div class="flex justify-between items-center my-4">
<h2 class="text-xl font-bold">Custom CSS</h2>
<button onclick={toggleCodeEditorFullscreen} class="pr-14 text-xl font-IconFamily">{'\uec06'}</button>
<button onclick={toggleCodeEditorFullscreen} class="pr-14 text-xl" aria-label="Collapse editor"><Minimize2Icon size="1em" /></button>
</div>
<CodeEditor
className="editorHeight"
@@ -445,11 +451,11 @@
aria-label="Close theme creator"
onclick={() => void CloseThemeCreator()}
>
✕
<XIcon size="1em" />
</button>
</div>
<a href='https://docs.betterseqta.org/theme-creation/' target='_blank' rel='noopener noreferrer' class='text-sm font-light text-zinc-500 dark:text-zinc-400'>
<span class='pr-0.5 no-underline font-IconFamily'>{'\ueb44'}</span>
<CircleQuestionMarkIcon size="1em" class="pr-0.5" />
<span class='underline'>
Need help? Check out the docs!
</span>
@@ -473,7 +479,7 @@
id='themeDescription'
placeholder="Don't worry, this one's optional!"
bind:value={theme.description}
class='p-2 w-full rounded-lg border-0 transition dark:placeholder-zinc-300 bg-zinc-200 dark:bg-zinc-700 focus:outline-hidden focus:ring-1 focus:ring-zinc-100 dark:focus:ring-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600'></textarea>
class='p-2 w-full rounded-lg border-0 transition dark:placeholder-zinc-300 bg-zinc-200 dark:bg-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600'></textarea>
</div>
<Divider />
@@ -531,7 +537,7 @@
class="min-w-0 flex-1 rounded-lg border-0 bg-zinc-100 p-2 text-sm dark:bg-zinc-600 dark:text-white"
/>
<button type="button" class="p-2 dark:text-white" onclick={() => onRemoveImage(image.id)}>
<span class="text-xl font-IconFamily">{'\ued8c'}</span>
<XIcon size="1em" class="text-xl" />
</button>
</div>
<select
@@ -548,7 +554,7 @@
{/each}
<label class="flex h-10 cursor-pointer items-center justify-center gap-2 rounded-lg bg-zinc-200 dark:bg-zinc-700">
<span class="font-IconFamily">{'\uec60'}</span>
<PlusIcon size="1em" />
<span class="text-sm dark:text-white">Add image</span>
<input type="file" accept="image/*" class="hidden" onchange={onImageUpload} />
</label>
@@ -613,7 +619,7 @@
.filter(Boolean);
theme = { ...theme, adaptiveCssVariables: lines };
}}
class="p-2 mt-2 w-full min-h-20 font-mono text-sm rounded-lg border-0 transition dark:placeholder-zinc-400 bg-zinc-200 dark:bg-zinc-700 focus:outline-hidden focus:ring-1 focus:ring-zinc-100 dark:focus:ring-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600"
class="p-2 mt-2 w-full min-h-20 font-mono text-sm rounded-lg border-0 transition dark:placeholder-zinc-400 bg-zinc-200 dark:bg-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600"
></textarea>
</div>
+3 -3
View File
@@ -3,14 +3,14 @@ import { resolveExtensionAssetUrl } from "./extensionAssetUrl";
describe("resolveExtensionAssetUrl", () => {
it("returns already-resolved extension URLs unchanged", () => {
const url = "chrome-extension://abc/assets/IconFamily-B8lopphU.woff";
const url = "chrome-extension://abc/assets/icon-48-B8lopphU.png";
expect(resolveExtensionAssetUrl(url)).toBe(url);
});
it("repairs accidental double extension URL prefix", () => {
const doubled = "chrome-extension://abc/chrome-extension://abc/assets/IconFamily-B8lopphU.woff";
const doubled = "chrome-extension://abc/chrome-extension://abc/assets/icon-48-B8lopphU.png";
expect(resolveExtensionAssetUrl(doubled)).toBe(
"chrome-extension://abc/assets/IconFamily-B8lopphU.woff",
"chrome-extension://abc/assets/icon-48-B8lopphU.png",
);
});
});
+19
View File
@@ -0,0 +1,19 @@
type IconOptions = {
class?: string;
id?: string;
size?: number | string;
style?: string;
};
export function icon(svg: string, options: IconOptions = {}): string {
const size = options.size ?? 24;
let markup = svg
.trim()
.replace(/\swidth="24"/, ` width="${size}"`)
.replace(/\sheight="24"/, ` height="${size}"`)
.replace("<svg", '<svg aria-hidden="true"');
if (options.class) markup = markup.replace('class="lucide', `class="${options.class} lucide`);
if (options.id) markup = markup.replace("<svg", `<svg id="${options.id}"`);
if (options.style) markup = markup.replace("<svg", `<svg style="${options.style}"`);
return markup;
}
-5
View File
@@ -1,5 +0,0 @@
/** Material "dark_mode" moon icon — filled style to match SEQTA menu bar icons. */
export const LUCIDE_MOON_PATH =
"M12,3C7.03,3 3,7.03 3,12C3,16.97 7.03,21 12,21C16.97,21 21,16.97 21,12C21,11.54 20.96,11.08 20.9,10.64C19.92,12.01 18.32,12.9 16.5,12.9C13.52,12.9 11.1,10.48 11.1,7.5C11.1,5.68 11.99,4.08 13.36,3.1C12.92,3.04 12.46,3 12,3Z";
export const LUCIDE_MOON_ICON_SVG = `<path fill="currentColor" d="${LUCIDE_MOON_PATH}"/>`;
-5
View File
@@ -1,5 +0,0 @@
/** Material "light_mode" sun icon — filled style to match SEQTA menu bar icons. */
export const LUCIDE_SUN_PATH =
"M12,7C9.24,7 7,9.24 7,12C7,14.76 9.24,17 12,17C14.76,17 17,14.76 17,12C17,9.24 14.76,7 12,7M2,13H4C4.55,13 5,12.55 5,12C5,11.45 4.55,11 4,11H2C1.45,11 1,11.45 1,12C1,12.55 1.45,13 2,13M20,13H22C22.55,13 23,12.55 23,12C23,11.45 22.55,11 22,11H20C19.45,11 19,11.45 19,12C19,12.55 19.45,13 20,13M11,2V4C11,4.55 11.45,5 12,5C12.55,5 13,4.55 13,4V2C13,1.45 12.55,1 12,1C11.45,1 11,1.45 11,2M11,20V22C11,22.55 11.45,23 12,23C12.55,23 13,22.55 13,22V20C13,19.45 12.55,19 12,19C11.45,19 11,19.45 11,20M5.99,4.58C5.6,4.19 4.96,4.19 4.58,4.58C4.19,4.96 4.19,5.6 4.58,5.99L5.64,7.05C6.03,7.44 6.67,7.44 7.05,7.05C7.44,6.67 7.44,6.03 7.05,5.64L5.99,4.58M18.36,16.95C17.97,16.56 17.33,16.56 16.95,16.95C16.56,17.33 16.56,17.97 16.95,18.36L18.01,19.42C18.4,19.81 19.04,19.81 19.42,19.42C19.81,19.04 19.81,18.4 19.42,18.01L18.36,16.95M19.42,5.99C19.81,5.6 19.81,4.96 19.42,4.58C19.04,4.19 18.4,4.19 18.01,4.58L16.95,5.64C16.56,6.03 16.56,6.67 16.95,7.05C17.33,7.44 17.97,7.44 18.36,7.05L19.42,5.99M7.05,18.36C7.44,17.97 7.44,17.33 7.05,16.95C6.67,16.56 6.03,16.56 5.64,16.95L4.58,18.01C4.19,18.4 4.19,19.04 4.58,19.42C4.96,19.81 5.6,19.81 5.99,19.42L7.05,18.36Z";
export const LUCIDE_SUN_ICON_SVG = `<path fill="currentColor" d="${LUCIDE_SUN_PATH}"/>`;
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { RotateCw } from "lucide-static";
import type { AssessmentsAverageApi } from "./pluginApi";
import stringToHTML from "@/seqta/utils/stringToHTML";
import { waitForElm } from "@/seqta/utils/waitForElm";
@@ -181,7 +183,7 @@ async function renderSubjectAverage(api: AssessmentsAverageApi) {
} else if (hasRefreshingWeighting) {
warningHTML = /* html */ `
<div style="margin-top: 4px; font-size: 11px; color: rgba(255, 255, 255, 0.55); opacity: 0.8; line-height: 1.3; white-space: nowrap;" title="Some weightings are being re-checked; the average may change shortly">
↻ Refreshing weightings
${icon(RotateCw, { size: "1em", style: "vertical-align: -0.125em" })} Refreshing weightings
</div>
`;
}
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { ClipboardCopy } from "lucide-static";
import debounce from "@/seqta/utils/debounce";
const RUBRIC_SELECTOR =
@@ -88,10 +90,8 @@ function ensureStyles() {
}
.betterseqta-rubric-copy-btn:focus-visible {
outline: none !important;
box-shadow:
0 0 0 2px rgba(255, 255, 255, 0.95),
0 0 0 4px rgba(59, 130, 246, 0.85) !important;
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px !important;
}
.betterseqta-rubric-copy-btn svg {
@@ -291,9 +291,7 @@ function createCopyButton(rubric: Element): HTMLButtonElement {
button.className = "betterseqta-rubric-copy-btn";
button.setAttribute("aria-label", "Copy rubric");
button.innerHTML = `
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184" />
</svg>
${icon(ClipboardCopy)}
<span class="betterseqta-rubric-copy-label">Copy rubric</span>
`;
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { RotateCw } from "lucide-static";
import { getUserInfo } from "@/seqta/utils/userInfo";
import ReactFiber from "@/seqta/utils/ReactFiber.ts";
import { isSeqtaEngageExperience } from "@/seqta/utils/isSeqtaEngage";
@@ -317,7 +319,7 @@ function updateWeightLabelContent(
input.placeholder = "Set %";
input.setAttribute("aria-label", "Assessment weighting percentage");
input.style.cssText =
"width:52px;padding:1px 4px;border-radius:4px;border:1px solid rgba(128,128,128,0.35);background:rgba(128,128,128,0.08);color:inherit;font-size:inherit;outline:none;";
"width:52px;padding:1px 4px;border-radius:4px;border:1px solid rgba(128,128,128,0.35);background:rgba(128,128,128,0.08);color:inherit;font-size:inherit;";
attachWeightInputListeners(input, api, assessmentID);
weightLabel.appendChild(input);
weightLabel.title = "Enter assessment weighting %";
@@ -327,7 +329,8 @@ function updateWeightLabelContent(
const span = document.createElement("span");
span.className = "betterseqta-weight-value";
const baseText = weighting && weighting !== "N/A" ? formatWeightDisplay(weighting) : "N/A";
span.textContent = refreshing ? `${baseText} ↻` : baseText;
span.textContent = baseText;
if (refreshing) span.insertAdjacentHTML("beforeend", ` ${icon(RotateCw, { size: "1em" })}`);
if (refreshing) {
span.style.opacity = "0.7";
weightLabel.title = "Re-checking weighting…";
@@ -1093,7 +1096,6 @@ function renderWeightingTabHtml(sheet: HTMLElement, context: WeightingTabContext
background:rgba(128,128,128,0.08);
color:inherit;
font-size:13px;
outline:none;
"
/>
</div>
@@ -10,11 +10,15 @@
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
import { isSeqtaEngageExperience } from "@/seqta/utils/isSeqtaEngage";
import { buildEngageAssessmentPagePath } from "@/seqta/utils/engageAssessmentStudent";
import OverviewIcon from "./OverviewIcon.svelte";
import CalendarDaysIcon from "@lucide/svelte/icons/calendar-days";
import ClipboardListIcon from "@lucide/svelte/icons/clipboard-list";
import EllipsisVerticalIcon from "@lucide/svelte/icons/ellipsis-vertical";
import EyeIcon from "@lucide/svelte/icons/eye";
import {
DEFAULT_COLUMN_ICON,
GROUP_SORT_ICONS,
STATUS_COLUMN_ICONS,
type OverviewIconName,
type OverviewIcon,
} from "./icons";
import confetti from "canvas-confetti";
@@ -30,18 +34,18 @@
key: string;
title: string;
className: string;
icon: OverviewIconName;
icon: OverviewIcon;
};
const HIDDEN_ASSESSMENTS_KEY = "betterseqta-hidden-assessments";
const COMPLETED_ASSESSMENTS_KEY = "betterseqta-completed-assessments";
const STATUS_COLUMNS: Column[] = [
{ key: "UPCOMING", title: "Upcoming", className: "column-upcoming", icon: "calendar-days" },
{ key: "DUE_SOON", title: "Due Soon", className: "column-due-soon", icon: "clock" },
{ key: "OVERDUE", title: "Overdue", className: "column-overdue", icon: "exclamation-triangle" },
{ key: "SUBMITTED", title: "Submitted", className: "column-submitted", icon: "document-check" },
{ key: "MARKS_RELEASED", title: "Marked", className: "column-marked", icon: "check-circle" },
{ key: "UPCOMING", title: "Upcoming", className: "column-upcoming", icon: STATUS_COLUMN_ICONS.UPCOMING },
{ key: "DUE_SOON", title: "Due Soon", className: "column-due-soon", icon: STATUS_COLUMN_ICONS.DUE_SOON },
{ key: "OVERDUE", title: "Overdue", className: "column-overdue", icon: STATUS_COLUMN_ICONS.OVERDUE },
{ key: "SUBMITTED", title: "Submitted", className: "column-submitted", icon: STATUS_COLUMN_ICONS.SUBMITTED },
{ key: "MARKS_RELEASED", title: "Marked", className: "column-marked", icon: STATUS_COLUMN_ICONS.MARKS_RELEASED },
];
const isEngage = isSeqtaEngageExperience();
@@ -156,7 +160,7 @@
return { filteredAssessments: filtered, statusGroups: groups, columns: STATUS_COLUMNS };
}
const icon = GROUP_SORT_ICONS[currentFilters.sortBy] ?? "queue-list";
const icon = GROUP_SORT_ICONS[currentFilters.sortBy] ?? DEFAULT_COLUMN_ICON;
const keys = Object.keys(groups);
const subjectTitles = new Map<string, string>(
data?.subjects?.map((s: any) => [s.code, `${s.code} - ${s.title}`]) ?? [],
@@ -307,7 +311,7 @@
onclick={() => (showVisibilityPanel = !showVisibilityPanel)}
title="Manage hidden subjects and assessments"
>
<OverviewIcon name="eye" size={18} />
<EyeIcon size={18} class="bsplus-overview-icon" />
<span>Visibility ({hiddenSubjects.length + hiddenAssessmentsWithInfo.length})</span>
</button>
{/if}
@@ -349,7 +353,7 @@
<div id="main-grid-content" class="bsplus-overview-animate bsplus-overview-delay-1">
{#if board.filteredAssessments.length === 0}
<div class="empty-state">
<OverviewIcon name="clipboard-document-list" size={40} class="empty-icon" />
<ClipboardListIcon size={40} class="bsplus-overview-icon empty-icon" />
<p>No assessments found matching your filters</p>
</div>
{:else}
@@ -361,10 +365,7 @@
<div class="column-header">
<div class="column-title">
<span class="column-title-main">
<OverviewIcon
name={column.icon ?? STATUS_COLUMN_ICONS[column.key] ?? "queue-list"}
size={18}
/>
<column.icon size={18} class="bsplus-overview-icon" />
{column.title}
</span>
<span class="column-count">{board.statusGroups[column.key].length}</span>
@@ -407,7 +408,7 @@
onclick={(e) => toggleMenu(assessment.id, e)}
aria-label="Open menu"
>
<OverviewIcon name="ellipsis-vertical" size={16} />
<EllipsisVerticalIcon size={16} class="bsplus-overview-icon" />
</button>
<div class="menu-dropdown" style="display: {openMenuId === assessment.id ? 'block' : 'none'};">
{#if status !== "MARKS_RELEASED"}
@@ -434,7 +435,7 @@
{#if !assessmentHasGradeDisplay(assessment) && !isCompleted}
<div class="assessment-meta">
<div class="due-date {dueDateClass}">
<OverviewIcon name="calendar-days" size={14} />
<CalendarDaysIcon size={14} class="bsplus-overview-icon" />
{formatDate(assessment.due || assessment.date || assessment.dueDate || "", assessment.submitted)}
</div>
</div>
@@ -1,11 +1,11 @@
<script lang="ts">
import OverviewIcon from "./OverviewIcon.svelte";
import CircleAlertIcon from "@lucide/svelte/icons/circle-alert";
let { error }: { error: string } = $props();
</script>
<div class="error-container bsplus-overview-animate">
<OverviewIcon name="exclamation-circle" size={40} class="error-icon" />
<CircleAlertIcon size={40} class="bsplus-overview-icon error-icon" />
<p class="error-text">Failed to load assessments</p>
<p class="error-detail">{error}</p>
</div>
@@ -1,32 +0,0 @@
<script lang="ts">
import { OVERVIEW_ICON_PATHS, type OverviewIconName } from "./icons";
interface Props {
name: OverviewIconName;
class?: string;
size?: number;
}
let { name, class: className = "", size = 20 }: Props = $props();
const paths = $derived.by(() => {
const raw = OVERVIEW_ICON_PATHS[name];
return Array.isArray(raw) ? raw : [raw];
});
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
width={size}
height={size}
class="bsplus-overview-icon {className}"
aria-hidden="true"
>
{#each paths as path, index (index)}
<path stroke-linecap="round" stroke-linejoin="round" d={path} />
{/each}
</svg>
@@ -1,18 +1,17 @@
<script lang="ts">
import OverviewIcon from "./OverviewIcon.svelte";
import type { OverviewIconName } from "./icons";
import { STATUS_COLUMN_ICONS, type OverviewIcon } from "./icons";
const columns: {
key: string;
title: string;
className: string;
icon: OverviewIconName;
icon: OverviewIcon;
skeletonCount: number;
}[] = [
{ key: "UPCOMING", title: "Upcoming", className: "column-upcoming", icon: "calendar-days", skeletonCount: 3 },
{ key: "DUE_SOON", title: "Due Soon", className: "column-due-soon", icon: "clock", skeletonCount: 2 },
{ key: "OVERDUE", title: "Overdue", className: "column-overdue", icon: "exclamation-triangle", skeletonCount: 1 },
{ key: "MARKS_RELEASED", title: "Marked", className: "column-marked", icon: "check-circle", skeletonCount: 4 },
{ key: "UPCOMING", title: "Upcoming", className: "column-upcoming", icon: STATUS_COLUMN_ICONS.UPCOMING, skeletonCount: 3 },
{ key: "DUE_SOON", title: "Due Soon", className: "column-due-soon", icon: STATUS_COLUMN_ICONS.DUE_SOON, skeletonCount: 2 },
{ key: "OVERDUE", title: "Overdue", className: "column-overdue", icon: STATUS_COLUMN_ICONS.OVERDUE, skeletonCount: 1 },
{ key: "MARKS_RELEASED", title: "Marked", className: "column-marked", icon: STATUS_COLUMN_ICONS.MARKS_RELEASED, skeletonCount: 4 },
];
</script>
@@ -40,7 +39,7 @@
<div class="column-header">
<div class="column-title">
<span class="column-title-main">
<OverviewIcon name={column.icon} size={18} />
<column.icon size={18} class="bsplus-overview-icon" />
{column.title}
</span>
<span class="column-count">…</span>
@@ -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<OverviewIconName, string | string[]> = {
"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<string, OverviewIcon> = {
UPCOMING: CalendarDaysIcon,
DUE_SOON: ClockIcon,
OVERDUE: TriangleAlertIcon,
SUBMITTED: FileCheckIcon,
MARKS_RELEASED: CircleCheckIcon,
};
export const STATUS_COLUMN_ICONS: Record<string, OverviewIconName> = {
UPCOMING: "calendar-days",
DUE_SOON: "clock",
OVERDUE: "exclamation-triangle",
SUBMITTED: "document-check",
MARKS_RELEASED: "check-circle",
};
export const GROUP_SORT_ICONS: Record<string, OverviewIconName> = {
year: "calendar",
subject: "book-open",
grade: "chart-bar",
title: "queue-list",
export const GROUP_SORT_ICONS: Record<string, OverviewIcon> = {
year: CalendarIcon,
subject: BookOpenIcon,
grade: ChartColumnIcon,
title: ListIcon,
};
@@ -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 {
@@ -1,4 +1,5 @@
<script lang="ts">
import UploadIcon from "@lucide/svelte/icons/upload";
import localforage from 'localforage'
import { onMount } from 'svelte'
@@ -104,7 +105,7 @@
</div>
{:else}
<div class="flex gap-2 items-center px-3 py-1 text-xs rounded-lg border border-dashed transition border-zinc-300 dark:border-zinc-600 text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300 text-nowrap">
<span class="text-lg font-IconFamily">{'\ued47'}</span>
<UploadIcon size="1em" class="text-lg" />
<span>Upload audio</span>
</div>
{/if}
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { ChevronLeft, ChevronRight } from "lucide-static";
import type { Plugin } from "@/plugins/core/types";
import { BasePlugin } from "@/plugins/core/settings";
import { booleanSetting, defineSettings, Setting } from "@/plugins/core/settingsHelpers";
@@ -193,10 +195,10 @@ const ensureArrows = (course: HTMLElement) => {
container.id = ARROW_CONTAINER_ID;
container.innerHTML = `
<button type="button" class="en-arrow" data-en-action="prev" title="Previous lesson" aria-label="Previous lesson">
<svg viewBox="0 0 24 24"><path d="M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>
${icon(ChevronLeft)}
</button>
<button type="button" class="en-arrow" data-en-action="next" title="Next lesson" aria-label="Next lesson">
<svg viewBox="0 0 24 24"><path d="M8.59 16.59 10 18l6-6-6-6-1.41 1.41L13.17 12z"/></svg>
${icon(ChevronRight)}
</button>
`;
document.body.appendChild(container);
@@ -1,4 +1,5 @@
<script lang="ts">
import ArrowRightIcon from "@lucide/svelte/icons/arrow-right";
import { onDestroy } from 'svelte';
import { calculateExpression } from '../utils/calculator';
@@ -79,7 +80,7 @@
<div class="flex flex-col shrink-0 justify-center items-center w-12">
<div class="h-8 w-px bg-zinc-900/5 dark:bg-zinc-100/5"></div>
<div class="text-2xl text-zinc-900 dark:text-zinc-100">
→
<ArrowRightIcon size="1em" />
</div>
<div class="h-8 w-px bg-zinc-900/5 dark:bg-zinc-100/5"></div>
</div>
@@ -1,4 +1,7 @@
<script lang="ts">
import FolderOpenIcon from "@lucide/svelte/icons/folder-open";
import SearchIcon from "./SearchIcon.svelte";
import { iconForCategory } from "../core/searchIcons";
import { onMount, tick } from 'svelte';
import { settingsState } from '@/seqta/utils/listeners/SettingsState'
import { fade, scale } from 'svelte/transition';
@@ -339,14 +342,14 @@
tabindex="0">
<div class="relative p-2 border-b border-zinc-900/5 dark:border-zinc-100/5">
<div class="absolute top-1/2 translate-y-[calc(-50%-3px)] scale-105 left-5 w-6 h-6 text-[1.3rem] text-zinc-900/40 dark:text-zinc-400/40 pointer-events-none font-IconFamily">
{'\ueca5'}
<div class="absolute top-1/2 translate-y-[calc(-50%-3px)] scale-105 left-5 w-6 h-6 text-[1.3rem] text-zinc-900/40 dark:text-zinc-400/40 pointer-events-none">
<SearchIcon name="search" />
</div>
<input
bind:this={searchbar}
bind:value={searchTerm}
onkeydown={handleKeyNav}
class="pr-4 pl-12 w-full h-10 text-lg bg-transparent border-0 outline-hidden placeholder-zinc-400 text-zinc-700 dark:placeholder-zinc-500 dark:text-white focus:ring-0 sm:text-xl"
class="pr-4 pl-12 w-full h-10 text-lg bg-transparent border-0 outline-hidden placeholder-zinc-400 text-zinc-700 dark:placeholder-zinc-500 dark:text-white sm:text-xl"
placeholder="Search..."
/>
</div>
@@ -373,7 +376,7 @@
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow-sm' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
onclick={() => executeItemAction(staticItem)}
>
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-linear-to-br {staticItem.category === 'navigation' ? 'from-[#FA5D5D] to-[#DC2F30]' : 'from-[#4FBBFE] to-[#2090F3]'} rounded-md text-white">{staticItem.icon}</div>
<div class="flex-none scale-90 w-8 h-8 text-xl flex items-center justify-center bg-linear-to-br {staticItem.category === 'navigation' ? 'from-[#FA5D5D] to-[#DC2F30]' : 'from-[#4FBBFE] to-[#2090F3]'} rounded-md text-white"><SearchIcon name={staticItem.icon} /></div>
<span class="ml-4 text-lg truncate">
<HighlightedText text={staticItem.text} term={searchTerm} matches={result.matches} />
</span>
@@ -399,7 +402,7 @@
onclick={() => executeItemAction(dynamicItem)}
>
<div class="flex items-center w-full">
<div class="flex-none w-8 h-8 text-xl font-IconFamily flex items-center justify-center {isSelected ? 'text-zinc-900 dark:text-white' : 'text-zinc-600 dark:text-zinc-400'}">{dynamicItem.metadata?.icon || '\ue924'}</div>
<div class="flex-none w-8 h-8 text-xl flex items-center justify-center {isSelected ? 'text-zinc-900 dark:text-white' : 'text-zinc-600 dark:text-zinc-400'}"><SearchIcon name={iconForCategory(dynamicItem.category)} /></div>
<span class="ml-4 text-lg truncate">
<HighlightedText text={dynamicItem.text} term={searchTerm} matches={result.matches} />
</span>
@@ -423,9 +426,7 @@
<div class="mx-auto w-8 h-8 rounded-full border-2 animate-spin border-zinc-300 dark:border-zinc-700 border-t-zinc-600 dark:border-t-zinc-300"></div>
<p class="mt-4 text-lg dark:text-zinc-300">Searching...</p>
{:else}
<svg class="mx-auto w-8 h-8" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z" />
</svg>
<FolderOpenIcon class="mx-auto w-8 h-8" />
<p class="mt-6 text-lg dark:text-zinc-300">No matches found. Try something else.</p>
{/if}
</div>
@@ -0,0 +1,48 @@
<script lang="ts">
import AppWindowIcon from "@lucide/svelte/icons/app-window";
import BookOpenIcon from "@lucide/svelte/icons/book-open";
import CalendarIcon from "@lucide/svelte/icons/calendar";
import ClipboardListIcon from "@lucide/svelte/icons/clipboard-list";
import FileChartColumnIcon from "@lucide/svelte/icons/file-chart-column";
import FileTextIcon from "@lucide/svelte/icons/file-text";
import HouseIcon from "@lucide/svelte/icons/house";
import InboxIcon from "@lucide/svelte/icons/inbox";
import LayoutDashboardIcon from "@lucide/svelte/icons/layout-dashboard";
import MegaphoneIcon from "@lucide/svelte/icons/megaphone";
import MessageSquareIcon from "@lucide/svelte/icons/message-square";
import MessageSquareMoreIcon from "@lucide/svelte/icons/message-square-more";
import MessageSquarePlusIcon from "@lucide/svelte/icons/message-square-plus";
import MessagesSquareIcon from "@lucide/svelte/icons/messages-square";
import RouteIcon from "@lucide/svelte/icons/route";
import SearchIcon from "@lucide/svelte/icons/search";
import SunIcon from "@lucide/svelte/icons/sun";
import TargetIcon from "@lucide/svelte/icons/target";
import type { SearchIconName } from "../core/searchIcons";
let { name, class: className = "" }: { name: SearchIconName; class?: string } = $props();
const ICONS = {
"app-window": AppWindowIcon,
"book-open": BookOpenIcon,
calendar: CalendarIcon,
"clipboard-list": ClipboardListIcon,
"file-chart-column": FileChartColumnIcon,
"file-text": FileTextIcon,
house: HouseIcon,
inbox: InboxIcon,
"layout-dashboard": LayoutDashboardIcon,
megaphone: MegaphoneIcon,
"message-square": MessageSquareIcon,
"message-square-more": MessageSquareMoreIcon,
"message-square-plus": MessageSquarePlusIcon,
"messages-square": MessagesSquareIcon,
route: RouteIcon,
search: SearchIcon,
sun: SunIcon,
target: TargetIcon,
} satisfies Record<SearchIconName, unknown>;
const Icon = $derived(ICONS[name]);
</script>
<Icon size="1em" class={className} />
@@ -1,4 +1,5 @@
<script lang="ts">
import SearchIcon from "../SearchIcon.svelte";
import HighlightedText from '../../utils/HighlightedText.svelte';
import type { DynamicContentItem } from '../../utils/dynamicItems';
import type { FuseResultMatch } from '../../core/types';
@@ -18,7 +19,7 @@
onclick={onclick}
>
<div class="flex items-center w-full">
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-linear-to-br from-[#59F675] to-[#1BC636] rounded-md text-white">{item.metadata?.icon || '\uebee'}</div>
<div class="flex-none scale-90 w-8 h-8 text-xl flex items-center justify-center bg-linear-to-br from-[#59F675] to-[#1BC636] rounded-md text-white"><SearchIcon name="message-square-more" /></div>
<span class="ml-4 text-lg truncate">
<HighlightedText text={item.text} term={searchTerm} matches={matches} />
</span>
@@ -1,4 +1,5 @@
<script lang="ts">
import SearchIcon from "../SearchIcon.svelte";
import HighlightedText from '../../utils/HighlightedText.svelte';
import type { DynamicContentItem } from '../../utils/dynamicItems';
import type { FuseResultMatch } from '../../core/types';
@@ -18,7 +19,7 @@
onclick={onclick}
>
<div class="flex items-center w-full">
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white bg-linear-to-br from-[#59aaf6] to-[#1b62c6] rounded-md">{item.metadata?.icon || '\uebe7'}</div>
<div class="flex-none scale-90 w-8 h-8 text-xl flex items-center justify-center text-white bg-linear-to-br from-[#59aaf6] to-[#1b62c6] rounded-md"><SearchIcon name="messages-square" /></div>
<span class="ml-4 text-lg truncate {item.metadata?.closed ? 'line-through opacity-80' : ''}">
<HighlightedText text={item.text} term={searchTerm} matches={matches} />
</span>
@@ -1,4 +1,6 @@
<script lang="ts">
import SearchIcon from "../SearchIcon.svelte";
import { iconForCategory } from "../../core/searchIcons";
import HighlightedText from '../../utils/HighlightedText.svelte';
import type { DynamicContentItem } from '../../utils/dynamicItems';
import type { FuseResultMatch } from '../../core/types';
@@ -39,28 +41,6 @@
}
};
const fallbackIcon = (category: string): string => {
switch (category) {
case 'courses':
return '\ueb4d';
case 'notices':
return '\ueb24';
case 'documents':
return '\ueb6f';
case 'folio':
return '\ueb16';
case 'portals':
return '\ueb01';
case 'reports':
return '\ueb70';
case 'goals':
return '\uea15';
case 'passive':
return '\ueb71';
default:
return '\ue924';
}
};
</script>
<button
@@ -70,9 +50,9 @@
>
<div class="flex items-center w-full">
<div
class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white rounded-md bg-linear-to-br {gradientForCategory(item.category)}"
class="flex-none scale-90 w-8 h-8 text-xl flex items-center justify-center text-white rounded-md bg-linear-to-br {gradientForCategory(item.category)}"
>
{item.metadata?.icon || fallbackIcon(item.category)}
<SearchIcon name={iconForCategory(item.category)} />
</div>
<span class="ml-4 text-lg truncate">
<HighlightedText text={item.text} term={searchTerm} matches={matches} />
@@ -1,4 +1,5 @@
<script lang="ts">
import SearchIcon from "../SearchIcon.svelte";
import HighlightedText from '../../utils/HighlightedText.svelte';
import type { IndexItem } from '../../indexing/types';
import type { FuseResultMatch } from '../../core/types';
@@ -24,8 +25,8 @@
onclick={onclick}
>
<div class="flex items-center w-full">
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white {item.metadata?.type === 'assessments' ? 'bg-linear-to-br from-[#fa915d] to-[#dc6c2f] rounded-md' : 'bg-linear-to-br from-[#4FBBFE] to-[#2090F3] rounded-md'} {item.metadata.isActive ? 'opacity-100' : 'opacity-80'}">
{item.metadata?.type === 'assessments' ? '\ueac3' : '\ueb4d'}
<div class="flex-none scale-90 w-8 h-8 text-xl flex items-center justify-center text-white {item.metadata?.type === 'assessments' ? 'bg-linear-to-br from-[#fa915d] to-[#dc6c2f] rounded-md' : 'bg-linear-to-br from-[#4FBBFE] to-[#2090F3] rounded-md'} {item.metadata.isActive ? 'opacity-100' : 'opacity-80'}">
<SearchIcon name={item.metadata?.type === "assessments" ? "clipboard-list" : "book-open"} />
</div>
<span class="ml-4 text-lg truncate {item.metadata.isActive ? 'opacity-100' : 'opacity-70'}">
<HighlightedText text={item.text} term={searchTerm} matches={matches} />
@@ -1,3 +1,4 @@
import type { SearchIconName } from "./searchIcons";
import type { HomeTimetableLesson } from "@/seqta/utils/loaders/homePageTypes";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
import { loadHomePage } from "@/seqta/utils/loaders/LoadHomePage";
@@ -7,7 +8,7 @@ export interface BaseCommandItem {
id: string;
text: string;
category: string;
icon: string;
icon: SearchIconName;
action: () => void;
keywords?: string[];
priority?: number;
@@ -134,7 +135,7 @@ function formatDate(date: Date): string {
const staticCommands: StaticCommandItem[] = [
{
id: "home",
icon: "\ueb4c",
icon: "house",
category: "navigation",
text: "Home",
action: () => {
@@ -145,7 +146,7 @@ const staticCommands: StaticCommandItem[] = [
},
{
id: "messages",
icon: "\uebfd",
icon: "message-square",
category: "navigation",
text: "Direct Messages",
action: () => {
@@ -155,7 +156,7 @@ const staticCommands: StaticCommandItem[] = [
},
{
id: "timetable",
icon: "\ue9cd",
icon: "calendar",
category: "navigation",
text: "Timetable",
action: () => {
@@ -165,7 +166,7 @@ const staticCommands: StaticCommandItem[] = [
},
{
id: "Current Lesson",
icon: "\ue9a5",
icon: "book-open",
category: "navigation",
text: "Current Lesson",
priority: 4,
@@ -180,7 +181,7 @@ const staticCommands: StaticCommandItem[] = [
},
{
id: "assessments",
icon: "\ueac3",
icon: "clipboard-list",
category: "navigation",
text: "Assessments",
keybind: ["alt+a"],
@@ -192,7 +193,7 @@ const staticCommands: StaticCommandItem[] = [
},
{
id: "dashboard",
icon: "\ueb87",
icon: "layout-dashboard",
category: "navigation",
text: "Dashboard",
priority: 4,
@@ -202,7 +203,7 @@ const staticCommands: StaticCommandItem[] = [
},
{
id: "compose-message",
icon: "\ue924",
icon: "message-square-plus",
category: "action",
text: "Compose Message",
action: () => {
@@ -222,7 +223,7 @@ const staticCommands: StaticCommandItem[] = [
},
{
id: "toggle-dark-mode",
icon: "\uecfe",
icon: "sun",
category: "action",
text: "Toggle Dark Mode",
action: () => (settingsState.DarkMode = !settingsState.DarkMode),
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { Search } from "lucide-static";
import SearchBar from "../components/SearchBar.svelte";
import { unmount } from "svelte";
import { warmUpVectorSearchOnInteraction } from "../search/vector/vectorSearch";
@@ -20,8 +22,7 @@ type AppRef = {
ownedTrigger?: boolean;
};
const SEARCH_SVG =
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>';
const SEARCH_SVG = icon(Search, { size: 16 });
async function resolveTriggerWrapper(titleElement: Element): Promise<HTMLElement | null> {
const existing = titleElement.querySelector(".search-trigger-wrapper") as HTMLElement | null;
@@ -0,0 +1,34 @@
export type SearchIconName =
| "app-window"
| "book-open"
| "calendar"
| "clipboard-list"
| "file-chart-column"
| "file-text"
| "house"
| "inbox"
| "layout-dashboard"
| "megaphone"
| "message-square"
| "message-square-more"
| "message-square-plus"
| "messages-square"
| "route"
| "search"
| "sun"
| "target";
const CATEGORY_ICONS: Record<string, SearchIconName> = {
courses: "book-open",
notices: "megaphone",
documents: "file-text",
folio: "route",
portals: "app-window",
reports: "file-chart-column",
goals: "target",
passive: "inbox",
};
export function iconForCategory(category: string): SearchIconName {
return CATEGORY_ICONS[category] ?? "message-square-plus";
}
@@ -163,7 +163,6 @@ export const coursesJob: Job = {
isActive: true,
route: `/courses/${subject.programme}:${subject.metaclass}`,
entityType: "course",
icon: "\ueb4d",
},
actionId: "course",
renderComponentId: "course",
@@ -120,7 +120,6 @@ export const documentsJob: Job = {
createdDate: doc.created_date,
entityType: "document",
route: "/documents",
icon: "\ueb6f",
},
actionId: "document",
renderComponentId: "document",
@@ -116,7 +116,6 @@ export const folioJob: Job = {
fileCount: Array.isArray(detail?.files) ? detail!.files!.length : 0,
entityType: "folio",
route: "/folios/read",
icon: "\ueb16",
},
actionId: "folio",
renderComponentId: "folio",
@@ -90,7 +90,6 @@ export const goalsJob: Job = {
updatedAt: goal.updated,
entityType: "goal",
route: `/goals/${year}`,
icon: "\uea15",
},
actionId: "goal",
renderComponentId: "goal",
@@ -168,7 +168,6 @@ export const noticesJob: Job = {
timestamp: date,
entityType: "notice",
route: "/notices",
icon: "\ueb24",
},
actionId: "notice",
renderComponentId: "notice",
@@ -76,7 +76,6 @@ export const portalsJob: Job = {
url,
isPowerPortal: !!portal.is_power_portal,
entityType: "portal",
icon: "\ueb01",
},
actionId: "portal",
renderComponentId: "portal",
@@ -83,7 +83,6 @@ export const reportsJob: Job = {
filename: report.filename,
entityType: "report",
route: "/reports",
icon: "\ueb70",
},
actionId: "report",
renderComponentId: "report",
@@ -320,7 +320,6 @@ function passiveEntityToIndexItem(
observedAt: new Date(ctx.observedAt).toISOString(),
entityType: category,
entityId,
icon: "\ueb71",
sourcePage,
...(isPeopleSupport ? { supportRecord: true, priority: "low" } : {}),
...deepLinkHints,
@@ -1,4 +1,6 @@
<script lang="ts">
import CheckIcon from "@lucide/svelte/icons/check";
import XIcon from "@lucide/svelte/icons/x";
import { fade, scale } from "svelte/transition";
import type { AnalyticsClassGroup, AnalyticsClassOption } from "./types";
import { animationsEnabled } from "@/seqta/utils/performanceMode";
@@ -145,7 +147,7 @@
aria-label="Delete {group.name}"
onclick={() => deleteGroup(group.id)}
>
×
<XIcon size="1em" />
</button>
</li>
{/each}
@@ -189,7 +191,7 @@
aria-label="Close"
onclick={cancelEditor}
>
×
<XIcon size="1em" />
</button>
</header>
@@ -222,7 +224,7 @@
onchange={() => toggleDraftClass(option.key)}
/>
<span class="bsplus-analytics-class-groups-check" aria-hidden="true">
{#if picked}✓{/if}
{#if picked}<CheckIcon size="1em" />{/if}
</span>
<span class="bsplus-analytics-class-groups-pick-text">
<span class="bsplus-analytics-class-groups-pick-label">{option.title}</span>
@@ -1,4 +1,5 @@
<script lang="ts">
import CheckIcon from "@lucide/svelte/icons/check";
import { onMount, onDestroy } from "svelte";
import { fade } from "svelte/transition";
import type {
@@ -413,7 +414,7 @@
aria-pressed={selected}
onclick={() => selectTimeRange(option.value)}
>
<span class="bsplus-analytics-dropdown-check" aria-hidden="true">{selected ? "✓" : ""}</span>
<span class="bsplus-analytics-dropdown-check" aria-hidden="true">{#if selected}<CheckIcon size="1em" />{/if}</span>
<span>{option.label}</span>
</button>
{/each}
@@ -469,7 +470,7 @@
aria-pressed={allSelected}
onclick={selectAllSubjects}
>
<span class="bsplus-analytics-dropdown-check" aria-hidden="true">{allSelected ? "✓" : ""}</span>
<span class="bsplus-analytics-dropdown-check" aria-hidden="true">{#if allSelected}<CheckIcon size="1em" />{/if}</span>
<span>All subjects</span>
</button>
{#each uniqueSubjects as subject (subject)}
@@ -481,7 +482,7 @@
aria-pressed={selected}
onclick={() => toggleSubject(subject)}
>
<span class="bsplus-analytics-dropdown-check" aria-hidden="true">{selected ? "✓" : ""}</span>
<span class="bsplus-analytics-dropdown-check" aria-hidden="true">{#if selected}<CheckIcon size="1em" />{/if}</span>
<span class="bsplus-analytics-filter-subject-name">{subject}</span>
</button>
{/each}
@@ -1,4 +1,6 @@
<script lang="ts">
import ChevronDownIcon from "@lucide/svelte/icons/chevron-down";
import XIcon from "@lucide/svelte/icons/x";
import {
createGradeBand,
DEFAULT_ANALYTICS_GRADE_INFERENCE,
@@ -83,8 +85,7 @@
>
<span class="bsplus-analytics-field-label">Grade inference (optional)</span>
<span class="bsplus-analytics-grade-inference-chevron" aria-hidden="true"
>{expanded ? "▾" : "▸"}</span
>
><ChevronDownIcon size="1em" style={expanded ? undefined : "transform: rotate(-90deg)"} /></span>
</button>
{#if expanded}
@@ -136,7 +137,7 @@
disabled={disabled || saving}
onclick={() => removeBand(band.id)}
>
×
<XIcon size="1em" />
</button>
</div>
{/each}
@@ -1,4 +1,4 @@
import MenuitemSVGKey from "@/seqta/content/MenuItemSVGKey.json";
import { pageIcon } from "@/seqta/utils/pageIcons";
import { waitForElm } from "@/seqta/utils/waitForElm";
import { isSeqtaEngageExperience } from "@/seqta/utils/isSeqtaEngage";
import {
@@ -14,7 +14,7 @@ import { applyMenuItemVisibility } from "@/seqta/utils/menuItemVisibility";
import { getNativeMenuList } from "@/seqta/ui/sidebar/parseNativeMenu";
import { rafThrottle } from "@/seqta/utils/rafThrottle";
const ANALYTICS_MENU_ICON = MenuitemSVGKey.analytics;
const ANALYTICS_MENU_ICON = pageIcon("analytics")!;
export const ANALYTICS_MENU_CLASS = "betterseqta-grade-analytics-item";
export const ANALYTICS_MENU_KEY = "analytics";
+10 -10
View File
@@ -238,7 +238,7 @@
}
.bsplus-analytics-btn:focus-visible {
outline: 2px solid var(--bsplus-analytics-accent);
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
}
@@ -338,7 +338,7 @@
}
.bsplus-analytics-filters-clear:focus-visible {
outline: 2px solid var(--bsplus-analytics-accent);
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
border-radius: 4px;
}
@@ -547,7 +547,7 @@
}
.bsplus-analytics-checkbox input:focus-visible ~ .bsplus-analytics-checkmark {
outline: 2px solid var(--bsplus-analytics-accent);
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
}
@@ -663,9 +663,9 @@
);
}
.bsplus-analytics-select:focus,
.bsplus-analytics-input:focus {
outline: 2px solid var(--bsplus-analytics-accent);
.bsplus-analytics-select:focus-visible,
.bsplus-analytics-input:focus-visible {
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
background-color: color-mix(
in srgb,
@@ -680,7 +680,7 @@
border-color: var(--bsplus-analytics-accent);
}
.bsplus-analytics-filters .bsplus-analytics-input:focus {
.bsplus-analytics-filters .bsplus-analytics-input:focus-visible {
background-color: var(--bsplus-analytics-control-bg-elevated);
border-color: var(--bsplus-analytics-accent);
}
@@ -721,8 +721,8 @@
);
}
.bsplus-analytics-range-value:focus {
outline: 2px solid var(--bsplus-analytics-accent);
.bsplus-analytics-range-value:focus-visible {
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
background-color: color-mix(
in srgb,
@@ -821,7 +821,7 @@
}
.bsplus-analytics-dropdown-trigger:focus-visible {
outline: 2px solid var(--bsplus-analytics-accent);
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
background-color: color-mix(
in srgb,
+105 -84
View File
@@ -1,3 +1,29 @@
import { icon } from "@/lib/icon";
import {
Book,
Briefcase,
Calendar,
Check,
ChevronDown,
FileText,
Flame,
Folder,
GripHorizontal,
Heart,
House,
Inbox,
Lightbulb,
MessageSquare,
Music,
NotepadText,
Pencil,
Plus,
Star,
Target,
Trash,
Users,
X,
} from "lucide-static";
import type { Plugin } from "../../core/types";
import type { MessageFoldersSettings } from "./lazy";
import { waitForElm } from "@/seqta/utils/waitForElm";
@@ -6,7 +32,8 @@ interface Folder {
id: string;
name: string;
color: string;
emoji: string;
icon: FolderIconName;
emoji?: string;
}
const FOLDER_COLORS = [
@@ -20,73 +47,70 @@ const FOLDER_COLORS = [
"#f97316",
];
const folderHeroicon = (inner: string) =>
`<svg style="width:16px;height:16px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${inner}</svg>`;
const FOLDER_ICONS = {
folder: Folder,
inbox: Inbox,
star: Star,
heart: Heart,
flame: Flame,
lightbulb: Lightbulb,
"file-text": FileText,
target: Target,
calendar: Calendar,
"notepad-text": NotepadText,
users: Users,
"message-square": MessageSquare,
briefcase: Briefcase,
house: House,
book: Book,
music: Music,
};
const FOLDER_HEROICONS = [
folderHeroicon(
'<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>',
),
folderHeroicon(
'<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>',
),
folderHeroicon(
'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/>',
),
folderHeroicon(
'<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>',
),
folderHeroicon(
'<path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"/>',
),
folderHeroicon(
'<path d="M9 18h6"/><path d="M10 22h4"/><path d="M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14"/>',
),
folderHeroicon(
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/>',
),
folderHeroicon(
'<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/>',
),
folderHeroicon(
'<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/>',
),
folderHeroicon(
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/>',
),
folderHeroicon(
'<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
),
folderHeroicon('<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>'),
folderHeroicon(
'<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>',
),
folderHeroicon(
'<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/>',
),
folderHeroicon(
'<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>',
),
folderHeroicon(
'<path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/>',
),
type FolderIconName = keyof typeof FOLDER_ICONS;
const FOLDER_ICON_NAMES = Object.keys(FOLDER_ICONS) as FolderIconName[];
const LEGACY_FOLDER_ICON_MARKERS: [string, FolderIconName][] = [
["10 9 9 9 8 9", "file-text"],
["M22 19a2", "folder"],
["22 12 16 12", "inbox"],
["12 2 15.09", "star"],
["M20.84 4.61", "heart"],
["M8.5 14.5", "flame"],
["M9 18h6", "lightbulb"],
["M14 2H6", "notepad-text"],
['r="10"', "target"],
['y="4" width="18"', "calendar"],
["M17 21v-2", "users"],
["M21 15a2", "message-square"],
['y="7" width="20"', "briefcase"],
["M3 9l9-7", "house"],
["M4 19.5A2.5", "book"],
["M9 18V5", "music"],
];
const FOLDER_ICON_SVG = `<svg style="width:24px;height:24px;flex-shrink:0" viewBox="0 0 24 24"><path fill="currentColor" d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/></svg>`;
const PLUS_SVG = `<svg style="width:14px;height:14px;flex-shrink:0" viewBox="0 0 24 24"><path fill="#888" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>`;
const CHECK_SVG_WHITE = `<svg style="width:14px;height:14px;flex-shrink:0" viewBox="0 0 24 24"><path fill="#fff" d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>`;
const CLOSE_SVG = `<svg style="width:14px;height:14px;flex-shrink:0" viewBox="0 0 24 24"><path fill="#888" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>`;
const EDIT_SVG = `<svg style="width:12px;height:12px;flex-shrink:0" viewBox="0 0 24 24"><path fill="#888" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>`;
const TRASH_SVG = `<svg style="width:12px;height:12px;flex-shrink:0" viewBox="0 0 24 24"><path fill="#888" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>`;
const CHEVRON_SVG = `<svg style="width:12px;height:12px;flex-shrink:0;transition:transform .2s" viewBox="0 0 24 24"><path fill="#888" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>`;
const DRAG_SVG = `<svg style="width:14px;height:14px;flex-shrink:0;cursor:grab" viewBox="0 0 24 24"><path fill="#888" d="M6.5 12.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"/></svg>`;
const folderIconSvg = (name: FolderIconName) => icon(FOLDER_ICONS[name], { size: 16 });
const FOLDER_ICON_SVG = icon(Folder);
const PLUS_SVG = icon(Plus, { size: 14, style: "color: #888" });
const CHECK_SVG_WHITE = icon(Check, { size: 14, style: "color: #fff" });
const CLOSE_SVG = icon(X, { size: 14, style: "color: #888" });
const EDIT_SVG = icon(Pencil, { size: 12, style: "color: #888" });
const TRASH_SVG = icon(Trash, { size: 12, style: "color: #888" });
const CHEVRON_SVG = icon(ChevronDown, {
size: 12,
style: "color: #888; transition: transform 0.2s",
});
const DRAG_SVG = icon(GripHorizontal, { size: 14, style: "color: #888; cursor: grab" });
function isAllowedFolderColor(color: unknown): color is string {
return typeof color === "string" && FOLDER_COLORS.includes(color);
}
function isAllowedFolderIcon(icon: unknown): icon is string {
return typeof icon === "string" && FOLDER_HEROICONS.includes(icon);
function folderIconName(value: unknown): FolderIconName {
if (typeof value !== "string") return "folder";
if (Object.hasOwn(FOLDER_ICONS, value)) return value as FolderIconName;
return LEGACY_FOLDER_ICON_MARKERS.find(([marker]) => value.includes(marker))?.[1] ?? "folder";
}
function normalizeFolder(folder: Folder): Folder {
@@ -94,26 +118,22 @@ function normalizeFolder(folder: Folder): Folder {
id: typeof folder.id === "string" && folder.id ? folder.id : crypto.randomUUID(),
name: typeof folder.name === "string" ? folder.name.trim().slice(0, 30) : "Folder",
color: isAllowedFolderColor(folder.color) ? folder.color : FOLDER_COLORS[0],
emoji: isAllowedFolderIcon(folder.emoji) ? folder.emoji : FOLDER_HEROICONS[0],
icon: folderIconName(folder.icon ?? folder.emoji),
};
}
function setSvgIconContent(parent: HTMLElement, svgMarkup: string): void {
parent.replaceChildren();
const template = document.createElement("template");
template.innerHTML = svgMarkup.trim();
const node = template.content.firstElementChild;
if (node) parent.appendChild(node);
function setFolderIcon(parent: HTMLElement, name: FolderIconName): void {
parent.innerHTML = folderIconSvg(name);
}
function appendFolderBadgeContent(badge: HTMLElement, folder: Folder): void {
badge.replaceChildren();
if (folder.emoji) {
if (folder.icon) {
const iconWrap = document.createElement("span");
iconWrap.style.display = "inline-flex";
iconWrap.style.verticalAlign = "middle";
iconWrap.style.marginRight = "2px";
setSvgIconContent(iconWrap, folder.emoji);
setFolderIcon(iconWrap, folder.icon);
badge.appendChild(iconWrap);
}
badge.appendChild(document.createTextNode(folder.name));
@@ -335,7 +355,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
const allItem = document.createElement("div");
allItem.className = `bsplus-folder-item bsplus-all-msgs${activeFolderId === null ? " bsplus-folder-active" : ""}`;
allItem.innerHTML = `
<svg width="14" height="14" viewBox="0 0 24 24" style="fill: currentcolor; opacity: 0.5; flex-shrink: 0;"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>
${icon(Inbox, { size: 14, style: "opacity: 0.5" })}
<span class="bsplus-folder-name">All Messages</span>
`;
allItem.addEventListener("click", () => {
@@ -368,7 +388,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
const iconSpan = document.createElement("span");
iconSpan.className = "bsplus-folder-icon";
setSvgIconContent(iconSpan, folder.emoji || FOLDER_HEROICONS[0]);
setFolderIcon(iconSpan, folder.icon);
item.appendChild(iconSpan);
const name = document.createElement("span");
@@ -525,7 +545,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
let selectedColor =
editFolder?.color ?? FOLDER_COLORS[Math.floor(Math.random() * FOLDER_COLORS.length)];
let selectedIcon =
editFolder?.emoji ?? FOLDER_HEROICONS[Math.floor(Math.random() * FOLDER_HEROICONS.length)];
editFolder?.icon ?? FOLDER_ICON_NAMES[Math.floor(Math.random() * FOLDER_ICON_NAMES.length)];
const row = document.createElement("div");
row.className = "bsplus-folder-input";
@@ -539,7 +559,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
const iconBtn = document.createElement("button");
iconBtn.className = "bsplus-folder-icon-btn";
iconBtn.title = "Pick icon";
iconBtn.innerHTML = selectedIcon;
iconBtn.innerHTML = folderIconSvg(selectedIcon);
iconBtn.addEventListener("click", (e) => {
e.stopPropagation();
const picker = container.querySelector(".bsplus-icon-picker") as HTMLElement | null;
@@ -547,9 +567,9 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
picker.remove();
return;
}
showIconPicker(container, (iconSvg) => {
selectedIcon = iconSvg;
iconBtn.innerHTML = iconSvg;
showIconPicker(container, (name) => {
selectedIcon = name;
iconBtn.innerHTML = folderIconSvg(name);
});
});
@@ -592,7 +612,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
if (!name) return;
if (editFolder) {
const folders = getFolders().map((f) =>
f.id === editFolder.id ? { ...f, name, color: selectedColor, emoji: selectedIcon } : f,
f.id === editFolder.id ? { ...f, name, color: selectedColor, icon: selectedIcon } : f,
);
saveFolders(folders);
} else {
@@ -600,7 +620,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
id: crypto.randomUUID(),
name,
color: selectedColor,
emoji: selectedIcon,
icon: selectedIcon,
};
saveFolders([...getFolders(), folder]);
}
@@ -626,19 +646,20 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
requestAnimationFrame(() => input.focus());
};
const showIconPicker = (container: Element, onSelect: (iconSvg: string) => void) => {
const showIconPicker = (container: Element, onSelect: (name: FolderIconName) => void) => {
const existing = container.querySelector(".bsplus-icon-picker");
if (existing) existing.remove();
const picker = document.createElement("div");
picker.className = "bsplus-icon-picker";
for (const icon of FOLDER_HEROICONS) {
for (const name of FOLDER_ICON_NAMES) {
const btn = document.createElement("button");
btn.className = "bsplus-icon-opt";
btn.innerHTML = icon;
btn.setAttribute("aria-label", name);
btn.innerHTML = folderIconSvg(name);
btn.addEventListener("click", (e) => {
e.stopPropagation();
onSelect(icon);
onSelect(name);
picker.remove();
});
picker.appendChild(btn);
@@ -710,7 +731,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
const iconSpan = document.createElement("span");
iconSpan.className = "bsplus-folder-icon";
setSvgIconContent(iconSpan, folder.emoji || FOLDER_HEROICONS[0]);
setFolderIcon(iconSpan, folder.icon);
const name = document.createElement("span");
name.textContent = folder.name;
@@ -815,7 +836,7 @@ const messageFoldersPlugin: Pick<Plugin<MessageFoldersSettings, MessageFoldersSt
dot.style.background = folder.color;
const iconSpan = document.createElement("span");
iconSpan.className = "bsplus-folder-icon";
setSvgIconContent(iconSpan, folder.emoji || FOLDER_HEROICONS[0]);
setFolderIcon(iconSpan, folder.icon);
const name = document.createElement("span");
name.textContent = folder.name;
item.appendChild(dot);
@@ -233,9 +233,9 @@
box-shadow 0.2s ease;
}
.bsplus-folder-input input:focus {
border-color: var(--better-main, #007bff);
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
.bsplus-folder-input input:focus-visible {
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
}
.bsplus-folder-icon-btn {
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { Check } from "lucide-static";
import type { PluginAPI, PluginSettings } from "../../core/types";
import ReactFiber from "@/seqta/utils/ReactFiber";
import { delay } from "@/seqta/utils/delay";
@@ -79,7 +81,7 @@ export function applyBackupBadges(archive: ArchiveMap) {
const badge = document.createElement("span");
badge.className = BACKUP_BADGE_CLASS;
badge.title = "Saved locally";
badge.textContent = "✓";
badge.innerHTML = icon(Check, { size: "1em" });
itemEl.appendChild(badge);
}
} else {
@@ -1,4 +1,6 @@
<script lang="ts">
import RotateCwIcon from "@lucide/svelte/icons/rotate-cw";
import UploadIcon from "@lucide/svelte/icons/upload";
import localforage from 'localforage'
import { onMount } from 'svelte'
import browser from '@/lib/browser'
@@ -127,7 +129,7 @@
aria-label="Refresh from cloud"
onclick={() => runCloud(pullCloudProfilePictureFromServer)}
>
<span class="text-lg font-IconFamily dark:text-white">{'\uec79'}</span>
<RotateCwIcon size="1em" class="text-lg dark:text-white" />
</button>
<div class="w-px h-8 shrink-0 bg-zinc-300 dark:bg-zinc-600" aria-hidden="true"></div>
{/if}
@@ -161,7 +163,7 @@
</div>
{:else}
<div class="flex gap-2 items-center px-3 py-1 text-xs rounded-lg border border-dashed transition border-zinc-300 dark:border-zinc-600 text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300 text-nowrap">
<span class="text-lg font-IconFamily">{'\ued47'}</span>
<UploadIcon size="1em" class="text-lg" />
<span>Upload</span>
</div>
{/if}
@@ -1,4 +1,5 @@
<script lang="ts">
import CalendarIcon from "@lucide/svelte/icons/calendar";
import { onMount } from "svelte";
import type { Snippet } from "svelte";
import { fade, fly } from "svelte/transition";
@@ -584,7 +585,7 @@
>
<span class="bsplus-cal-trigger-fill" aria-hidden="true"></span>
<span class="bsplus-cal-trigger-content">
<span class="bsplus-cal-trigger-icon iconFamily" aria-hidden="true">&#xe9cd;</span>
<CalendarIcon size="1em" class="bsplus-cal-trigger-icon" />
<span class="bsplus-cal-trigger-text">{triggerStatusText}</span>
</span>
</button>
@@ -826,7 +827,7 @@
/>
<path
d="M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251"
fill="#EB4335"
fill="#EA4335"
/>
</svg>
{/snippet}
@@ -895,8 +896,7 @@
gap: 6px;
}
.bsplus-cal-trigger-icon {
font-family: "IconFamily" !important;
.bsplus-cal-trigger-content :global(.bsplus-cal-trigger-icon) {
font-size: 16px;
line-height: 1;
opacity: 0.9;
+11 -6
View File
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { Eye, ZoomIn, ZoomOut } from "lucide-static";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
import type { Plugin } from "../../core/types";
import { attachTimetableColorisRecovery } from "@/seqta/utils/patchSeqtaMenuUpdateColours";
@@ -99,13 +101,15 @@ function handleTimetableZoom(): void {
const zoomIn = document.createElement("button");
zoomIn.type = "button";
zoomIn.className = "timetable-zoom iconFamily bsplus-timetable-control";
zoomIn.innerHTML = "&#xed93;"; // Unicode for zoom in icon (custom iconfamily)
zoomIn.className = "timetable-zoom bsplus-timetable-control";
zoomIn.setAttribute("aria-label", "Zoom in");
zoomIn.innerHTML = icon(ZoomIn, { size: 16 });
const zoomOut = document.createElement("button");
zoomOut.type = "button";
zoomOut.className = "timetable-zoom iconFamily bsplus-timetable-control";
zoomOut.innerHTML = "&#xed94;"; // Unicode for zoom out icon (custom iconfamily)
zoomOut.className = "timetable-zoom bsplus-timetable-control";
zoomOut.setAttribute("aria-label", "Zoom out");
zoomOut.innerHTML = icon(ZoomOut, { size: 16 });
zoomControls.appendChild(zoomOut);
zoomControls.appendChild(zoomIn);
@@ -144,8 +148,9 @@ function handleTimetableAssessmentHide(): void {
const hideOn = document.createElement("button");
hideOn.type = "button";
hideOn.className = "timetable-hide iconFamily bsplus-timetable-control";
hideOn.innerHTML = "&#xeab3;";
hideOn.className = "timetable-hide bsplus-timetable-control";
hideOn.setAttribute("aria-label", "Highlight assessments");
hideOn.innerHTML = icon(Eye, { size: 16 });
hideControls.appendChild(hideOn);
@@ -1,4 +1,5 @@
<script lang="ts">
import UsersIcon from "@lucide/svelte/icons/users";
import { onMount } from "svelte";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
import { syncCalendarSyncTheme } from "@/plugins/built-in/timetable/calendarSyncUi";
@@ -71,7 +72,7 @@
onclick={() => void handleClick()}
>
<span class="bsplus-cal-trigger-content">
<span class="bsplus-cal-trigger-icon iconFamily" aria-hidden="true">&#xed66;</span>
<UsersIcon size="1em" class="bsplus-cal-trigger-icon" />
<span class="bsplus-cal-trigger-text">
{busy ? "Syncing…" : error ? "Sync failed" : "Sync with Friends"}
</span>
@@ -1,4 +1,5 @@
<script lang="ts">
import CircleCheckIcon from "@lucide/svelte/icons/circle-check";
import { onMount } from "svelte";
import CloudPfpAvatar from "@/interface/components/CloudPfpAvatar.svelte";
import { cloudAuth, type CloudUser } from "@/seqta/utils/CloudAuth";
@@ -104,7 +105,7 @@
<span class="bsplus-tc-cloud-user-sub">{cloudSubtitle(cloudUser)}</span>
{/if}
</div>
<span class="bsplus-tc-cloud-check iconFamily" aria-hidden="true">&#xe9db;</span>
<CircleCheckIcon size="1em" class="bsplus-tc-cloud-check" />
</div>
{:else}
<p class="bsplus-tc-cloud-lead">
@@ -48,7 +48,6 @@
}
.bsplus-friends-sync .bsplus-cal-trigger-icon {
font-family: "IconFamily" !important;
font-size: 16px;
line-height: 1;
opacity: 0.9;
+3 -2
View File
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { Pencil } from "lucide-static";
import type { PluginAPI } from "../../core/types";
import { waitForElm } from "@/seqta/utils/waitForElm";
@@ -26,8 +28,7 @@ function getRoomAndTeacherElements(entry: HTMLElement): {
return { roomEl, teacherEl };
}
const EDIT_ICON_SVG =
'<svg width="20" height="20" viewBox="0 0 24 24"><g style="fill: currentcolor;"><path d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"/></g></svg>';
const EDIT_ICON_SVG = icon(Pencil, { size: 20 });
function showEditModal(
item: TimetableEntryData,
@@ -90,10 +90,9 @@
-webkit-user-select: text;
}
.timetable-edit-modal input[type="text"]:focus {
outline: none;
border-color: var(--better-main, #007bff);
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
.timetable-edit-modal input[type="text"]:focus-visible {
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px;
}
.timetable-edit-modal-checkbox {
-18
View File
@@ -41,7 +41,6 @@ import { attachTimetableColorisRecovery } from "@/seqta/utils/patchSeqtaMenuUpda
import { observeMenuItemPosition } from "@/seqta/utils/sidebarMenuIcons";
import IconFamily from "@/resources/fonts/IconFamily.woff";
import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
import iframeCSS from "@/css/iframe.scss?raw";
@@ -773,7 +772,6 @@ export function init() {
if (!onLogin) {
loading();
}
InjectCustomIcons();
applyMenuItemVisibility();
syncTimetableUrlMonitoring();
tryLoad();
@@ -856,26 +854,10 @@ export function init() {
}, 1000);
} else {
handleDisabled();
InjectCustomIcons();
window.addEventListener("load", handleDisabled, { once: true });
}
}
function InjectCustomIcons() {
verboseInfo("[BetterSEQTA+] Injecting Icons");
const style = document.createElement("style");
style.setAttribute("type", "text/css");
style.innerHTML = `
@font-face {
font-family: 'IconFamily';
src: url('${resolveExtensionAssetUrl(IconFamily)}') format('woff');
font-weight: normal;
font-style: normal;
}`;
document.head.appendChild(style);
}
export function AppendElementsToDisabledPage() {
if (document.getElementById("AddedSettings")) return;
Binary file not shown.
-5
View File
@@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<circle cx="256" cy="256" r="256" fill="#151415"/>
<circle cx="248" cy="250" r="117.75" fill="none" stroke="#fff" stroke-width="38.5"/>
<rect x="248" y="348.5" width="165" height="38.5" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 276 B

-13
View File
@@ -1,13 +0,0 @@
{
"welcome": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M7.03 4.95L3.5 8.5C.17 11.81 .17 17.19 3.5 20.5S12.19 23.83 15.5 20.5L21.5 14.5C22.5 13.53 22.5 11.94 21.5 10.96C21.4 10.84 21.27 10.73 21.13 10.64L21.5 10.25C22.5 9.28 22.5 7.69 21.5 6.71C21.36 6.55 21.17 6.41 21 6.3C21.38 5.38 21.21 4.28 20.46 3.53C19.59 2.66 18.24 2.57 17.26 3.25C17.16 3.1 17.05 2.96 16.92 2.83C15.95 1.86 14.36 1.86 13.38 2.83L10.87 5.34C10.78 5.2 10.67 5.07 10.55 4.95C9.58 4 8 4 7.03 4.95M8.44 6.37C8.64 6.17 8.95 6.17 9.15 6.37S9.35 6.88 9.15 7.08L5.97 10.26C7.14 11.43 7.14 13.33 5.97 14.5L7.38 15.91C8.83 14.46 9.2 12.34 8.5 10.55L14.8 4.25C15 4.05 15.31 4.05 15.5 4.25S15.71 4.76 15.5 4.96L10.91 9.56L12.32 10.97L18.33 4.96C18.53 4.76 18.84 4.76 19.04 4.96C19.24 5.16 19.24 5.47 19.04 5.67L13.03 11.68L14.44 13.09L19.39 8.14C19.59 7.94 19.9 7.94 20.1 8.14C20.3 8.34 20.3 8.65 20.1 8.85L14.44 14.5L15.85 15.92L19.39 12.38C19.59 12.18 19.9 12.18 20.1 12.38C20.3 12.58 20.3 12.89 20.1 13.09L14.1 19.1C11.56 21.64 7.45 21.64 4.91 19.1S2.37 12.45 4.91 9.91L8.44 6.37M23 17C23 20.31 20.31 23 17 23V21.5C19.5 21.5 21.5 19.5 21.5 17H23M1 7C1 3.69 3.69 1 7 1V2.5C4.5 2.5 2.5 4.5 2.5 7H1Z\" />\n </svg>",
"assessments": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M6 20H13V22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V12.54L18.5 11.72L18 12V4H13V12L10.5 9.75L8 12V4H6V20M24 17L18.5 14L13 17L18.5 20L24 17M15 19.09V21.09L18.5 23L22 21.09V19.09L18.5 21L15 19.09Z\" />\n</svg>",
"courses": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z\" />\n</svg>",
"dashboard": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M13,3V9H21V3M13,21H21V11H13M3,21H11V15H3M3,13H11V3H3V13Z\" />\n</svg>",
"messages": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M20,2H4A2,2 0 0,0 2,4V22L6,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M8,14H6V12H8V14M8,11H6V9H8V11M8,8H6V6H8V8M15,14H10V12H15V14M18,11H10V9H18V11M18,8H10V6H18V8Z\" />\n</svg>",
"notices": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M12,15H10V13H12V15M18,15H14V13H18V15M8,11H6V9H8V11M18,11H10V9H18V11M20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20M4,6V18H20V6H4Z\" />\n</svg>",
"portals": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M15,4A8,8 0 0,1 23,12A8,8 0 0,1 15,20A8,8 0 0,1 7,12A8,8 0 0,1 15,4M15,18A6,6 0 0,0 21,12A6,6 0 0,0 15,6A6,6 0 0,0 9,12A6,6 0 0,0 15,18M3,12C3,14.61 4.67,16.83 7,17.65V19.74C3.55,18.85 1,15.73 1,12C1,8.27 3.55,5.15 7,4.26V6.35C4.67,7.17 3,9.39 3,12Z\" />\n</svg>",
"reports": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M18 2H12V9L9.5 7.5L7 9V2H6A2 2 0 0 0 4 4V20A2 2 0 0 0 6 22H18A2 2 0 0 0 20 20V4A2 2 0 0 0 18 2M14 12A2 2 0 1 1 12 14A2 2 0 0 1 14 12M18 20H10V19C10 17.67 12.67 17 14 17S18 17.67 18 19Z\" />\n</svg>",
"settings": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z\" />\n</svg>",
"timetable": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M9,10V12H7V10H9M13,10V12H11V10H13M17,10V12H15V10H17M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H6V1H8V3H16V1H18V3H19M19,19V8H5V19H19M9,14V16H7V14H9M13,14V16H11V14H13M17,14V16H15V14H17Z\" />\n</svg>",
"analytics": "<svg style=\"width:24px;height:24px\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n <path fill=\"currentColor\" d=\"M4,2H2V28a2,2,0,0,0,2,2H30V28H4Z\" />\n <path fill=\"currentColor\" d=\"M30,9H23v2h3.59L19,18.59l-4.29-4.3a1,1,0,0,0-1.42,0L6,21.59,7.41,23,14,16.41l4.29,4.3a1,1,0,0,0,1.42,0L28,12.41V16h2Z\" />\n</svg>"
}
-5
View File
@@ -1,5 +0,0 @@
export default /* html */ `
<svg style="width:24px;height:24px;border-radius:0;" viewBox="0 0 24 24">
<path fill="currentColor" d="M6 20H13V22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V12.54L18.5 11.72L18 12V4H13V12L10.5 9.75L8 12V4H6V20M24 17L18.5 14L13 17L18.5 20L24 17M15 19.09V21.09L18.5 23L22 21.09V19.09L18.5 21L15 19.09Z"></path>
</svg>
`;
-5
View File
@@ -1,5 +0,0 @@
export default /* html */ `
<svg style="width:24px;height:24px;border-radius:0;" viewBox="0 0 24 24">
<path fill="currentColor" d="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z"></path>
</svg>
`;
+32 -23
View File
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { LogOut, Moon, Sun, Wrench } from "lucide-static";
import { waitForEngageMenuList } from "@/seqta/utils/waitForEngageMenuList";
import { addExtensionSettings } from "@/seqta/utils/adders/AddExtensionSettings";
import { isSeqtaEngageExperience } from "@/seqta/utils/isSeqtaEngage";
@@ -10,6 +12,8 @@ import { waitForElm } from "@/seqta/utils/waitForElm";
import { GetThresholdOfColor } from "@/seqta/ui/colors/getThresholdColour";
import { appendBackgroundToUI } from "./ImageBackgrounds";
import { attachTooltip } from "@/seqta/utils/tooltip";
import { pageIcon } from "@/seqta/utils/pageIcons";
import { applyDefaultBackgroundOnce } from "./defaultBackground";
import stringToHTML from "@/seqta/utils/stringToHTML";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
@@ -19,8 +23,6 @@ import {
openThemeToggleSurprise,
THEME_TOGGLE_SURPRISE_TRIGGER_AT,
} from "@/seqta/utils/openers/openThemeToggleSurprise";
import { LUCIDE_MOON_ICON_SVG } from "@/lib/icons/lucideMoon";
import { LUCIDE_SUN_ICON_SVG } from "@/lib/icons/lucideSun";
import {
ensureTitlebarFounderBadgeMounted,
refreshTitlebarFounderBadge,
@@ -36,6 +38,8 @@ import {
} from "@/seqta/ui/sidebar/sidebarDrillReturn";
import { getUserInfo } from "@/seqta/utils/userInfo";
const USER_AVATAR_SVG = `<svg class="userInfosvg" viewBox="0 0 24 24"><path fill="var(--text-primary)" d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"></path></svg>`;
let lightDarkToggleStreak = 0;
let sidebarAccessibilityObserver: MutationObserver | null = null;
let sidebarTabOrderAnimationFrame: number | null = null;
@@ -115,7 +119,7 @@ function createHomeButton(fragment: DocumentFragment) {
fragment.appendChild(
stringToHTML(
/* html */ `<li class="item" data-key="home" id="homebutton" data-path="/home" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z" /></svg><span>Home</span></label></li>`,
/* html */ `<li class="item" data-key="home" id="homebutton" data-path="/home" data-betterseqta="true"><label>${pageIcon("home")}<span>Home</span></label></li>`,
).firstChild!,
);
}
@@ -151,9 +155,13 @@ function updateUserInfo(info: Awaited<ReturnType<typeof getUserInfo>>) {
titlebar.append(
stringToHTML(/* html */ `
<div class="userInfosvgdiv tooltip">
<svg class="userInfosvg" viewBox="0 0 24 24"><path fill="var(--text-primary)" d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"></path></svg>
<div class="tooltiptext topmenutooltip" id="logouttooltip"></div>
<div class="userInfosvgdiv bsplus-tooltip" tabindex="0" aria-label="Account">
${USER_AVATAR_SVG}
<div class="bsplus-tooltip-bubble">
<button class="bsplus-logout" type="button" aria-label="Log out">
${icon(LogOut, { size: 20 })}
</button>
</div>
</div>
`).firstChild!,
);
@@ -177,9 +185,12 @@ function updateUserInfo(info: Awaited<ReturnType<typeof getUserInfo>>) {
`).firstChild!,
);
document
.getElementById("logouttooltip")!
.appendChild(document.getElementsByClassName("logout")[0]);
const seqtaLogout = document.querySelector<HTMLElement>(".logout");
if (seqtaLogout) seqtaLogout.style.display = "none";
attachTooltip(titlebar.querySelector<HTMLElement>(".bsplus-tooltip")!);
titlebar.querySelector<HTMLElement>(".bsplus-logout")?.addEventListener("click", () => {
document.querySelector<HTMLElement>(".logout")?.click();
});
}
async function updateStudentInfo(
@@ -225,7 +236,7 @@ async function updateStudentInfo(
function createNewsButton(fragment: DocumentFragment, menu: HTMLElement) {
fragment.appendChild(
stringToHTML(
'<li class="item" data-key="news" id="newsbutton" data-path="/news" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M5 7H10V13H5V7M19 17H5V15H19V17M19 13H12V11H19V13M19 9H12V7H19V9Z" /></svg><span>News</span></label></li>',
`<li class="item" data-key="news" id="newsbutton" data-path="/news" data-betterseqta="true"><label>${pageIcon("news")}<span>News</span></label></li>`,
).firstChild!,
);
@@ -274,9 +285,7 @@ async function createSettingsButton(parent?: Element) {
target.append(
stringToHTML(/* html */ `
<button class="addedButton" id="AddedSettings" type="button" aria-label="BetterSEQTA+ settings">
<svg width="24" height="24" viewBox="0 0 24 24">
<g><g><path d="M23.182,6.923c-.29,0-3.662,2.122-4.142,2.4l-2.8-1.555V4.511l4.257-2.456a.518.518,0,0,0,.233-.408.479.479,0,0,0-.233-.407,6.511,6.511,0,1,0-3.327,12.107,6.582,6.582,0,0,0,6.148-4.374,5.228,5.228,0,0,0,.333-1.542A.461.461,0,0,0,23.182,6.923Z"></path><path d="M9.73,10.418,7.376,12.883c-.01.01-.021.016-.03.025L1.158,19.1a2.682,2.682,0,1,0,3.793,3.793l4.583-4.582,0,0,4.1-4.005-.037-.037A9.094,9.094,0,0,1,9.73,10.418ZM3.053,21.888A.894.894,0,1,1,3.946,21,.893.893,0,0,1,3.053,21.888Z"></path></g></g>
</svg>
${icon(Wrench)}
</button>
`).firstChild!,
);
@@ -289,7 +298,7 @@ async function injectEngageHomeButton() {
if (!menuList || document.getElementById("homebutton")) return;
const li = stringToHTML(
/* html */ `<li class="item" data-key="home" id="homebutton" data-path="/home" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z" /></svg><span>Home</span></label></li>`,
/* html */ `<li class="item" data-key="home" id="homebutton" data-path="/home" data-betterseqta="true"><label>${pageIcon("home")}<span>Home</span></label></li>`,
).firstChild as HTMLElement;
menuList.insertBefore(li, menuList.firstElementChild);
@@ -358,11 +367,11 @@ async function addEngageUserInfo() {
ensureTitlebarFounderBadgeMounted();
const iconNode = stringToHTML(/* html */ `
<div class="userInfosvgdiv tooltip" id="engage-logouttooltip-wrap">
<svg class="userInfosvg" viewBox="0 0 24 24"><path fill="var(--text-primary)" d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"></path></svg>
<div class="tooltiptext topmenutooltip" id="engage-logouttooltip">
<button class="logout engage-logout">
<svg style="width:20px;height:20px;vertical-align:middle;" viewBox="0 0 24 24"><path fill="currentColor" d="M17 7L15.59 8.41L18.17 11H8V13H18.17L15.59 15.58L17 17L22 12M4 5H12V3H4C2.9 3 2 3.9 2 5V19C2 20.1 2.9 21 4 21H12V19H4V5Z"/></svg>
<div class="userInfosvgdiv bsplus-tooltip" id="engage-logouttooltip-wrap" tabindex="0" aria-label="Account">
${USER_AVATAR_SVG}
<div class="bsplus-tooltip-bubble">
<button class="bsplus-logout" type="button" aria-label="Log out">
${icon(LogOut, { size: 20 })}
</button>
</div>
</div>
@@ -370,8 +379,9 @@ async function addEngageUserInfo() {
titlebar.append(iconNode);
content.appendChild(titlebar);
attachTooltip(iconNode as HTMLElement);
titlebar.querySelector<HTMLElement>(".engage-logout")?.addEventListener("click", async () => {
titlebar.querySelector<HTMLElement>(".bsplus-logout")?.addEventListener("click", async () => {
await fetch(`${location.origin}/seqta/parent/logout`, { method: "POST" });
location.reload();
});
@@ -448,7 +458,7 @@ async function addDarkLightToggle(parent?: Element) {
toggleTarget.append(
stringToHTML(/* html */ `
<button class="addedButton DarkLightButton" id="LightDarkModeButton" type="button" aria-label="${GetLightDarkModeString()}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">${settingsState.DarkMode ? LUCIDE_SUN_ICON_SVG : LUCIDE_MOON_ICON_SVG}</svg>
${icon(settingsState.DarkMode ? Sun : Moon)}
</button>
`).firstChild!,
);
@@ -475,8 +485,7 @@ async function addDarkLightToggle(parent?: Element) {
settingsState.DarkMode = !settingsState.DarkMode;
updateAllColors();
const svgElement = lightDarkModeButtonElement.querySelector("svg")!;
svgElement.innerHTML = settingsState.DarkMode ? LUCIDE_SUN_ICON_SVG : LUCIDE_MOON_ICON_SVG;
lightDarkModeButtonElement.innerHTML = icon(settingsState.DarkMode ? Sun : Moon);
lightDarkModeButtonElement.setAttribute("aria-label", GetLightDarkModeString());
});
}
+1 -1
View File
@@ -76,7 +76,7 @@ const contentConfig: ContentConfig = {
},
},
assessmentTitleInTooltip: {
selector: ".assessmenttooltip .tooltiptext p",
selector: ".assessmenttooltip .bsplus-tooltip-bubble a",
action: (element) => {
element.textContent = getRandomElement(mockData.assessmentTitles);
},
+2 -11
View File
@@ -86,11 +86,11 @@ const SEQTA_FONT_SCOPE = `
.legacy-root,
.legacy-root input,
.legacy-root textarea,
.legacy-root button:not(.iconFamily),
.legacy-root button,
.legacy-root select,
.legacy-root option,
.legacy-root .input,
.legacy-root *:not(.iconFamily),
.legacy-root *,
#container,
#container *
`;
@@ -102,15 +102,6 @@ function buildFontOverrideCss(family: string): string {
${SEQTA_FONT_SCOPE} {
${rule}
}
.iconFamily,
.iconFamily *,
button.timetable-zoom.iconFamily,
button.bsplus-timetable-control.iconFamily,
[class~="iconFamily"],
[class~="iconFamily"] * {
font-family: "IconFamily" !important;
}
`;
}
+2 -14
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import SearchIcon from "@lucide/svelte/icons/search";
import { titleBarState } from "./titleBarState.svelte";
</script>
@@ -9,20 +10,7 @@
<div class="search-trigger-anchor">
<div class="search-trigger">
<span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<SearchIcon size={16} />
</span>
<p>Quick search...</p>
<span
-59
View File
@@ -1,59 +0,0 @@
export function setupFixedTooltips(root: Document | HTMLElement = document) {
const elements = root.querySelectorAll<HTMLElement>(".fixed-tooltip");
elements.forEach((tooltip) => {
const text = tooltip.querySelector<HTMLElement>(".tooltiptext");
if (!text) return;
tooltip.removeChild(text);
text.classList.add("tooltiptext-fixed");
let hideTimeout: number | undefined;
const show = () => {
if (hideTimeout) {
clearTimeout(hideTimeout);
hideTimeout = undefined;
}
document.body.appendChild(text);
const rect = tooltip.getBoundingClientRect();
text.style.left = `${rect.left + rect.width / 2}px`;
text.style.top = `${rect.bottom + 5}px`;
requestAnimationFrame(() => text.classList.add("show"));
};
const scheduleHide = () => {
hideTimeout = window.setTimeout(() => {
text.classList.remove("show");
setTimeout(() => {
if (text.parentElement === document.body) {
document.body.removeChild(text);
}
}, 200);
}, 300);
};
tooltip.addEventListener("mouseenter", show);
tooltip.addEventListener("mouseleave", scheduleHide);
tooltip.addEventListener("blur", scheduleHide);
tooltip.addEventListener("click", scheduleHide);
text.addEventListener("mouseenter", () => {
if (hideTimeout) {
clearTimeout(hideTimeout);
hideTimeout = undefined;
}
});
text.addEventListener("mouseleave", scheduleHide);
text.addEventListener("click", () => {
if (hideTimeout) {
clearTimeout(hideTimeout);
hideTimeout = undefined;
}
text.classList.remove("show");
setTimeout(() => {
if (text.parentElement === document.body) {
document.body.removeChild(text);
}
}, 200);
});
});
}
+10 -12
View File
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { Flame, Sparkles, Star, SwatchBook, Trophy } from "lucide-static";
/** Keep in sync with betterseqta-accounts `utils/badges.ts` / `utils/badgeVisuals.ts`. */
export const BADGE_TIERS = [
@@ -163,20 +165,16 @@ export function badgeVisualForKey(key: string, labelFallback = key): BadgeVisual
return { key, label: labelFallback, ...UNKNOWN_ACHIEVEMENT_VISUAL };
}
const ICON_PATHS: Record<string, string> = {
sparkles:
"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z",
star: "M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005z",
trophy:
"M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 01-.982-3.172M9.497 14.25a7.454 7.454 0 00.981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 007.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 002.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 012.916.52 6.003 6.003 0 01-5.395 4.972m0 0a6.726 6.726 0 01-2.749 1.35m0 0a6.726 6.726 0 01-3.128 0m3.128 0a6.726 6.726 0 01-3.128 0",
fire: "M15.362 5.214A8.252 8.252 0 0112 21 8.25 8.25 0 016.038 7.048 8.287 8.287 0 009 9.6a8.983 8.983 0 013.361-6.867 8.21 8.21 0 003 2.48zM12 18a3.75 3.75 0 00.495-7.467 5.99 5.99 0 00-1.925 3.546 5.974 5.974 0 01-2.133-1A3.75 3.75 0 0012 18z",
swatch:
"M4.098 19.902a3.75 3.75 0 005.304 0l6.401-6.402M6.75 21A3.75 3.75 0 013 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 003.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008z",
const BADGE_ICONS: Record<string, string> = {
sparkles: Sparkles,
star: Star,
trophy: Trophy,
fire: Flame,
swatch: SwatchBook,
};
function badgeIconSvg(icon: string, size = 15): string {
const path = ICON_PATHS[icon] ?? ICON_PATHS.sparkles;
return `<svg class="bsplus-founder-badge__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="${size}" height="${size}" aria-hidden="true"><path d="${path}"/></svg>`;
function badgeIconSvg(name: string, size = 15): string {
return icon(BADGE_ICONS[name] ?? Sparkles, { class: "bsplus-founder-badge__icon", size });
}
function badgeBlobStyle(visual: Pick<BadgeVisual, "base" | "blobs">): string {
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { ChevronLeft, ChevronRight } from "lucide-static";
import LogoLight from "@/resources/icons/betterseqta-light-icon.png";
import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
import { convertTo12HourFormat } from "@/seqta/utils/convertTo12HourFormat";
@@ -299,12 +301,8 @@ export async function loadEngageHomePage(): Promise<void> {
<select id="engage-child-selector" class="engage-child-select" aria-label="Student"></select>
</div>
<div class="timetable-arrows">
<svg width="24" height="24" viewBox="0 0 24 24" style="transform: scale(-1,1)" id="engage-home-timetable-back">
<g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g>
</svg>
<svg width="24" height="24" viewBox="0 0 24 24" id="engage-home-timetable-forward">
<g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g>
</svg>
${icon(ChevronLeft, { id: "engage-home-timetable-back" })}
${icon(ChevronRight, { id: "engage-home-timetable-forward" })}
</div>
</div>
<div class="day-container loading" id="engage-day-container"></div>
+13 -21
View File
@@ -1,8 +1,8 @@
import { icon } from "@/lib/icon";
import { BookOpen, ChevronLeft, ChevronRight, ClipboardList } from "lucide-static";
import { animate, stagger } from "motion";
import LogoLight from "@/resources/icons/betterseqta-light-icon.png";
import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
import assessmentsicon from "@/seqta/icons/assessmentsIcon";
import coursesicon from "@/seqta/icons/coursesIcon";
import { GetThresholdOfColor } from "@/seqta/ui/colors/getThresholdColour";
import { convertTo12HourFormat } from "../convertTo12HourFormat";
import { delay } from "../delay";
@@ -11,7 +11,7 @@ import stringToHTML from "../stringToHTML";
import { renderShortcuts } from "@/seqta/utils/render/renderShortcuts";
import { CreateElement } from "@/seqta/utils/createEnable/CreateElement";
import { FilterUpcomingAssessments } from "@/seqta/utils/FilterUpcomingAssessments";
import { setupFixedTooltips } from "@/seqta/utils/fixedTooltip";
import { setupTooltips } from "@/seqta/utils/tooltip";
import { verboseInfo } from "@/utils/verboseLog";
import { getUserInfo } from "@/seqta/utils/userInfo";
import {
@@ -83,12 +83,8 @@ export async function loadHomePage() {
<div class="home-subtitle">
<h2 id="home-lesson-subtitle">Today's Lessons</h2>
<div class="timetable-arrows">
<svg width="24" height="24" viewBox="0 0 24 24" style="transform: scale(-1,1)" id="home-timetable-back">
<g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g>
</svg>
<svg width="24" height="24" viewBox="0 0 24 24" id="home-timetable-forward">
<g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g>
</svg>
${icon(ChevronLeft, { id: "home-timetable-back" })}
${icon(ChevronRight, { id: "home-timetable-forward" })}
</div>
</div>
<div class="day-container loading" id="day-container">
@@ -485,8 +481,8 @@ function makeLessonDiv(lesson: HomeTimetableLesson, num: number) {
if (type == "class") {
if (programmeID !== 0) {
lessonString += `
<div class="day-button clickable" style="right: 5px;" onclick="location.href='${buildAssessmentURL(programmeID, metaID)}'">${assessmentsicon}</div>
<div class="day-button clickable" style="right: 35px;" onclick="location.href='../#?page=/courses/${programmeID}:${metaID}'">${coursesicon}</div>
<a class="day-button clickable" style="right: 5px;" href="${buildAssessmentURL(programmeID, metaID)}" aria-label="Assessments">${icon(ClipboardList)}</a>
<a class="day-button clickable" style="right: 35px;" href="../#?page=/courses/${programmeID}:${metaID}" aria-label="Course">${icon(BookOpen)}</a>
`;
}
@@ -494,16 +490,14 @@ function makeLessonDiv(lesson: HomeTimetableLesson, num: number) {
const assessmentString = assessments
.map(
(element: HomeLessonAssessmentLink) =>
`<p onclick="location.href = '${buildAssessmentURL(programmeID, metaID, element.id)}';">${element.title}</p>`,
`<a href="${buildAssessmentURL(programmeID, metaID, element.id)}">${element.title}</a>`,
)
.join("");
lessonString += `
<div class="fixed-tooltip assessmenttooltip">
<svg style="width:28px;height:28px;border-radius:0;" viewBox="0 0 24 24">
<path fill="#ed3939" d="M16 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V4C18 2.9 17.11 2 16 2M16 20H4V4H6V12L8.5 9.75L11 12V4H16V20M20 15H22V17H20V15M22 7V13H20V7H22Z" />
</svg>
<div class="tooltiptext">${assessmentString}</div>
<div class="bsplus-tooltip assessmenttooltip" tabindex="0" aria-label="Assessments for this lesson">
${icon(ClipboardList, { size: 28, style: "color: #ed3939" })}
<div class="bsplus-tooltip-bubble">${assessmentString}</div>
</div>
`;
}
@@ -511,7 +505,7 @@ function makeLessonDiv(lesson: HomeTimetableLesson, num: number) {
lessonString += "</div>";
const element = stringToHTML(lessonString);
setupFixedTooltips(element);
setupTooltips(element);
return element;
}
@@ -710,9 +704,7 @@ function createAssessmentDateDiv(
const titlediv = document.createElement("div");
titlediv.classList.add("upcoming-subject-title");
titlediv.append(
stringToHTML(`<svg viewBox="0 0 24 24" style="width:35px;height:35px;fill:white;">
<path d="M6 20H13V22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V12.54L18.5 11.72L18 12V4H13V12L10.5 9.75L8 12V4H6V20M24 17L18.5 14L13 17L18.5 20L24 17M15 19.09V21.09L18.5 23L22 21.09V19.09L18.5 21L15 19.09Z"></path>
</svg>`).firstChild!,
stringToHTML(icon(ClipboardList, { size: 35, style: "color: #fff" })).firstChild!,
);
const detailsdiv = document.createElement("div");
@@ -159,16 +159,9 @@ function injectCoursesFixPopupStyles() {
transition: all 0.2s ease-in-out !important;
}
#whatsnewbk.bsplus-courses-fix-overlay .bsplus-courses-fix-btn:focus {
outline: none !important;
}
#whatsnewbk.bsplus-courses-fix-overlay .bsplus-courses-fix-btn:focus-visible {
box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #2563eb !important;
}
#whatsnewbk.bsplus-courses-fix-overlay.bsplus-courses-fix-overlay--dark .bsplus-courses-fix-btn:focus-visible {
box-shadow: 0 0 0 2px #1f2937, 0 0 0 4px #2563eb !important;
outline: var(--bsplus-focus-ring) !important;
outline-offset: 2px !important;
}
#whatsnewbk.bsplus-courses-fix-overlay .bsplus-courses-fix-btn--primary {
@@ -1,3 +1,5 @@
import { icon } from "@/lib/icon";
import { ChevronLeft, ChevronRight, Maximize2, Minimize2 } from "lucide-static";
import browser from "@/lib/browser";
import stringToHTML from "../stringToHTML";
import { settingsState } from "../listeners/SettingsState";
@@ -192,8 +194,8 @@ function renderGallerySlidesHtml(slides: PopupGallerySlide[]): string {
const nav =
slides.length > 1
? `
<button type="button" class="themeOfTheMonthCardGalleryPrev" aria-label="Previous image">‹</button>
<button type="button" class="themeOfTheMonthCardGalleryNext" aria-label="Next image">›</button>
<button type="button" class="themeOfTheMonthCardGalleryPrev" aria-label="Previous image">${icon(ChevronLeft, { size: "1em" })}</button>
<button type="button" class="themeOfTheMonthCardGalleryNext" aria-label="Next image">${icon(ChevronRight, { size: "1em" })}</button>
<div class="themeOfTheMonthCardGalleryDots" role="tablist" aria-label="Theme previews">
${slides
.map(
@@ -212,8 +214,8 @@ function renderGallerySlidesHtml(slides: PopupGallerySlide[]): string {
`;
}
const POPOUT_EXPAND_SVG = /* svg */ `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/></svg>`;
const POPOUT_COLLAPSE_SVG = /* svg */ `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 14h6v6"/><path d="M20 10h-6V4"/><path d="M14 10l7-7"/><path d="M3 21l7-7"/></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;
+45
View File
@@ -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<string, string> = {
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);
}
Loaded 100 of 103 files, more files were not shown because too many files have changed in this diff. Show more