mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-06-06 11:08:44 +00:00
Add dark mode
This commit is contained in:
parent
8607f16212
commit
3c6653a77b
15 changed files with 124 additions and 23 deletions
|
@ -1,8 +1,12 @@
|
|||
var actionIcons = {
|
||||
"like": "/static/icons/star-o.png",
|
||||
"dark-like": "/static/icons/dark-star-o.png",
|
||||
"unlike": "/static/icons/liked.png",
|
||||
"dark-unlike": "/static/icons/liked.png",
|
||||
"retweet": "/static/icons/retweet.png",
|
||||
"unretweet": "/static/icons/retweeted.png"
|
||||
"dark-retweet": "/static/icons/dark-retweet.png",
|
||||
"unretweet": "/static/icons/retweeted.png",
|
||||
"dark-unretweet": "/static/icons/retweeted.png"
|
||||
};
|
||||
|
||||
var reverseActions = {
|
||||
|
@ -31,7 +35,11 @@ function http(method, url, success, error) {
|
|||
}
|
||||
|
||||
function updateActionForm(id, f, action) {
|
||||
f.children[1].src = actionIcons[action];
|
||||
if (Array.from(document.body.classList).indexOf("dark") > -1) {
|
||||
f.children[1].src = actionIcons["dark-" + action];
|
||||
} else {
|
||||
f.children[1].src = actionIcons[action];
|
||||
}
|
||||
f.action = "/" + action + "/" + id;
|
||||
f.dataset.action = action;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue