-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
52 lines (40 loc) · 1.41 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
// video section
let playButton=document.getElementsByClassName("playbutton") ;
var videoFrame = document.getElementsByClassName("VideoFrame");
var video=document.getElementById("myVideo")
videoFrame[0].addEventListener('click',(e)=>{
if(video.paused){
video.play()
playButton[0].style.display='none' ;
} else {
video.pause()
playButton[0].style.display='block' ;
}
})
// shopping cart modal
var logo=document.body.querySelector(".modal__icon");
const toggleModal = () => {
document.querySelector('.modal')
.classList.toggle('modal--hidden');
document.querySelector('.overlay')
.classList.toggle('overlay--hidden');
document.body.classList.toggle('modal__scroll');
window.scrollTo({top:0,behavior:'smooth'});
}
const toggleModal2 = () => {
document.querySelector('.modal2')
.classList.toggle('modal2--hidden');
document.querySelector('.overlay')
.classList.toggle('overlay--hidden');
document.body.classList.toggle('modal2__scroll');
window.scrollTo({top:0,behavior:'smooth'});
}
document.querySelector('.modal__button ')
.addEventListener('click', toggleModal);
logo.addEventListener('click', toggleModal);
document.querySelector('.SubmitButton')
.addEventListener('click', toggleModal2);
var modal2Buttons=document.querySelectorAll('.modal2__button');
for(var i=0;i<modal2Buttons.length;i++){
modal2Buttons[i].addEventListener('click', toggleModal2);
}