Skip to content
document.addEventListener("DOMContentLoaded", function () {
/*
* TERMS & CONDITIONS POPUP
* Elementor Popup ID: 424
* I Agree Button CSS ID: agree-button
*/
const STORAGE_KEY = "termsAccepted";
// Check if the visitor has already accepted the terms
const termsAccepted = localStorage.getItem(STORAGE_KEY);
// If already accepted, don't show the popup
if (termsAccepted === "true") {
return;
}
// Wait 2 seconds after page load
setTimeout(function () {
// Make sure Elementor Pro popup module is available
if (
typeof elementorProFrontend !== "undefined" &&
elementorProFrontend.modules &&
elementorProFrontend.modules.popup
) {
// Open Elementor Popup #424
elementorProFrontend.modules.popup.showPopup({
id: 424
});
}
}, 2000);
/*
* I AGREE BUTTON
* Save acceptance when the visitor clicks it
*/
document.addEventListener("click", function (event) {
const agreeButton = event.target.closest("#agree-button");
if (!agreeButton) {
return;
}
// Save acceptance permanently in this browser
localStorage.setItem(STORAGE_KEY, "true");
});
});