theme persistence

This commit is contained in:
Jörg Henke
2023-09-13 09:18:04 +02:00
parent 094fa3f47a
commit 4b8822e5ad
17 changed files with 303 additions and 58 deletions

View File

@ -172,18 +172,37 @@ body {
background: radial-gradient(#ffff00, #ffe169) !important;
}
[data-bs-theme="dark"] .WP2 {
color: black !important;
}
.WP4 {
color: black;
background: radial-gradient(#00ffff, #69c3ff) !important;
}
[data-bs-theme="dark"] .WP4 {
color: black !important;
}
.WP5 {
color: black;
background: radial-gradient(#ff0000, #e396ff) !important;
}
[data-bs-theme="dark"] .WP5 {
color: black !important;
}
.TA3 {
color: black;
background: radial-gradient(#99ff99, #ccffcc) !important;
}
[data-bs-theme="dark"] .TA3 {
color: black !important;
}
.left {
text-align: left;
}

View File

@ -2,6 +2,13 @@ toggleTheme = function() {
var oldValue = $("html").attr("data-bs-theme");
var newValue = oldValue == "dark" ? "light" : "dark";
$("html").attr("data-bs-theme", newValue);
var url = "profile/" + newValue;
$.ajax({
url: url,
dataType: 'json',
type: "POST",
contentType: 'application/json'
});
}
resetValue = function(selector, value) {