-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
156 lines (138 loc) · 4.59 KB
/
script.js
File metadata and controls
156 lines (138 loc) · 4.59 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
const donateIcon = document.getElementById("icon");
const cartIcon = document.getElementById("cart");
const burgerIcon = document.getElementById("burger");
const burgerIconClosed = document.getElementById("closed-burger");
const moveUP = document.getElementById("moveUpBar");
const defaultIcon = document.querySelector('.defaultIcon');
const hoverIcon = document.querySelector('.hoverIcon');
const drop = document.getElementById("dropDownMenu");
const drop2 = document.getElementById("dropDownMenu2");
const drop3 = document.getElementById("dropDownMenu3");
const imgPara1 = document.getElementById("img-para1");
const imgPara2 = document.getElementById("img-para2");
const imgPara3 = document.getElementById("img-para3");
const imgPara4 = document.getElementById("img-para4");
const imgPara5 = document.getElementById("img-para5");
const imgPara6 = document.getElementById("img-para6");
const person1 = document.getElementById("per1");
const circle1 = document.getElementById("cir1");
const person2 = document.getElementById("per2");
const circle2 = document.getElementById("cir2");
const person3 = document.getElementById("per3");
const circle3 = document.getElementById("cir3");
const dynamictext1 = document.querySelector(" #para1")
const dynamictext2 = document.querySelector(" #para2")
const dynamictext3 = document.querySelector(" #para3")
moveUP.addEventListener("mouseover", ()=>{
defaultIcon.style.display = "none"
hoverIcon.style.display = "inline-block"
})
moveUP.addEventListener("mouseleave", ()=>{
defaultIcon.style.display = "inline-block"
hoverIcon.style.display = "none"
})
burgerIcon.addEventListener("click", ()=>{
moveUP.style.display = "block"
})
burgerIconClosed.addEventListener("click", ()=>{
moveUP.style.display = "none"
})
donateIcon.addEventListener("mouseover", () => {
donateIcon.style.color = "green"
})
donateIcon.addEventListener("mouseleave", () => {
donateIcon.style.color = "black"
})
// code for card 1
window.addEventListener("load", () => {
imgPara1.style.display = "none"
imgPara2.style.display = "none"
})
drop.addEventListener("mouseover", () => {
drop.style.height = `${42}%`
drop.style.transition = `${0.2}s`
imgPara1.style.display = "block"
imgPara2.style.display = "block"
})
drop.addEventListener("mouseleave", () => {
drop.style.height = `${9}%`
imgPara1.style.display = "none"
imgPara2.style.display = "none"
})
// code for card2
window.addEventListener("load", () => {
imgPara3.style.display = "none"
imgPara4.style.display = "none"
})
drop2.addEventListener("mouseover", () => {
drop2.style.height = `${42}%`
drop2.style.transition = `${0.2}s`
imgPara3.style.display = "block"
imgPara4.style.display = "block"
})
drop2.addEventListener("mouseleave", () => {
drop2.style.height = `${9}%`
imgPara3.style.display = "none"
imgPara4.style.display = "none"
})
// code for card3
window.addEventListener("load", () => {
imgPara5.style.display = "none"
imgPara6.style.display = "none"
})
drop3.addEventListener("mouseover", () => {
drop3.style.height = `${42}%`
drop3.style.transition = `${0.2}s`
imgPara5.style.display = "block"
imgPara6.style.display = "block"
})
drop3.addEventListener("mouseleave", () => {
drop3.style.height = `${9}%`
imgPara5.style.display = "none"
imgPara6.style.display = "none"
})
function getComments1() {
let flag1 = 0;
person1.addEventListener("click", () => {
if (flag1 == 0) {
circle1.style.backgroundColor = "black"
dynamictext1.style.display = "block"
flag1 = 1
} else if (flag1 == 1) {
circle1.style.backgroundColor = "white"
dynamictext1.style.display = "none"
flag1 = 0
}
})
}
function getComments2() {
let flag2 = 0;
person2.addEventListener("click", () => {
if (flag2 == 0) {
circle2.style.backgroundColor = "black"
dynamictext2.style.display = "block"
flag2 = 1
} else if (flag2 == 1) {
circle2.style.backgroundColor = "white"
dynamictext2.style.display = "none"
flag2 = 0
}
})
}
function getComments3() {
let flag3 = 0;
person3.addEventListener("click", () => {
if (flag3 == 0) {
circle3.style.backgroundColor = "black"
dynamictext3.style.display = "block"
flag3 = 1
} else if (flag3 == 1) {
circle3.style.backgroundColor = "white"
dynamictext3.style.display = "none"
flag3 = 0
}
})
}
getComments1();
getComments2();
getComments3();