2024-06-09 08:04:37 +03:00
|
|
|
import Cookies from "js-cookie";
|
2024-06-09 08:14:56 +03:00
|
|
|
import { el } from "./utils.js";
|
2024-06-09 08:04:37 +03:00
|
|
|
|
|
|
|
const HIDE_INFO_POPUP = "hideInfoPopup";
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
2024-06-09 08:14:56 +03:00
|
|
|
const infoPopup = document.querySelector(".info-popup");
|
|
|
|
const noShowCheckbox = document.querySelector('input[name="no-show"]');
|
|
|
|
const confirmButton = document.querySelector(".info-popup footer button");
|
|
|
|
const map = el("map");
|
2024-06-09 08:04:37 +03:00
|
|
|
|
2024-06-09 08:14:56 +03:00
|
|
|
const hidePopupCookie = Cookies.get(HIDE_INFO_POPUP);
|
|
|
|
if (!hidePopupCookie) {
|
|
|
|
infoPopup.style.display = "block";
|
|
|
|
map.style.display = "none";
|
|
|
|
}
|
2024-06-09 08:04:37 +03:00
|
|
|
|
2024-06-09 08:14:56 +03:00
|
|
|
confirmButton.addEventListener("click", function () {
|
|
|
|
if (noShowCheckbox.checked) {
|
|
|
|
Cookies.set(HIDE_INFO_POPUP, "true", { expires: 400 });
|
|
|
|
}
|
2024-06-09 08:04:37 +03:00
|
|
|
|
2024-06-09 08:14:56 +03:00
|
|
|
infoPopup.style.display = "none";
|
|
|
|
map.style.display = "block";
|
|
|
|
});
|
2024-06-09 08:04:37 +03:00
|
|
|
});
|