PageSourceSearch

https://www.neidenbach.de/media/templates/site/cassiopeia_neidenbach/js/user.js?0da107

js neidenbach.de collected 2026-09-25 10:00:13 UTC 1,875 bytes, 77 lines download raw bytes

1(function () {
2  function ready(fn) {
3    if (document.readyState === 'loading') {
4      document.addEventListener('DOMContentLoaded', fn, { once: true });
5    } else {
6      fn();
7    }
8  }
9
10  ready(function () {
11    const body = document.body;
12
13    // Header finden (Cassiopeia Extended Varianten)
14    const candidates = [
15      'header.container-header',
16      '.container-header',
17      'header.site-header',
18      '.site-header',
19      '#header'
20    ];
21    let header = null;
22    for (const sel of candidates) {
23      const el = document.querySelector(sel);
24      if (el) { header = el; break; }
25    }
26
27    // Hysterese-Schwellen (px)
28    const ENTER = 200; // einschalten
29    const EXIT  = 40; // ausschalten
30    let shrink = false;
31
32    function setShrink(on) {
33      if (on === shrink) return;
34      shrink = on;
35      body.classList.toggle('header--shrink', shrink);
36    }
37
38    function atTop() {
39      return (window.scrollY || window.pageYOffset || 0) <= 1;
40    }
41
42    function computeShrink() {
43      // ganz oben niemals schrumpfen
44      if (atTop()) return false;
45
46      const y = window.scrollY || 0;
47      if (header) {
48        const stickyTouch = header.getBoundingClientRect().top <= 0;
49        if (!shrink) return stickyTouch && y > ENTER;
50        return stickyTouch && y > EXIT;
51      }
52      // Fallback ohne Header-Referenz
53      return (!shrink && y > ENTER) || (shrink && y > EXIT);
54    }
55
56    function onScroll() {
57      setShrink(computeShrink());
58    }
59
60    // Initial sauber starten
61    setShrink(false);
62    onScroll();
63
64    let ticking = false;
65    window.addEventListener('scroll', function () {
66      if (!ticking) {
67        requestAnimationFrame(function () {
68          onScroll();
69          ticking = false;
70        });
71        ticking = true;
72      }
73    }, { passive: true });
74
75    window.addEventListener('resize', onScroll);
76  });
77})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.