51 lines
1.3 KiB
JavaScript
Executable File
51 lines
1.3 KiB
JavaScript
Executable File
// main script
|
|
(function () {
|
|
"use strict";
|
|
(function() {
|
|
// Redirect to language-specific homepage based on browser language, default to English
|
|
var supportedLangs = ['fr', 'nl'];
|
|
var userLang = navigator.language || navigator.userLanguage;
|
|
|
|
userLang = userLang.split('-')[0];
|
|
var currentPath = window.location.pathname;
|
|
var alreadyLang = supportedLangs.some(function(lang) {
|
|
return currentPath.startsWith('/' + lang + '/');
|
|
});
|
|
if (supportedLangs.includes(userLang) && !alreadyLang) {
|
|
window.location.href = '/' + userLang + '/';
|
|
}
|
|
})();
|
|
|
|
// Dropdown Menu Toggler For Mobile
|
|
// ----------------------------------------
|
|
const dropdownMenuToggler = document.querySelectorAll(
|
|
".nav-dropdown > .nav-link",
|
|
);
|
|
|
|
dropdownMenuToggler.forEach((toggler) => {
|
|
toggler?.addEventListener("click", (e) => {
|
|
e.target.parentElement.classList.toggle("active");
|
|
});
|
|
});
|
|
|
|
// Testimonial Slider
|
|
// ----------------------------------------
|
|
new Swiper(".testimonial-slider", {
|
|
spaceBetween: 24,
|
|
loop: true,
|
|
pagination: {
|
|
el: ".testimonial-slider-pagination",
|
|
type: "bullets",
|
|
clickable: true,
|
|
},
|
|
breakpoints: {
|
|
768: {
|
|
slidesPerView: 2,
|
|
},
|
|
992: {
|
|
slidesPerView: 3,
|
|
},
|
|
},
|
|
});
|
|
})();
|