rumine-web/static/js/scripts.js

28 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

document.addEventListener("DOMContentLoaded", function() {
// Проверяем, приняли ли пользователи куки
var cookiesAccepted = getCookie("cookies_accepted");
// Если куки не приняты, показываем div с сообщением о куки
if (!cookiesAccepted) {
var cookieAlert = document.getElementById("icms-cookiealert");
if (cookieAlert) {
cookieAlert.style.display = "block";
}
}
});
// Функция для получения значения куки по имени
function getCookie(name) {
var cookieValue = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)');
return cookieValue ? cookieValue.pop() : '';
}
document.addEventListener("DOMContentLoaded", function() {
var navbarToggler = document.querySelector('.navbar-toggler');
var targetMain = document.querySelector('#target-main');
navbarToggler.addEventListener('click', function() {
targetMain.classList.toggle('show');
});
});