-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
44 lines (38 loc) · 1.15 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
AOS.init({
duration: 1500,
offset: 0,
anchorPlacement: 'center-bottom',
once: true
});
var fc = document.getElementById("flowchart").children;
function filter(cat) {
var fil = cat.getAttribute("data-fil");
// select the right button
var buttons = cat.parentElement.children;
for (var i = 0; i < buttons.length; i++) {
var b = buttons[i];
if (b == cat) {
b.classList.add("selected");
} else {
b.classList.remove("selected");
}
}
// filter kcs by knowledge area
for (var i = 0; i < fc.length; i++) {
var item = fc[i];
item.classList.add("hide");
var cat = item.getAttribute("data-cat");
if (cat == null|| fil == "all" || cat.includes(fil)) {
// matching filter; show kc
item.classList.remove("hide");
} // else, not the right filter; hide kc
}
}
// don't start animations until everything is loaded
document.body.classList.add('js-loading');
console.log("loading");
window.addEventListener("load", showPage);
function showPage() {
document.body.classList.remove('js-loading');
console.log("done");
}