-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
29 lines (26 loc) · 917 Bytes
/
script.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
// Scroll Animation for Navbar Links and Discover More button
document.querySelectorAll('.nav-link, #discoverMore').forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault(); // Prevent default anchor click behavior
// Get the target section ID from the href attribute
const targetId = this.getAttribute('href').substring(1);
// Scroll to the target section with smooth behavior
document.getElementById(targetId).scrollIntoView({
behavior: 'smooth',
block: 'start'
});
});
});
// Initialize Swiper
var swiper = new Swiper('.swiper-container', {
slidesPerView: 3,
spaceBetween: 30,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});