-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.js
79 lines (51 loc) · 2.02 KB
/
menu.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
document.addEventListener("DOMContentLoaded",function(){
let head=document.querySelector("header");
function showcontent(){
const menu=document.querySelector(".menu-items");
menu.style.height="100%"
console.log(menu.style.height);
if(head.style.display==='none'){
head.style.display='flex';
document.querySelector("#close-menu").style.display='none';
}else{
head.style.display='none'
}
}
function closecontent(){
const menu=document.querySelector("section.menu-items");
menu.style.height="0"
if(head.style.display==='none'){
head.style.display='flex';
}else{
head.style.display='none'
}
}
function close(){
const items=document.querySelectorAll("section.menu-items nav ul>li")
for (const iterator of items) {
iterator.addEventListener("click",closecontent)
}
}
document.querySelector("#menu").addEventListener("click",showcontent)
document.querySelector("#close-menu").addEventListener("click",closecontent)
close()
const proj1=document.querySelector("#proj-1")
proj1.addEventListener("click",function(){
console.log("hi")
window.open("https://github.com/sumitdethe27/Chess","_blank")
})
const proj2=document.querySelector("#proj-2")
proj2.addEventListener("click",function(){
window.open("https://github.com/sumitdethe27/Sneaker-Store","_blank")
})
const proj3=document.querySelector("#proj-3")
proj3.addEventListener("click",function(){
console.log("hi")
window.open("https://github.com/sumitdethe27/qr-code-generator","_blank")
})
const proj4=document.querySelector("#proj-4")
proj4.addEventListener("click",function(){
console.log("hi")
window.open("https://github.com/sumitdethe27/cred-clone","_blank")
})
})