-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
28 lines (25 loc) · 921 Bytes
/
script.js
File metadata and controls
28 lines (25 loc) · 921 Bytes
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
let pageLinks = document.getElementById("pagelinks")
let aboutPage = document.getElementById("about")
let projectPage = document.getElementById("projects")
let showContact = document.getElementById("showcontact")
let contactInfo = document.getElementById("contact")
let dimScreen = document.getElementById("cover")
document.documentElement.addEventListener("mouseup", (e) => {
if (!contactInfo.contains(e.target) && contactInfo.style.display == 'block') {
contactInfo.style.display = 'none'
dimScreen.style.display = 'none'
}
})
showContact.onclick = () => {
contactInfo.style.display = 'block'
dimScreen.style.display = 'block'
}
pageLinks.addEventListener("click", (e) => {
if (e.target.innerHTML === "About") {
aboutPage.style.display = "inline-block"
projectPage.style.display = "none"
} else {
aboutPage.style.display = "none"
projectPage.style.display = "inline-block"
}
})