Add example darkmode JS script for bookmarks page

This commit is contained in:
Evie Litherland-Smith 2024-04-10 17:03:52 +01:00
parent 5525c6584e
commit cb22d04ac9

View 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";
}