Add example darkmode JS script for bookmarks page
This commit is contained in:
parent
5525c6584e
commit
cb22d04ac9
15
system/bookmarks/darkmode.js
Normal file
15
system/bookmarks/darkmode.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
// From https://www.geeksforgeeks.org/how-to-make-dark-mode-for-websites-using-html-css-javascript/
|
||||
// See also https://www.w3schools.com/howto/howto_js_toggle_dark_mode.asp
|
||||
function darkMode() {
|
||||
let element = document.body;
|
||||
let content = document.getElementById("DarkModetext");
|
||||
element.className = "dark-mode";
|
||||
content.innerText = "Dark Mode is ON";
|
||||
}
|
||||
|
||||
function lightMode() {
|
||||
let element = document.body;
|
||||
let content = document.getElementById("DarkModetext");
|
||||
element.className = "light-mode";
|
||||
content.innerText = "Dark Mode is OFF";
|
||||
}
|
Loading…
Reference in a new issue