diff --git a/app.js b/app.js index 457753c..f3f5d90 100644 --- a/app.js +++ b/app.js @@ -363,3 +363,23 @@ const handleResolve = async () => { log(`❌ Rejected the color ${err}.`, true); }; }; + +// Function to toggle Dark Mode on or off +function toggleDarkMode() { + // Get a reference to the document's body element + const body = document.body; + + // Toggle the "dark-mode" class on the body element to change the theme + body.classList.toggle("dark-mode"); + + // Check if Dark Mode is active after toggling + const isDarkMode = body.classList.contains("dark-mode"); + + // Store the Dark Mode preference in local storage for future visits + localStorage.setItem("darkMode", isDarkMode); +} + +// Check if the user has previously enabled Dark Mode and apply it +if (localStorage.getItem("darkMode") === "true") { + document.body.classList.add("dark-mode"); +} diff --git a/index.html b/index.html index 0081ebb..16fea09 100644 --- a/index.html +++ b/index.html @@ -50,6 +50,15 @@

🤝 PromiViz

+ + +
+ + +
+
@@ -228,4 +237,4 @@

Logs

- \ No newline at end of file + diff --git a/main.css b/main.css index faa6a16..1158e00 100644 --- a/main.css +++ b/main.css @@ -40,6 +40,13 @@ body.black { background-size: 100% 820px; } +/* Dark Mode Styles */ +.dark-mode { + background-color: #333; /* Change to your preferred dark background color */ + color: #fff; /* Change to your preferred dark text color */ +} +/* Add any other styles for Dark Mode here */ + /* changes */ select { height: 25px;