clean up styling, redo navbar, redo settings
All checks were successful
/ build (push) Successful in 6m53s
All checks were successful
/ build (push) Successful in 6m53s
This commit is contained in:
parent
465e615667
commit
9b38e4bf15
15 changed files with 624 additions and 869 deletions
|
|
@ -9,7 +9,6 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
|
||||
// load saved settings
|
||||
loadSettings();
|
||||
applyTheme();
|
||||
|
||||
// event listeners on all inputs
|
||||
fontInputs.forEach(input => {
|
||||
|
|
@ -19,7 +18,6 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
themeInputs.forEach(input => {
|
||||
input.addEventListener('change', function() {
|
||||
saveSettings();
|
||||
applyTheme();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -78,20 +76,4 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
disableAlttextCheckbox.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// apply the theme based on user preference
|
||||
function applyTheme() {
|
||||
const selectedTheme = document.querySelector('input[name="theme-setting"]:checked').value;
|
||||
|
||||
// remove any existing theme
|
||||
document.documentElement.removeAttribute('data-theme');
|
||||
|
||||
// apply the selected theme
|
||||
if (selectedTheme === 'light') {
|
||||
document.documentElement.setAttribute('data-theme', 'light');
|
||||
} else if (selectedTheme === 'dark') {
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
}
|
||||
// if auto, don't set a data-theme attribute, let the media query handle it
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue