47 lines
1 KiB
JavaScript
47 lines
1 KiB
JavaScript
import Swiper from 'https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.mjs';
|
|
|
|
export function initHomeInvestigationsSlider() {
|
|
const slider = document.querySelector('.home-investigations-slider');
|
|
|
|
if (!slider) {
|
|
return;
|
|
}
|
|
|
|
const swiper = new Swiper('.home-investigations-slider', {
|
|
// Optional parameters
|
|
slidesPerView: 1,
|
|
spaceBetween: 20,
|
|
speed: 600,
|
|
|
|
// Touch/Swipe settings
|
|
touchRatio: 1,
|
|
touchAngle: 45,
|
|
grabCursor: true,
|
|
simulateTouch: true,
|
|
allowTouchMove: true,
|
|
|
|
// Navigation arrows
|
|
navigation: {
|
|
nextEl: '.swiper-button-next',
|
|
prevEl: '.swiper-button-prev',
|
|
},
|
|
|
|
// Pagination
|
|
pagination: {
|
|
el: '.swiper-pagination',
|
|
clickable: true,
|
|
},
|
|
|
|
// Keyboard control
|
|
keyboard: {
|
|
enabled: true,
|
|
},
|
|
|
|
// Accessibility
|
|
a11y: {
|
|
prevSlideMessage: 'Investigation précédente',
|
|
nextSlideMessage: 'Investigation suivante',
|
|
paginationBulletMessage: 'Aller à l\'investigation {{index}}',
|
|
},
|
|
});
|
|
}
|