-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
35 lines (28 loc) · 993 Bytes
/
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
const openFace=document.querySelector('.open');
const eyesFace=document.querySelector(".eyes");
const earsFace=document.querySelector('.ears');
const mouthFace=document.querySelector(".mouth");
openFace.addEventListener('click', () => {
if(eyesFace.classList.contains('eyes')) {
eyesFace.classList.add('active');
openFace.classList.remove('active');
}
});
eyesFace.addEventListener('click', () => {
if(earsFace.classList.contains('ears')) {
earsFace.classList.add('active');
eyesFace.classList.remove('active');
}
});
earsFace.addEventListener('click', () => {
if(mouthFace.classList.contains('mouth')) {
mouthFace.classList.add('active');
earsFace.classList.remove('active');
}
});
mouthFace.addEventListener('click', () => {
if(eyesFace.classList.contains('eyes')) {
eyesFace.classList.add('active');
mouthFace.classList.remove('active');
}
});