PageSourceSearch

https://radio-mystic-energy.com/themes/MysticEnergy/assets/js/hero-script-01.js?v=2

js radio-mystic-energy.com collected 2026-10-08 06:44:50 UTC 3,886 bytes, 99 lines download raw bytes

1// ===== NIVO SLIDER =====
2(function(){
3  var idx = 0, timer = null, delay = (typeof meNivoDelay !== 'undefined' && meNivoDelay > 0) ? meNivoDelay : 5000;
4  var slider, imgs, dots;
5
6  function init() {
7    slider = document.getElementById('me-nivo-slider');
8    if (!slider) return;
9    imgs = slider.querySelectorAll('img');
10    if (!imgs.length) return;
11
12    // Kompakte Slider-Höhe wie im bisherigen Theme beibehalten.
13    // Das Bild-Seitenverhältnis darf die Höhe nicht automatisch vergrößern.
14    slider.style.height = '0';
15
16    // Dots erstellen
17    var dotsEl = document.getElementById('me-nivo-dots');
18    if (dotsEl) {
19      for (var i = 0; i < imgs.length; i++) {
20        var dot = document.createElement('button');
21        dot.className = 'me-nivo-dot' + (i === 0 ? ' active' : '');
22        dot.setAttribute('aria-label', 'Slide ' + (i+1));
23        dot.onclick = (function(n){ return function(){ goto(n); }; })(i);
24        dotsEl.appendChild(dot);
25      }
26    }
27
28    // Klick auf Bild → Link öffnen
29    slider.addEventListener('click', function(e) {
30      var img = imgs[idx];
31      var href = img.getAttribute('data-href');
32      if (href) window.location.href = href;
33    });
34
35    // Touch-Swipe
36    var tx = 0;
37    slider.addEventListener('touchstart', function(e){ tx = e.touches[0].clientX; }, {passive:true});
38    slider.addEventListener('touchend', function(e){
39      var dx = e.changedTouches[0].clientX - tx;
40      if (Math.abs(dx) > 40) { if (dx < 0) next(); else prev(); }
41    }, {passive:true});
42
43    // Kursor bei verlinkten Slides
44    imgs[idx].addEventListener('load', updateCursor);
45    updateCursor();
46
47    imgs[0].classList.add('me-nivo-active');
48    timer = setInterval(next, delay);
49  }
50
51  function updateCursor() {
52    var href = imgs[idx] && imgs[idx].getAttribute('data-href');
53    slider.style.cursor = href ? 'pointer' : 'default';
54  }
55
56  function goto(n) {
57    if (!imgs || !imgs.length) return;
58    imgs[idx].classList.remove('me-nivo-active');
59    idx = ((n % imgs.length) + imgs.length) % imgs.length;
60    imgs[idx].classList.add('me-nivo-active');
61    var allDots = document.querySelectorAll('.me-nivo-dot');
62    allDots.forEach(function(d, i){ d.classList.toggle('active', i === idx); });
63    updateCursor();
64    clearInterval(timer);
65    timer = setInterval(next, delay);
66  }
67
68  function next() { goto(idx + 1); }
69  function prev() { goto(idx - 1); }
70
71  // Global verfügbar machen für onclick-Buttons
72  window.meNivoNext = next;
73  window.meNivoPrev = prev;
74  window.meNivoInit = init;
75})();
76
77/* ===== Mein Bereich: Seiten-Slider ===== */
78(function(){
79  function drawer(){ return document.getElementById('me-account-drawer'); }
80  function backdrop(){ return document.getElementById('me-account-backdrop'); }
81  window.meAccountOpen=function(){
82    var d=drawer(), b=backdrop(); if(!d) return;
83    d.classList.add('open'); if(b)b.classList.add('open');
84    d.setAttribute('aria-hidden','false'); document.body.classList.add('me-account-drawer-open');
85    var launch=document.querySelector('.me-account-launch'); if(launch)launch.setAttribute('aria-expanded','true');
86  };
87  window.meAccountClose=function(){
88    var d=drawer(), b=backdrop(); if(!d) return;
89    d.classList.remove('open'); if(b)b.classList.remove('open');
90    d.setAttribute('aria-hidden','true'); document.body.classList.remove('me-account-drawer-open');
91    var launch=document.querySelector('.me-account-launch'); if(launch)launch.setAttribute('aria-expanded','false');
92  };
93  document.addEventListener('DOMContentLoaded',function(){
94    var source=document.querySelector('.me-section-login > .me-account-drawer-content');
95    var target=document.getElementById('me-account-drawer-body');
96    if(source&&target) target.appendChild(source.cloneNode(true));
97  });
98  document.addEventListener('keydown',function(e){if(e.key==='Escape')window.meAccountClose();});
99})();

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.