This commit is contained in:
cay 2026-04-10 11:48:24 +01:00
parent 6e844b86e9
commit c1c752874f

View File

@ -9,27 +9,21 @@ const tooltip = document.getElementById("map-tooltip");
const tooltipCache = {}; const tooltipCache = {};
/* ================================ /* ================================
Gaststätte Popup soll hier aufgehen Gaststätte Popup
================================ */ ================================ */
const gaststaettePopup = document.getElementById("gaststaette-popup"); const gaststaettePopup = document.getElementById("gaststaette-popup");
const qmOverlay = document.getElementById("qm-overlay"); const qmOverlay = document.getElementById("qm-overlay");
document.querySelectorAll(".gaststaette-tab").forEach((tab) => { document.querySelectorAll(".gaststaette-tab").forEach((tab) => {
tab.addEventListener("click", () => { tab.addEventListener("click", () => {
document document.querySelectorAll(".gaststaette-tab").forEach((t) => t.classList.remove("active"));
.querySelectorAll(".gaststaette-tab") document.querySelectorAll(".gaststaette-tab-content").forEach((c) => c.classList.remove("active"));
.forEach((t) => t.classList.remove("active"));
document
.querySelectorAll(".gaststaette-tab-content")
.forEach((c) => c.classList.remove("active"));
tab.classList.add("active"); tab.classList.add("active");
document.getElementById(tab.dataset.tab).classList.add("active"); document.getElementById(tab.dataset.tab).classList.add("active");
}); });
}); });
const tooltipCache = {};
// Tooltip verstecken wenn Maus über Quickmenu, Popup oder QM-Popups fährt // Tooltip verstecken wenn Maus über Quickmenu, Popup oder QM-Popups fährt
document document
.getElementById("quickmenu-panel") .getElementById("quickmenu-panel")
@ -183,7 +177,7 @@ document.querySelectorAll(".building").forEach((building) => {
// Gebäude 6 → Gaststätte eigenes Popup // Gebäude 6 → Gaststätte eigenes Popup
if (url === "/building/6") { if (url === "/building/6") {
gaststaettePopup.style.left = "50%"; gaststaettePopup.style.left = "50%";
gaststaettePopup.style.top = "50%"; gaststaettePopup.style.top = "50%";
gaststaettePopup.style.transform = "translate(-50%, -50%) scale(1)"; gaststaettePopup.style.transform = "translate(-50%, -50%) scale(1)";
gaststaettePopup.classList.add("active"); gaststaettePopup.classList.add("active");
qmOverlay.classList.add("active"); qmOverlay.classList.add("active");
@ -281,8 +275,7 @@ document.querySelectorAll(".building").forEach((building) => {
building.addEventListener("mouseenter", async (e) => { building.addEventListener("mouseenter", async (e) => {
try { try {
// data-id bevorzugen, sonst ID aus href extrahieren (z.B. "/building/5" → "5") // data-id bevorzugen, sonst ID aus href extrahieren (z.B. "/building/5" → "5")
const id = const id = building.dataset.id || building.getAttribute("href")?.split("/").pop();
building.dataset.id || building.getAttribute("href")?.split("/").pop();
if (!id) return; if (!id) return;
if (!tooltipCache[id]) { if (!tooltipCache[id]) {