-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabs.js
45 lines (41 loc) · 1.85 KB
/
tabs.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
45
document.onreadystatechange = function () {
if (document.readyState == "interactive") {
initMisc();
}
};
function initMisc() {
const lobbyN01_tab = document.getElementById("lobbyN01-tab");
const lobbyN02_tab = document.getElementById("lobbyN02-tab");
const lobbyN03_tab = document.getElementById("lobbyN03-tab");
const lobbyN01_panel = document.getElementById("lobbyN01-panel");
const lobbyN02_panel = document.getElementById("lobbyN02-panel");
const lobbyN03_panel = document.getElementById("lobbyN03-panel");
/* Nav tabs et ouverture des panneaux */
lobbyN01_tab.addEventListener("click", () => {
lobbyN01_panel.classList.add("--current-lobby");
lobbyN01_tab.classList.add("--current-tab");
// remove active ones
lobbyN02_panel.classList.remove("--current-lobby");
lobbyN02_tab.classList.remove("--current-tab");
lobbyN03_panel.classList.remove("--current-lobby");
lobbyN03_tab.classList.remove("--current-tab");
});
lobbyN02_tab.addEventListener("click", () => {
lobbyN02_panel.classList.add("--current-lobby");
lobbyN02_tab.classList.add("--current-tab");
// remove active ones
lobbyN01_panel.classList.remove("--current-lobby");
lobbyN01_tab.classList.remove("--current-tab");
lobbyN03_panel.classList.remove("--current-lobby");
lobbyN03_tab.classList.remove("--current-tab");
});
lobbyN03_tab.addEventListener("click", () => {
lobbyN03_panel.classList.add("--current-lobby");
lobbyN03_tab.classList.add("--current-tab");
// remove active ones
lobbyN01_panel.classList.remove("--current-lobby");
lobbyN01_tab.classList.remove("--current-tab");
lobbyN02_panel.classList.remove("--current-lobby");
lobbyN02_tab.classList.remove("--current-tab");
});
}