-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
137 lines (95 loc) · 2.73 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
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
const navBar = document.getElementById('navBar')
const toggleBtn = document.getElementById('toggleId')
const closeBtn = document.getElementById('closeId')
toggleBtn.addEventListener('click', ()=>{
navBar.classList.toggle('show')
})
closeBtn.addEventListener('click', ()=>{
navBar.classList.remove('show')
})
const nav = document.querySelectorAll('.navLink');
function takeAction(){
navBar.classList.remove('show')
}
nav.forEach(n=>n.addEventListener('click',takeAction))
// Header Slider.
let clientSwiper = new Swiper(".reviewContent", {
cssMode: true,
loop: true,
autoplay: true,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
mousewheel: true,
keyboard: true,
mausehold: true,
});
let swiper = new Swiper(".homeWrapper", {
cssMode: true,
loop: true,
autoplay: true,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
mousewheel: true,
keyboard: true,
mausehold: true,
drag: true,
});
// FUCNTION TO ADD HEADER BG ============================================>
function boxShadow (){
const scrollHeader = document.getElementById('header')
if(this.scrollY >= 35)
scrollHeader.classList.add('headerActive')
else
scrollHeader.classList.remove('headerActive')
}
window.addEventListener('scroll', boxShadow)
// FUNCTION TO TOGGLE BENEFITS===================================================>
const toggleBenefitIcon = document.querySelectorAll('#symbol'),
container = document.querySelectorAll('.benefitContainer');
toggleBenefitIcon[0].addEventListener('click', ()=>{
container[0].classList.toggle('benefitClose')
})
container[0].classList.remove('benefitClose')
toggleBenefitIcon[1].addEventListener('click', ()=>{
container[1].classList.toggle('benefitClose')
})
// function changeIcon(){
// let here =
// }
//FUNCTION TO TOGGLE SERVICE IMAGES -==================================>
const barBtn = document.querySelectorAll('.bar');
for(let i = 0; i<barBtn.length; i++){
barBtn[i].addEventListener('click', function(){
for(let j = 0; j<barBtn.length; j++){
barBtn[j].classList.remove('active')
barBtn[j].style.cursor = "pointer";
}
this.classList.add('active')
})
}
// SCROLL REAVEAL==============================================>
const sr = ScrollReveal({
origin:'top',
distance: '50px',
duration:2000,
reset:true
});
sr.reveal(`.introSection,`,{
interval:200
});
sr.reveal(`.aboutText, `,{
origin:'left',
interval:200
});