overhauled old theme

This commit is contained in:
sundae 2025-10-14 19:40:29 +03:00
parent f18a342ae5
commit fb24c6a302
No known key found for this signature in database
82 changed files with 1378 additions and 1371 deletions

View file

@ -0,0 +1,14 @@
const detailsElements = document.getElementsByTagName("details");
const dropdown = Array.from(detailsElements);
const save = () => {
dropdown.forEach((details, i) => {
localStorage.setItem(`details${i}`, details.hasAttribute("open"));
});
};
dropdown.forEach((details, i) => {
const isOpen = JSON.parse(localStorage.getItem(`details${i}`)) || false;
details.toggleAttribute("open", isOpen);
details.addEventListener("toggle", save);
});