2025-02-28 12:45:45 +01:00

38 lines
1.0 KiB
JavaScript

function SetWarning(){
const warningElements = document.querySelectorAll('[id^="warning-cookie-"]');
const warningMain = document.getElementById('warning-main');
warningElements.forEach(function(warningElement) {
if (document.cookie.includes(warningElement.id)) {
warningElement.style.display = 'flex';
warningMain.style.display = 'flex';
}
});
}
SetWarning()
let open = document.querySelectorAll(".open-modal-button");
const modal_container = document.getElementById("modal_container");
let close = document.querySelectorAll(".close-modal-button");
open.forEach((button) => {
button.addEventListener("click", () => {
modal_container.classList.add("show");
});
});
close.forEach((button) => {
button.addEventListener("click", () => {
modal_container.classList.remove("show");
});
});
const logsContainer = document.getElementById('tutor-logs');
const observer = new MutationObserver(() => {
logsContainer.scrollTop = logsContainer.scrollHeight;
});
observer.observe(logsContainer, { childList: true, subtree: true });