diff --git a/views/assets/scripts.js b/views/assets/scripts.js index 703dcbf..94333b5 100644 --- a/views/assets/scripts.js +++ b/views/assets/scripts.js @@ -1,4 +1,4 @@ -class I extends HTMLElement { +class H extends HTMLElement { constructor() { super(), this.scrollHandler = null, this.scrollTimeout = null, this.clickHandlers = [], this.manualNavigation = !1; } @@ -42,9 +42,9 @@ class I extends HTMLElement { const e = document.getElementById("scrollspy-slider"), t = document.getElementById("scrollspy-nav"); if (!e || !t || e.style.opacity === "0") return; - const i = t.getBoundingClientRect(), n = parseFloat(e.style.top), o = parseFloat(e.style.height), r = n + o, a = t.scrollTop, l = a + i.height; - if (r > l) { - const c = r - i.height + 20; + const i = t.getBoundingClientRect(), n = parseFloat(e.style.top), o = parseFloat(e.style.height), s = n + o, a = t.scrollTop, l = a + i.height; + if (s > l) { + const c = s - i.height + 20; t.scrollTo({ top: c, behavior: "smooth" @@ -64,21 +64,21 @@ class I extends HTMLElement { try { this.sections.forEach((n) => { if (!n || !n.getAttribute) return; - const o = n.getAttribute("id"), r = n.querySelector(".akteur-werke-section"), a = n.querySelector(".akteur-beitraege-section"); + const o = n.getAttribute("id"), s = n.querySelector(".akteur-werke-section"), a = n.querySelector(".akteur-beitraege-section"); let l = !1; - if (r) { - const c = r.getBoundingClientRect(), d = c.top < window.innerHeight, u = c.bottom > 0; - d && u && (l = !0); + if (s) { + const c = s.getBoundingClientRect(), d = c.top < window.innerHeight, g = c.bottom > 0; + d && g && (l = !0); } if (a && !l) { - const c = a.getBoundingClientRect(), d = c.top < window.innerHeight, u = c.bottom > 0; - d && u && (l = !0); + const c = a.getBoundingClientRect(), d = c.top < window.innerHeight, g = c.bottom > 0; + d && g && (l = !0); } - if (!r && !a) { + if (!s && !a) { const c = n.querySelector("div:first-child"); if (c) { - const d = c.getBoundingClientRect(), u = d.top >= 0, g = d.bottom <= window.innerHeight; - u && g && (l = !0); + const d = c.getBoundingClientRect(), g = d.top >= 0, u = d.bottom <= window.innerHeight; + g && u && (l = !0); } } l && e.push(o); @@ -93,13 +93,13 @@ class I extends HTMLElement { e.includes(o) && (n.classList.add("font-medium"), t.push(n)); }), t.length > 0 && i) { const n = document.getElementById("scrollspy-nav"), o = n.getBoundingClientRect(); - let r = 1 / 0, a = -1 / 0; + let s = 1 / 0, a = -1 / 0; t.forEach((c) => { - const d = c.getBoundingClientRect(), u = d.top - o.top + n.scrollTop, g = u + d.height; - r = Math.min(r, u), a = Math.max(a, g); + const d = c.getBoundingClientRect(), g = d.top - o.top + n.scrollTop, u = g + d.height; + s = Math.min(s, g), a = Math.max(a, u); }); - let l = a - r; - i.style.top = `${r}px`, i.style.height = `${l}px`, i.style.opacity = "1", setTimeout(() => this.ensureMarkerVisibility(), 100); + let l = a - s; + i.style.top = `${s}px`, i.style.height = `${l}px`, i.style.opacity = "1", setTimeout(() => this.ensureMarkerVisibility(), 100); } else i && (i.style.opacity = "0"); t.length > 0 && this.updateSidebarScroll(t); } @@ -117,8 +117,8 @@ class I extends HTMLElement { if (i && (i.classList.add("font-medium"), t)) { const n = document.getElementById("scrollspy-nav"); if (n) { - const o = n.getBoundingClientRect(), r = i.getBoundingClientRect(), a = r.top - o.top + n.scrollTop; - t.style.top = `${a}px`, t.style.height = `${r.height}px`, t.style.opacity = "1"; + const o = n.getBoundingClientRect(), s = i.getBoundingClientRect(), a = s.top - o.top + n.scrollTop; + t.style.top = `${a}px`, t.style.height = `${s.height}px`, t.style.opacity = "1"; } } } @@ -132,9 +132,9 @@ class I extends HTMLElement { document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight - ), o = window.innerHeight, r = n - o, a = r > 0 ? window.scrollY / r : 0, l = t.clientHeight, d = t.scrollHeight - l; + ), o = window.innerHeight, s = n - o, a = s > 0 ? window.scrollY / s : 0, l = t.clientHeight, d = t.scrollHeight - l; if (d > 0) { - const u = a * d, g = i.getBoundingClientRect(), p = t.getBoundingClientRect(), f = g.top - p.top + t.scrollTop, m = l / 2, E = f - m, y = 0.7, H = y * u + (1 - y) * E, x = Math.max(0, Math.min(d, H)), T = t.scrollTop; + const g = a * d, u = i.getBoundingClientRect(), p = t.getBoundingClientRect(), f = u.top - p.top + t.scrollTop, m = l / 2, L = f - m, y = 0.7, I = y * g + (1 - y) * L, x = Math.max(0, Math.min(d, I)), T = t.scrollTop; Math.abs(x - T) > 10 && t.scrollTo({ top: x, behavior: "smooth" @@ -155,10 +155,10 @@ class I extends HTMLElement { e && (e.style.opacity = "0", e.style.height = "0"), this.sections = null, this.navLinks = null, this.clickHandlers = [], this.manualNavigation = !1; } } -customElements.define("akteure-scrollspy", I); -class B extends HTMLElement { +customElements.define("akteure-scrollspy", H); +class A extends HTMLElement { constructor() { - super(), this.resizeObserver = null, this.zoomLevel = 1, this.minZoom = 1, this.maxZoom = 4, this.panX = 0, this.panY = 0, this.isDragging = !1, this.lastMouseX = 0, this.lastMouseY = 0, this.clickStartTime = null, this.clickStartX = null, this.clickStartY = null; + super(), this.resizeObserver = null; } // Dynamically detect sidebar width in pixels detectSidebarWidth() { @@ -223,23 +223,6 @@ class B extends HTMLElement {
- -
- Strg + Mausrad oder +/- für Zoom -
- - - - - -
- - - -
-