overhauled old theme
This commit is contained in:
parent
f18a342ae5
commit
fb24c6a302
82 changed files with 1378 additions and 1371 deletions
|
|
@ -1,26 +0,0 @@
|
|||
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);
|
||||
|
||||
const svg = details.querySelector('summary svg');
|
||||
if (svg) {
|
||||
svg.style.transition = isOpen ? 'none' : '';
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
dropdown.forEach(details => {
|
||||
const svg = details.querySelector('summary svg');
|
||||
if (svg) svg.style.transition = '';
|
||||
});
|
||||
}, 100);
|
||||
Loading…
Add table
Add a link
Reference in a new issue