This commit is contained in:
relikd
2023-05-29 15:20:07 +02:00
commit 1380b156d8
126 changed files with 3612 additions and 0 deletions

22
app/base/static/js/main.js Executable file
View File

@@ -0,0 +1,22 @@
function toggleMenu(theId) {
const menu = document.getElementById(theId);
menu.classList.toggle('show');
if (menu.classList.contains('show')) {
setTimeout(() => {
document.addEventListener('click', () => {
menu.classList.remove('show');
}, { once: true });
}, 50); // timeout to not immediately close
}
}
function highlight(div) {
const prev = div.style;
div.style.transition = 'background-color 0.5s';
div.style.backgroundColor = 'yellow';
setTimeout(() => {
div.style.transition = 'background-color 4s';
div.style.backgroundColor = 'unset';
}, 500);
setTimeout(() => div.style = prev, 600);
}