initial commit
This commit is contained in:
12
static/js/main.js
Executable file
12
static/js/main.js
Executable file
@@ -0,0 +1,12 @@
|
||||
// скрипт...
|
||||
|
||||
// Listen for a click on the button
|
||||
const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
|
||||
document.getElementById("theme-switcher").addEventListener("click", function () {
|
||||
if (prefersDarkScheme.matches) {
|
||||
document.body.classList.toggle("light-theme");
|
||||
} else {
|
||||
document.body.classList.toggle("dark-theme");
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user