You've already forked nakamoto-archive
Update default.html
This commit is contained in:
@@ -334,6 +334,23 @@ document.onmousedown = document.onmouseup = function(e) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<script>const btn = document.querySelector(".btn-toggle");
|
||||||
|
|
||||||
|
const currentTheme = localStorage.getItem("theme");
|
||||||
|
if (currentTheme == "dark") {
|
||||||
|
document.body.classList.add("dark-theme");
|
||||||
|
}
|
||||||
|
|
||||||
|
btn.addEventListener("click", function () {
|
||||||
|
document.body.classList.toggle("dark-theme");
|
||||||
|
|
||||||
|
let theme = "light";
|
||||||
|
if (document.body.classList.contains("dark-theme")) {
|
||||||
|
theme = "dark";
|
||||||
|
}
|
||||||
|
localStorage.setItem("theme", theme);
|
||||||
|
});</script>
|
||||||
<!---The Times 03/Jan/2009 Chancellor on brink of second bailout for banks--->
|
<!---The Times 03/Jan/2009 Chancellor on brink of second bailout for banks--->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user