-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.js
113 lines (100 loc) · 2.72 KB
/
index.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
const mainMenu = document.querySelector('.mainMenu');
const closeMenu = document.querySelector('.closeMenu');
const openMenu = document.querySelector('.openMenu');
const sidePanel = document.querySelector('.sidepanel');
const collapse = document.querySelector('.collapse');
const expand = document.querySelector('.expand');
const rightCol = document.querySelector('.right-col')
const section = document.getElementsByClassName('section');
const subSection = document.getElementsByClassName('sub-section');
const title = document.getElementsByClassName('title');
var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
console.log("Loaded.")
openMenu.addEventListener('click',show);
closeMenu.addEventListener('click',close);
function show(){
mainMenu.style.display = 'flex';
mainMenu.style.top = '0';
}
function close(){
mainMenu.style.top = '-500%';
mainMenu.style.display = 'flex';
}
function openSidePanel() {
sidePanel.style.display = "block";
collapse.style.display = 'block';
expand.style.display = "none"
}
function closeSidePanel() {
sidePanel.style.display = "none";
collapse.style.display = 'none';
expand.style.display = "block"
}
if (width < 900) {
title[0].onclick = function () {
closeSidePanel()
}
title[1].onclick = function () {
closeSidePanel()
}
title[2].onclick = function () {
closeSidePanel()
}
title[3].onclick = function () {
closeSidePanel()
}
title[4].onclick = function () {
closeSidePanel()
}
}
if (width < 900) {
section[0].onclick = function () {
closeSidePanel()
}
section[1].onclick = function () {
closeSidePanel()
}
section[2].onclick = function () {
closeSidePanel()
}
section[3].onclick = function () {
closeSidePanel()
}
section[4].onclick = function () {
closeSidePanel()
}
section[5].onclick = function () {
closeSidePanel()
}
section[6].onclick = function () {
closeSidePanel()
}
section[7].onclick = function () {
closeSidePanel()
}
section[8].onclick = function () {
closeSidePanel()
}
section[9].onclick = function () {
closeSidePanel()
}
section[10].onclick = function () {
closeSidePanel()
}
}
if (width < 650) {
subSection[0].onclick = function () {
closeSidePanel()
}
subSection[1].onclick = function () {
closeSidePanel()
}
}
var myVar;
function loaderFunction() {
myVar = setTimeout(showPage, 1400);
}
function showPage() {
document.getElementById("loader").style.display = "none";
document.getElementById("page").style.display = "block";
}