forked from daicreative/GameDesignWebsite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecal.js
53 lines (46 loc) · 1.45 KB
/
decal.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 syllabusLink = document.getElementById('syllabusLink');
var scheduleLink = document.getElementById('scheduleLink');
var labsLink = document.getElementById('labsLink');
var syllabusPage = document.getElementById('syllabusPage');
var schedulePage = document.getElementById('schedulePage');
var labsPage = document.getElementById('labsPage');
function resetDecal() {
syllabusPage.setAttribute('class', 'hidden');
schedulePage.setAttribute('class', 'hidden');
labsPage.setAttribute('class', 'hidden');
syllabusLink.setAttribute('class', 'notselected');
scheduleLink.setAttribute('class', 'notselected');
labsLink.setAttribute('class', 'notselected');
}
syllabusLink.onclick = function() {
resetDecal();
syllabusPage.setAttribute('class', 'visible');
syllabusLink.setAttribute('class', 'selected');
};
scheduleLink.onclick = function() {
resetDecal();
schedulePage.setAttribute('class', 'visible');
scheduleLink.setAttribute('class', 'selected');
};
labsLink.onclick = function() {
resetDecal();
labsPage.setAttribute('class', 'visible');
labsLink.setAttribute('class', 'selected');
};
const urlParams = new URLSearchParams(window.location.search);
const tabParam = urlParams.get('tab');
switch (tabParam) {
case "syllabus":
syllabusLink.click();
break;
case "schedule":
scheduleLink.click();
break;
case "labs":
labsLink.click();
break;
default:
syllabusLink.click();
}
}