mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
feat: icon only sidebar
This commit is contained in:
@@ -305,6 +305,7 @@ function getDefaultValues(): SettingsState {
|
|||||||
customshortcuts: [],
|
customshortcuts: [],
|
||||||
lettergrade: false,
|
lettergrade: false,
|
||||||
newsSource: "australia",
|
newsSource: "australia",
|
||||||
|
iconOnlySidebar: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -455,6 +455,63 @@ ul.magicDelete > li.deleting {
|
|||||||
width: 28px !important;
|
width: 28px !important;
|
||||||
height: 28px !important;
|
height: 28px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Icon Only Sidebar - compact mode. When submenu is open, all styles are disabled so it behaves as normal sidebar. */
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) {
|
||||||
|
#menu {
|
||||||
|
width: 70px !important;
|
||||||
|
min-width: 70px !important;
|
||||||
|
max-width: 70px !important;
|
||||||
|
transition: width 0.2s ease;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu > ul {
|
||||||
|
min-width: 0 !important;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
left: 70px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu li > label span,
|
||||||
|
#menu section > label span {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu ul > li > svg {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu .sub {
|
||||||
|
left: 70px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu ul li,
|
||||||
|
#menu ul section {
|
||||||
|
width: 100% !important;
|
||||||
|
min-width: 0 !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
padding: 8px !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
box-sizing: border-box !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu li > label,
|
||||||
|
#menu section > label {
|
||||||
|
flex: 0 0 auto !important;
|
||||||
|
min-width: 0 !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu li > label > svg,
|
||||||
|
#menu section > label > svg {
|
||||||
|
margin: 0 auto !important;
|
||||||
|
flex-shrink: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
[class*="notifications__items___"] {
|
[class*="notifications__items___"] {
|
||||||
-ms-overflow-style: none !important;
|
-ms-overflow-style: none !important;
|
||||||
scrollbar-width: none !important;
|
scrollbar-width: none !important;
|
||||||
@@ -921,6 +978,17 @@ html.transparencyEffects
|
|||||||
-webkit-transform: translatex(270px);
|
-webkit-transform: translatex(270px);
|
||||||
transform: translatex(270px);
|
transform: translatex(270px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) {
|
||||||
|
#menu {
|
||||||
|
-webkit-transform: translatex(-70px);
|
||||||
|
transform: translatex(-70px);
|
||||||
|
}
|
||||||
|
.menuShown #content {
|
||||||
|
-webkit-transform: translatex(70px);
|
||||||
|
transform: translatex(70px);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1145px) {
|
@media (max-width: 1145px) {
|
||||||
|
|||||||
@@ -41,3 +41,13 @@
|
|||||||
#menu > ul:has(li.hasChildren.active) > li.active {
|
#menu > ul:has(li.hasChildren.active) > li.active {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Icon-only collapsed: submenu slides over narrow icons */
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul:has(li.hasChildren.active) > li::before,
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul ul:has(li.hasChildren.active) > li::before,
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul:has(li.hasChildren.active) > li > label,
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul:has(li.hasChildren.active) > li > svg,
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul ul:has(li.hasChildren.active) > li > label,
|
||||||
|
body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul ul:has(li.hasChildren.active) > li > svg {
|
||||||
|
transform: translateX(-70px);
|
||||||
|
}
|
||||||
|
|||||||
@@ -149,6 +149,16 @@
|
|||||||
text: "Edit"
|
text: "Edit"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "Icon Only Sidebar",
|
||||||
|
description: "Show only icons in the sidebar for a compact layout.",
|
||||||
|
id: 14,
|
||||||
|
Component: Switch,
|
||||||
|
props: {
|
||||||
|
state: $settingsState.iconOnlySidebar ?? false,
|
||||||
|
onChange: (isOn: boolean) => settingsState.iconOnlySidebar = isOn
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "Animations",
|
title: "Animations",
|
||||||
description: "Enables animations on certain pages.",
|
description: "Enables animations on certain pages.",
|
||||||
|
|||||||
@@ -612,6 +612,7 @@ export function init() {
|
|||||||
if (settingsState.onoff) {
|
if (settingsState.onoff) {
|
||||||
console.info("[BetterSEQTA+] Enabled");
|
console.info("[BetterSEQTA+] Enabled");
|
||||||
if (settingsState.DarkMode) document.documentElement.classList.add("dark");
|
if (settingsState.DarkMode) document.documentElement.classList.add("dark");
|
||||||
|
if (settingsState.iconOnlySidebar) document.body.classList.add("icon-only-sidebar");
|
||||||
|
|
||||||
document.querySelector(".legacy-root")?.classList.add("hidden");
|
document.querySelector(".legacy-root")?.classList.add("hidden");
|
||||||
ObserveMenuItemPosition();
|
ObserveMenuItemPosition();
|
||||||
|
|||||||
@@ -30,6 +30,18 @@ export class StorageChangeHandler {
|
|||||||
"subjectfilters",
|
"subjectfilters",
|
||||||
FilterUpcomingAssessments.bind(this),
|
FilterUpcomingAssessments.bind(this),
|
||||||
);
|
);
|
||||||
|
settingsState.register(
|
||||||
|
"iconOnlySidebar",
|
||||||
|
this.handleIconOnlySidebarChange.bind(this),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleIconOnlySidebarChange(newValue: boolean | undefined) {
|
||||||
|
if (newValue) {
|
||||||
|
document.body.classList.add("icon-only-sidebar");
|
||||||
|
} else {
|
||||||
|
document.body.classList.remove("icon-only-sidebar");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleDarkModeChange() {
|
private handleDarkModeChange() {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ export interface SettingsState {
|
|||||||
newsSource?: string;
|
newsSource?: string;
|
||||||
mockNotices?: boolean;
|
mockNotices?: boolean;
|
||||||
hideSensitiveContent?: boolean;
|
hideSensitiveContent?: boolean;
|
||||||
|
iconOnlySidebar?: boolean;
|
||||||
|
|
||||||
// depreciated keys
|
// depreciated keys
|
||||||
animatedbk: boolean;
|
animatedbk: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user