-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
88 lines (74 loc) · 2.11 KB
/
main.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const navBar = document.getElementById('navBar')
const toggleIcon = document.getElementById('toggleBtn')
const nav = document.querySelectorAll('.navLink')
const searchIcon = document.getElementById('searchIcon')
const searchInput = document.getElementById('searchInput')
const closeSearch = document.getElementById('closeSearch')
toggleIcon.addEventListener('click', function(){
navBar.classList.toggle('show')
if(navBar.classList.contains('show')){
toggleIcon.innerHTML = `<i class='bx bx-x-circle icon'></i>`
searchInput.style.display = 'none'
}else{
toggleIcon.innerHTML = `<i class='bx bx-menu-alt-right icon' ></i>`
}
})
nav.forEach(nav =>{
nav.addEventListener('click', function(){
navBar.classList.remove('show')
toggleIcon.innerHTML = `<i class='bx bx-menu-alt-right icon' ></i>`
})
})
searchIcon.addEventListener('click', function(){
searchInput.style.display = 'flex'
navBar.classList.remove('show')
toggleIcon.innerHTML = `<i class='bx bx-menu-alt-right icon' ></i>`
})
closeSearch.addEventListener('click', function(){
searchInput.style.display = 'none'
})
let newSwiper = new Swiper(".clientBody", {
cssMode: true,
loop: true,
autoplay: true,
centeredSlide: true,
spaceBetween: 20,
slidePerView: 'auto',
pagination: {
el: ".swiper-pagination",
clickable: true,
},
mousewheel: true,
keyboard: true,
mausehold: true,
breakpoints: {
920: {
slidesPerView: 2,
spaceBetween: 50,
},
},
});
const sr = ScrollReveal({
distance: '30px',
duration: 2000,
origin: 'top',
reset: true
});
sr.reveal(`.mainText, .bannerDiv `,
{interval: 200,
})
sr.reveal(`.dealContent, .products, .client, .footer, .col-1, .col`,
{interval: 200,
})
sr.reveal(`.aboutSection`,
{interval: 200,
origin: 'right'
})
sr.reveal(`.aboutImageDiv`,
{interval: 200,
origin: 'left'
})
sr.reveal(`.aboutContent`,
{interval: 200,
origin: 'right'
})