2026-02-23 18:19:28 +01:00
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
|
// ---- MOBILE NAV ----
|
|
|
|
|
const header = document.querySelector('body > header');
|
|
|
|
|
const burger = header.querySelector('.burger');
|
|
|
|
|
const navLinks = header.querySelectorAll('nav ul a');
|
|
|
|
|
|
|
|
|
|
burger.addEventListener('click', function () {
|
|
|
|
|
header.classList.toggle('nav-open');
|
|
|
|
|
document.body.classList.toggle('no-scroll');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
navLinks.forEach(function (link) {
|
|
|
|
|
link.addEventListener('click', function () {
|
|
|
|
|
if (!header.classList.contains('nav-open')) return;
|
|
|
|
|
header.classList.remove('nav-open');
|
|
|
|
|
document.body.classList.remove('no-scroll');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2026-02-23 17:02:33 +01:00
|
|
|
const excerptSwiper = new Swiper('.excerpts-swiper', {
|
|
|
|
|
// Slides visibles et groupement
|
|
|
|
|
slidesPerView: 3,
|
|
|
|
|
slidesPerGroup: 3,
|
|
|
|
|
spaceBetween: 30,
|
|
|
|
|
|
|
|
|
|
// Infinite loop
|
|
|
|
|
loop: true,
|
|
|
|
|
|
|
|
|
|
// Navigation arrows
|
|
|
|
|
navigation: {
|
|
|
|
|
nextEl: '.swiper-button-next',
|
|
|
|
|
prevEl: '.swiper-button-prev',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Pagination bullets
|
|
|
|
|
pagination: {
|
|
|
|
|
el: '.swiper-pagination',
|
|
|
|
|
clickable: true,
|
|
|
|
|
dynamicBullets: false,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Transitions
|
|
|
|
|
speed: 400,
|
|
|
|
|
effect: 'slide',
|
|
|
|
|
|
|
|
|
|
// Responsive breakpoints
|
|
|
|
|
breakpoints: {
|
|
|
|
|
// Mobile : <= 768px
|
|
|
|
|
0: {
|
|
|
|
|
slidesPerView: 1,
|
|
|
|
|
slidesPerGroup: 1,
|
|
|
|
|
spaceBetween: 20,
|
|
|
|
|
},
|
|
|
|
|
// Desktop : > 768px
|
|
|
|
|
769: {
|
|
|
|
|
slidesPerView: 3,
|
|
|
|
|
slidesPerGroup: 3,
|
|
|
|
|
spaceBetween: 30,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|