mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-06-22 10:19:53 +02:00
background changer 3
done, theme compatible + weird loading fix
This commit is contained in:
parent
a7aea08668
commit
30ccf9db1d
39
README.md
39
README.md
@ -57,32 +57,22 @@ Better Canvas introduces improvements to the Canvas user interface:
|
|||||||
## Newly added features
|
## Newly added features
|
||||||
- GPA presets
|
- GPA presets
|
||||||
- Scheduled Reminder Popups (broken)
|
- Scheduled Reminder Popups (broken)
|
||||||
- searching themes (the original didn't actually impliment that)
|
- Searching themes (the original didn't actually impliment that)
|
||||||
- Card Styles (image size, card roundness, card spacing, width, height, theme compatible)
|
- Card Styles (image size, card roundness, card spacing, width, height, theme compatible)
|
||||||
|
- Custom Background (by URL, theme compatible)
|
||||||
|
|
||||||
## Planned Features
|
## Planned Features (by priority)
|
||||||
- custom backgrounds (uploaded files, theme compatible, cached?)
|
- popup UI revamp
|
||||||
- custom side logo
|
|
||||||
- widgets (music, timer)
|
- widgets (music, timer)
|
||||||
- fix darkmode fixer
|
- update better todo list (with hover assignment preview)
|
||||||
- calender sync
|
|
||||||
- update better todo list
|
|
||||||
- better sidebar
|
- better sidebar
|
||||||
- flashcards
|
|
||||||
- better calender
|
|
||||||
- better notes
|
- better notes
|
||||||
- goals
|
- auto rotate theme + theme history + fix theme submissions
|
||||||
- auto rotate theme
|
- mail assistent + ui revamp
|
||||||
- theme history
|
- better calender (+ calender sync)
|
||||||
- mail assistent
|
|
||||||
- transcribe lecture
|
|
||||||
- hover assignment preview
|
|
||||||
- better what if grade
|
- better what if grade
|
||||||
- when opening assignments it will show you "if you get a 0 on this your grade will be _"
|
|
||||||
- grade leaderboard per class (opt in)
|
|
||||||
- global search
|
- global search
|
||||||
- module sorting
|
- fix darkmode fixer
|
||||||
- quick modules button
|
|
||||||
|
|
||||||
## Extra features that might be added:
|
## Extra features that might be added:
|
||||||
- card grade position, card outline
|
- card grade position, card outline
|
||||||
@ -91,6 +81,17 @@ Better Canvas introduces improvements to the Canvas user interface:
|
|||||||
- streaks
|
- streaks
|
||||||
- caching pages for faster loading
|
- caching pages for faster loading
|
||||||
- liquid glass theme?
|
- liquid glass theme?
|
||||||
|
- animated backgrounds, rotating background, time/weather reactive backgrounds, maybe chache if it becomes an issue
|
||||||
|
- custom side logo
|
||||||
|
- transcribe lecture (if there is demand for it)
|
||||||
|
- flashcards
|
||||||
|
- goals
|
||||||
|
|
||||||
|
## Community suggestions (maybe will be done at some point)
|
||||||
|
- when opening assignments it will show you "if you get a 0 on this your grade will be _"
|
||||||
|
- quick modules button on cards
|
||||||
|
- module sorting (newest, oldest) (maybe grid view)
|
||||||
|
- grade leaderboard per class (opt in)
|
||||||
|
|
||||||
## Dev Installation
|
## Dev Installation
|
||||||
|
|
||||||
|
|||||||
@ -478,7 +478,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="sub-option">
|
<div class="sub-option">
|
||||||
<input type="checkbox" id="export-customStyles" />
|
<input type="checkbox" id="export-customStyles" />
|
||||||
<span>Custom Card styles</span>
|
<span>Custom card styles</span>
|
||||||
|
</div>
|
||||||
|
<div class="sub-option">
|
||||||
|
<input type="checkbox" id="export-background" />
|
||||||
|
<span>Background image</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 1">
|
<div style="flex: 1">
|
||||||
|
|||||||
@ -391,7 +391,7 @@ function applyCustomBackground() {
|
|||||||
|
|
||||||
if (options.customBackgroundLink && options.customBackgroundLink !== "") {
|
if (options.customBackgroundLink && options.customBackgroundLink !== "") {
|
||||||
style.textContent = `
|
style.textContent = `
|
||||||
#not_right_side {
|
#wrapper {
|
||||||
background-image: url('${options.customBackgroundLink}') !important;
|
background-image: url('${options.customBackgroundLink}') !important;
|
||||||
background-size: cover !important;
|
background-size: cover !important;
|
||||||
background-attachment: fixed !important;
|
background-attachment: fixed !important;
|
||||||
@ -408,6 +408,10 @@ function applyCustomBackground() {
|
|||||||
|
|
||||||
document.documentElement.appendChild(style);
|
document.documentElement.appendChild(style);
|
||||||
}
|
}
|
||||||
|
function clearCustomBackground() {
|
||||||
|
let style = document.querySelector("#bettercanvas-background");
|
||||||
|
if (style) style.remove();
|
||||||
|
}
|
||||||
|
|
||||||
let insertTimer;
|
let insertTimer;
|
||||||
function resetTimer() {
|
function resetTimer() {
|
||||||
@ -465,6 +469,7 @@ function recieveMessage(request, sender, sendResponse) {
|
|||||||
case ("getcolors"): sendResponse(getCardColors()); break;
|
case ("getcolors"): sendResponse(getCardColors()); break;
|
||||||
case ("inspect"): sendResponse(inspectDarkMode(true)); break;
|
case ("inspect"): sendResponse(inspectDarkMode(true)); break;
|
||||||
case ("fixdm"): sendResponse(runDarkModeFixer(true)); break;
|
case ("fixdm"): sendResponse(runDarkModeFixer(true)); break;
|
||||||
|
case ("updateBackground"): clearCustomBackground(); sendResponse(true); break;
|
||||||
default: sendResponse(true);
|
default: sendResponse(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
17
js/popup.js
17
js/popup.js
@ -24,6 +24,7 @@ const syncedSubOptions = [
|
|||||||
"cardSpacing",
|
"cardSpacing",
|
||||||
"cardWidth",
|
"cardWidth",
|
||||||
"cardHeight",
|
"cardHeight",
|
||||||
|
"customBackgroundLink",
|
||||||
];
|
];
|
||||||
const localSwitches = [];
|
const localSwitches = [];
|
||||||
|
|
||||||
@ -487,6 +488,9 @@ function setup() {
|
|||||||
case "export-customStyles":
|
case "export-customStyles":
|
||||||
final = { ...final, ...(await getExport(storage, ["custom_styles"])) };
|
final = { ...final, ...(await getExport(storage, ["custom_styles"])) };
|
||||||
break;
|
break;
|
||||||
|
case "export-background":
|
||||||
|
final = { ...final, ...(await getExport(storage, ["customBackgroundLink"])) };
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -740,10 +744,9 @@ function setup() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("clearCustomBackground").addEventListener("click", () => {
|
document.getElementById("clearCustomBackground").addEventListener("click", () => {
|
||||||
chrome.storage.sync.set({
|
chrome.storage.sync.set({ "customBackgroundLink": "" });
|
||||||
"customBackgroundLink": "",
|
|
||||||
});
|
|
||||||
document.querySelector("#customBackgroundLink").value = "";
|
document.querySelector("#customBackgroundLink").value = "";
|
||||||
|
sendFromPopup("updateBackground");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1061,7 +1064,13 @@ function saveCurrentTheme() {
|
|||||||
"dark_preset": current["dark_preset"],
|
"dark_preset": current["dark_preset"],
|
||||||
"custom_cards": current["custom_cards"],
|
"custom_cards": current["custom_cards"],
|
||||||
"card_colors": current["card_colors"] === null ? [current["dark_preset"]["links"]] : current["card_colors"],
|
"card_colors": current["card_colors"] === null ? [current["dark_preset"]["links"]] : current["card_colors"],
|
||||||
"custom_font": current["custom_font"]
|
"custom_font": current["custom_font"],
|
||||||
|
"imageSize": current["imageSize"],
|
||||||
|
"cardRoundness": current["cardRoundness"],
|
||||||
|
"cardSpacing": current["cardSpacing"],
|
||||||
|
"cardWidth": current["cardWidth"],
|
||||||
|
"cardHeight": current["cardHeight"],
|
||||||
|
"customBackgroundLink": current["customBackgroundLink"],
|
||||||
}
|
}
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
local["saved_themes"][now.getTime()] = trimmed;
|
local["saved_themes"][now.getTime()] = trimmed;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user