-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
40 lines (36 loc) · 1.03 KB
/
Copy pathscript.js
File metadata and controls
40 lines (36 loc) · 1.03 KB
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
// Menu open/close
const menuBtn = document.querySelector(".menu-btn");
const sideMenu = document.getElementById("sideMenu");
const closeBtn = document.querySelector(".close-btn");
menuBtn.addEventListener("click", () => {
sideMenu.style.right = "0";
});
closeBtn.addEventListener("click", () => {
sideMenu.style.right = "-250px";
});
// Close menu when clicking a link
document.querySelectorAll(".side-menu a").forEach(link => {
link.addEventListener("click", () => {
sideMenu.style.right = "-250px";
});
});
// Scroll to next section when "Check Out" button clicked
document.getElementById("checkOut").addEventListener("click", () => {
document.getElementById("about").scrollIntoView({
behavior: "smooth",
block: "center",
inline: "center"
});
});
var swiper = new Swiper(".mySwiper", {
slidesPerView: 1, // Show one image at a time
loop: true,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});