forked from daicreative/GameDesignWebsite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclub.js
53 lines (46 loc) · 1.42 KB
/
club.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
46
47
48
49
50
51
52
53
window.onload = function() {
var aboutLink = document.getElementById('aboutLink');
var partiesLink = document.getElementById('partiesLink');
var eventsLink = document.getElementById('eventsLink');
var aboutPage = document.getElementById('aboutPage');
var partiesPage = document.getElementById('partiesPage');
var eventsPage = document.getElementById('eventsPage');
function resetDecal() {
aboutPage.setAttribute('class', 'hidden');
partiesPage.setAttribute('class', 'hidden');
eventsPage.setAttribute('class', 'hidden');
aboutLink.setAttribute('class', 'notselected');
partiesLink.setAttribute('class', 'notselected');
eventsLink.setAttribute('class', 'notselected');
}
aboutLink.onclick = function() {
resetDecal();
aboutPage.setAttribute('class', 'visible');
aboutLink.setAttribute('class', 'selected');
};
partiesLink.onclick = function() {
resetDecal();
partiesPage.setAttribute('class', 'visible');
partiesLink.setAttribute('class', 'selected');
};
eventsLink.onclick = function() {
resetDecal();
eventsPage.setAttribute('class', 'visible');
eventsLink.setAttribute('class', 'selected');
};
const urlParams = new URLSearchParams(window.location.search);
const tabParam = urlParams.get('tab');
switch (tabParam) {
case "about":
aboutLink.click();
break;
case "parties":
partiesLink.click();
break;
case "events":
eventsLink.click();
break;
default:
aboutLink.click();
}
}