-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
64 lines (54 loc) · 1.44 KB
/
app.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
let openInfo = false
let openProj = false
let openExp = false
const arr = ["./images/bull.jpg", "./images/one.jpg", "./images/two.jpg"]
function OpenInfo(){
openInfo = !openInfo
const info1 = document.getElementById("info1")
const info2 = document.getElementById("info2")
if (openProj) {
openProj = false
info2.style.display = "none"
info1.style.display = "block"
}
else {
if (openInfo) {
info1.style.display = "block"
} else {
info1.style.display = "none"
}
}
}
function OpenProjects(){
openProj = !openProj
const info1 = document.getElementById("info1")
const info2 = document.getElementById("info2")
if (openInfo) {
openInfo = false
info1.style.display = "none"
info2.style.display = "block"
}
else {
if (openProj) {
info2.style.display = "block"
} else {
info2.style.display = "none"
}
}
}
function OpenExpectations(){
openExp = !openExp
const exps = document.querySelectorAll(".expectations")
exps.forEach((exp) => {
if (openExp) {
exp.classList.add("text-shown")
} else {
exp.classList.remove("text-shown")
}
})
}
function LoadRandomPhoto(){
let value = Math.floor(Math.random()*(arr.length))
const img = document.getElementById("mypic")
img.setAttribute("src", arr[value])
}