Spaces:
Sleeping
Sleeping
Download static/script.js from FakeNewsDetector/Space1: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/FakeNewsDetector/Space1/resolve/main/static/script.js
- Command line
-
hf download hf://spaces/FakeNewsDetector/Space1/static/script.js
-
curl -L -o script.js https://huggingface.co/spaces/FakeNewsDetector/Space1/resolve/main/static/script.js
1.11 kB
| function darkmode() { | |
| const body = document.body; | |
| const headerText = document.getElementById("header-text"); | |
| const h1Elements = document.getElementsByTagName("h1"); // Select all h1 elements | |
| // Check if we're currently in light mode (white or default) | |
| if (body.style.backgroundColor === "white" || body.style.backgroundColor === "") { | |
| // Switch to dark mode | |
| body.style.backgroundColor = "black"; | |
| body.style.color = "white"; | |
| // Update all h1 elements to white | |
| for (let h1 of h1Elements) { | |
| h1.style.color = "white"; | |
| } | |
| // Set header-text color if element exists | |
| if (headerText) { | |
| headerText.style.color = "#B1C8C6"; | |
| } | |
| } else { | |
| // Switch to light mode | |
| body.style.backgroundColor = "white"; | |
| body.style.color = "black"; | |
| // Update all h1 elements to black | |
| for (let h1 of h1Elements) { | |
| h1.style.color = "black"; | |
| } | |
| // Reset header-text color if element exists | |
| if (headerText) { | |
| headerText.style.color = "black"; | |
| } | |
| } | |
| } |