implement checkbox filtering + timeline animations

This commit is contained in:
2023-01-08 15:20:21 -06:00
parent 894a2e4053
commit c07ea50491
7 changed files with 108 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
export function toggle() {
export function toggle(dir) {
let toggles = document.querySelectorAll(
".checkbox-wrapper input[type=checkbox]"
);
@@ -8,12 +8,17 @@ export function toggle() {
allow.push(x.id);
}
});
if (allow.length === 0) {
toggles.forEach(function (x) {
allow.push(x.id);
});
}
let list = document.querySelectorAll(".checkbox-client > div");
for (let i = 0; i < list.length; i++) {
list[i].classList.add("hidden");
list[i].classList.add("hidden" + dir);
for (let x = 0; x < list[i].classList.length; x++) {
if (allow.includes(list[i].classList[x])) {
list[i].classList.remove("hidden");
list[i].classList.remove("hidden" + dir);
break;
}
}