-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
40 lines (35 loc) · 834 Bytes
/
app.js
File metadata and controls
40 lines (35 loc) · 834 Bytes
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
let sections = document.querySelectorAll("section");
window.onscroll = () => {
sections.forEach((sec) => {
let top = window.scrollY;
let offset = sec.offsetTop - 390;
let height = sec.offsetHeight;
if (top >= offset && top < offset + height) {
sec.classList.add("show-animate");
} else {
sec.classList.remove("show-animate");
}
});
};
const swiper = new Swiper(".swiper", {
autoplay: {
delay: 3500,
disableOnInteraction: false,
},
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
var navLinks = document.getElementById("navLinks");
function showMenu() {
navLinks.style.right = "0";
}
function hideMenu() {
navLinks.style.right = "-200px";
}