diff --git a/README.md b/README.md index 2e2d98a..0ec0883 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Better Canvas introduces improvements to the Canvas user interface: - Card Styles (image size, card roundness, card spacing, width, height, theme compatible) ## Planned Features -- custom backgrounds +- custom backgrounds (uploaded files, theme compatible, cached?) - custom side logo - widgets (music, timer) - fix darkmode fixer @@ -90,6 +90,7 @@ Better Canvas introduces improvements to the Canvas user interface: - revamp cards page UI - streaks - caching pages for faster loading +- liquid glass theme? ## Dev Installation diff --git a/html/popup.html b/html/popup.html index f9654d0..0f13772 100644 --- a/html/popup.html +++ b/html/popup.html @@ -774,7 +774,6 @@

Custom Background

Use an image url or upload an image file

- diff --git a/js/background.js b/js/background.js index 326393c..eac76c7 100644 --- a/js/background.js +++ b/js/background.js @@ -100,7 +100,6 @@ chrome.runtime.onInstalled.addListener(function () { "cardHeight": 250, "customCardStyles": false, "customBackgroundLink": "", - "customBackgroundUpload": "", } }; diff --git a/js/content.js b/js/content.js index 7667b52..995e579 100644 --- a/js/content.js +++ b/js/content.js @@ -261,7 +261,10 @@ function startExtension() { changeFavicon(); updateReminders(); applyCustomBackground(); + //getClassAverages(); + + setTimeout(() => document.getElementById("footer").remove(), 800); setTimeout(() => runDarkModeFixer(false), 800); setTimeout(() => runDarkModeFixer(false), 4500); }); @@ -375,7 +378,6 @@ function applyOptionsChanges(changes) { applyAestheticChanges(); break; case ("customBackgroundLink"): - case ("customBackgroundUpload"): applyCustomBackground(); break; } @@ -387,13 +389,21 @@ function applyCustomBackground() { 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 = ""; + 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; + backdrop-filter: blur(10px) !important; + border-radius: 5px; + } + .bettercanvas-gpa-card {background: var(--bcbackground-0) !important;} + .bettercanvas-gpa {background: var(--bcbackground-0) !important;} + .ic-DashboardCard {background: var(--bcbackground-0) !important;}`; // todo: liquid glass? } document.documentElement.appendChild(style); diff --git a/js/popup.js b/js/popup.js index 260b073..43a3d4f 100644 --- a/js/popup.js +++ b/js/popup.js @@ -118,7 +118,6 @@ const defaultOptions = { "cardHeight": 250, "customCardStyles": false, "customBackgroundLink": "", - "customBackgroundUpload": "", } }; @@ -274,26 +273,6 @@ function setupCustomBackgroundLink(initial) { }) } -function setupCustomBackgroundUpload(initial) { - let el = document.querySelector("#customBackgroundUpload"); - el.addEventListener("change", handleBackgroundUpload); -} -function handleBackgroundUpload(e) { - const file = e.target.files[0]; - if (file) { - const reader = new FileReader(); - reader.onload = function(event) { - const base64 = event.target.result; - chrome.storage.sync.set({ - "customBackgroundUpload": base64, - "customBackgroundLink": "" - }); - document.querySelector("#customBackgroundLink").value = "Using uploaded file"; - } - reader.readAsDataURL(file); - } -} - function setup() { const menu = { @@ -324,7 +303,6 @@ function setup() { { "identifier": "cardWidth", "setup": (initial) => setupCardWidthInput(initial) }, { "identifier": "cardHeight", "setup": (initial) => setupCardHeightInput(initial) }, { "identifier": "customBackgroundLink", "setup": (initial) => setupCustomBackgroundLink(initial)}, - { "identifier": "customBackgroundUpload", "setup": (initial) => setupCustomBackgroundUpload(initial)}, ], } @@ -764,10 +742,8 @@ function setup() { document.getElementById("clearCustomBackground").addEventListener("click", () => { chrome.storage.sync.set({ "customBackgroundLink": "", - "customBackgroundUpload": "" }); document.querySelector("#customBackgroundLink").value = ""; - document.querySelector("#customBackgroundUpload").value = ""; }); }