2024-03-17 18:37:15 +01:00
|
|
|
function setCookie(name, value, days) {
|
|
|
|
var expires = "";
|
|
|
|
if (days) {
|
|
|
|
var date = new Date();
|
|
|
|
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
|
|
expires = "; expires=" + date.toUTCString();
|
|
|
|
}
|
|
|
|
document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Функция, которая проверяет, установлен ли куки
|
|
|
|
function getCookie(name) {
|
|
|
|
var nameEQ = name + "=";
|
|
|
|
var ca = document.cookie.split(';');
|
|
|
|
for (var i = 0; i < ca.length; i++) {
|
|
|
|
var c = ca[i];
|
|
|
|
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
|
|
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Проверяем, установлен ли куки при загрузке страницы
|
|
|
|
window.onload = function () {
|
|
|
|
var cookieAccepted = getCookie("cookies_accepted");
|
|
|
|
if (!cookieAccepted) {
|
|
|
|
document.getElementById("icms-cookiealert").style.display = "block";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Обработчик нажатия на кнопку "Согласен"
|
|
|
|
document.getElementById("accept-cookies-btn").addEventListener("click", function () {
|
|
|
|
setCookie("cookies_accepted", true, 365); // Устанавливаем куки на год
|
|
|
|
document.getElementById("icms-cookiealert").style.display = "none"; // Скрываем cookie alert
|
2024-03-17 21:49:40 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
|
|
var navbarToggler = document.querySelector('.navbar-toggler');
|
|
|
|
var targetMain = document.querySelector('#target-main');
|
|
|
|
|
|
|
|
navbarToggler.addEventListener('click', function() {
|
|
|
|
targetMain.classList.toggle('show');
|
|
|
|
});
|
2024-03-17 18:37:15 +01:00
|
|
|
});
|