background changer 1

it works too well and too many things are transparent
This commit is contained in:
Guy Sandler committed 2026-02-09 14:52:45 -08:00
1 parent 2154ee80d3
commit 03c61eb51d
7 files changed
+96 -8

No files matched your search

+22
View File
@@ -260,6 +260,7 @@ function startExtension() {
applyAestheticChanges();
changeFavicon();
updateReminders();
applyCustomBackground();
//getClassAverages();
setTimeout(() => runDarkModeFixer(false), 800);
setTimeout(() => runDarkModeFixer(false), 4500);
@@ -373,10 +374,31 @@ function applyOptionsChanges(changes) {
case ("customCardStyles"):
applyAestheticChanges();
break;
case ("customBackgroundLink"):
case ("customBackgroundUpload"):
applyCustomBackground();
break;
}
});
}
function applyCustomBackground() {
// let style = document.querySelector("#DashboardCard_Container")
let style = document.querySelector("#bettercanvas-background") || document.createElement('style');
style.id = "bettercanvas-background";
if (options.customBackgroundUpload && options.customBackgroundUpload !== "") {
style.textContent = `#not_right_side { background-image: url('${options.customBackgroundUpload}') !important; background-size: cover !important; background-attachment: fixed !important; }`;
} else if (options.customBackgroundLink && options.customBackgroundLink !== "") {
style.textContent = `#not_right_side { background-image: url('${options.customBackgroundLink}') !important; background-size: cover !important; background-attachment: fixed !important; }
.ic-Dashboard-header__layout { background: none !important; }`; // try to make this hide things underneath and add to other side
} else {
style.textContent = "";
}
document.documentElement.appendChild(style);
}
let insertTimer;
function resetTimer() {
clearTimeout(insertTimer);