update color theme in demo.

save current theme preference to localstorage.
update to v0.10.0.
This commit is contained in:
2026-03-30 23:53:20 -04:00
parent c776b5df6a
commit ed9bd8ac34
9 changed files with 92 additions and 38 deletions

View File

@@ -8,6 +8,11 @@ document.addEventListener("DOMContentLoaded", () => {
toggle.addEventListener("click", () => {
document.body.classList.toggle("invertedTheme");
localStorage.setItem(
"useInvertedTheme",
document.body.classList.contains("invertedTheme") ? "true" : "",
);
});
toggle.innerHTML = `
@@ -28,6 +33,9 @@ document.addEventListener("DOMContentLoaded", () => {
`.trim();
document.body.appendChild(toggle);
if (!!localStorage.getItem("useInvertedTheme"))
document.body.classList.add("invertedTheme");
});
// @license-end