PageSourceSearch

https://sankracasinogr.com/assets/js/script.js?v=2.0

js sankracasinogr.com collected 2026-10-06 20:28:03 UTC 6,893 bytes, 198 lines download raw bytes

1window.addEventListener("DOMContentLoaded", () => {
2  (function () {
3    "use strict";
4    var mb = document.getElementById("mobileMenuBtn"),
5      m = document.getElementById("mobileMenu"),
6      mc = document.getElementById("mobileMenuClose");
7    var backdrop = document.createElement("div");
8    backdrop.className = "offcanvas-backdrop";
9    document.body.appendChild(backdrop);
10    function openMenu() {
11      m.classList.add("show");
12      backdrop.classList.add("show");
13      document.body.style.overflow = "hidden";
14    }
15    function closeMenu() {
16      m.classList.remove("show");
17      backdrop.classList.remove("show");
18      document.body.style.overflow = "";
19    }
20    if (mb && m) {
21      mb.addEventListener("click", function (e) {
22        e.stopPropagation();
23        openMenu();
24      });
25      mc.addEventListener("click", closeMenu);
26      backdrop.addEventListener("click", closeMenu);
27      m.querySelectorAll("a").forEach(function (link) {
28        link.addEventListener("click", closeMenu);
29      });
30    }
31    document.querySelectorAll(".content-block table").forEach(function (t) {
32      var cols = t.querySelectorAll("thead tr:first-child th").length || t.querySelectorAll("tr:first-child td, tr:first-child th").length;
33      if (cols > 0) t.style.gridTemplateColumns = "repeat(" + cols + ", auto)";
34    });
35    window.toggleGroup = function (h) {
36      h.classList.toggle("active");
37      var body = h.nextElementSibling;
38      body.classList.toggle("show");
39    };
40    window.toggleMore = function (btn, id) {
41      var el = document.getElementById(id);
42      if (!el) return;
43      el.classList.toggle("show");
44      var isOpen = el.classList.contains("show");
45      btn.innerHTML =
46        (isOpen ? "Απόκρυψη" : "Εμφάνιση") +
47        ' <span class="arrow" style="display:inline-block;' +
48        (isOpen ? "transform:rotate(180deg);" : "") +
49        '">▼</span>';
50    };
51    var al = document.querySelectorAll(".toc_navigation .item a"),
52      pb = document.getElementById("scrollProgress"),
53      ss = document.querySelectorAll("section[id]");
54    function upd() {
55      var st = window.pageYOffset || document.documentElement.scrollTop,
56        dh = document.documentElement.scrollHeight - window.innerHeight;
57      if (pb && dh > 0) pb.style.width = Math.min((st / dh) * 100, 100) + "%";
58      var ci = "";
59      for (var i = 0; i < ss.length; i++) if (ss[i].offsetTop - 200 <= st) ci = ss[i].id;
60      for (var j = 0; j < al.length; j++) {
61        al[j].classList.remove("active");
62        if (al[j].getAttribute("href") === "#" + ci) al[j].classList.add("active");
63      }
64    }
65    var t = false;
66    window.addEventListener(
67      "scroll",
68      function () {
69        if (!t) {
70          window.requestAnimationFrame(function () {
71            upd();
72            t = false;
73          });
74          t = true;
75        }
76      },
77      { passive: true },
78    );
79    upd();
80
81    var track = document.getElementById("phoneTrack");
82    var dotsC = document.getElementById("phoneDots");
83    if (track && dotsC) {
84      var slides = track.querySelectorAll(".phone-slide");
85      var perView = function () {
86        if (window.innerWidth <= 575) return 1;
87        if (window.innerWidth <= 991) return 2;
88        return 3;
89      };
90      var totalPages = function () {
91        return Math.ceil(slides.length / perView());
92      };
93      var currentPage = 0;
94
95      function buildDots() {
96        dotsC.innerHTML = "";
97        var tp = totalPages();
98        for (var d = 0; d < tp; d++) {
99          var dot = document.createElement("button");
100          dot.className = "phone-dot" + (d === currentPage ? " active" : "");
101          dot.setAttribute("data-page", d);
102          dot.addEventListener("click", function () {
103            currentPage = parseInt(this.getAttribute("data-page"));
104            goTo(currentPage);
105          });
106          dotsC.appendChild(dot);
107        }
108      }
109
110      function goTo(page) {
111        currentPage = page;
112        var slideW = slides[0].offsetWidth + 14;
113        track.style.transform = "translateX(-" + page * perView() * slideW + "px)";
114        dotsC.querySelectorAll(".phone-dot").forEach(function (d, i) {
115          d.classList.toggle("active", i === page);
116        });
117      }
118
119      buildDots();
120      window.addEventListener("resize", function () {
121        buildDots();
122        goTo(0);
123      });
124    }
125  })();
126  document.querySelectorAll('a[href^="#"]').forEach(function(link) {
127    link.addEventListener('click', function(e) {
128        if (this.hasAttribute('data-link')) return;
129        e.preventDefault();
130        var target = document.querySelector(this.getAttribute('href'));
131        if (target) {
132            target.scrollIntoView({ behavior: 'smooth' });
133        }
134    });
135});
136
137  // Партнерські редиректи через data-link (не краулиться роботами)
138  document.querySelectorAll('[data-link]').forEach(function(el) {
139    el.style.cursor = 'pointer';
140    el.addEventListener('click', function(e) {
141      e.preventDefault();
142      var dest = this.getAttribute('data-link');
143      if (dest) window.location.href = dest;
144    });
145  });
146
147  // FAQ accordion: авто-перетворення <p><strong>Питання</strong></p><p>Відповідь</p>
148  // на розгортні блоки, однаково на всіх сторінках.
149  document.querySelectorAll(".content-block h2").forEach(function (heading) {
150    if (heading.textContent.indexOf("Συχνές") === -1) return;
151
152    var pairs = [];
153    var node = heading.nextElementSibling;
154    while (node) {
155      var isQuestion =
156        node.tagName === "P" &&
157        node.children.length === 1 &&
158        node.children[0].tagName === "STRONG";
159      if (!isQuestion) break;
160      var answer = node.nextElementSibling;
161      if (!answer || answer.tagName !== "P") break;
162      pairs.push({ q: node, a: answer });
163      node = answer.nextElementSibling;
164    }
165    if (!pairs.length) return;
166
167    var list = document.createElement("div");
168    list.className = "faq-list";
169
170    pairs.forEach(function (pair) {
171      var item = document.createElement("div");
172      item.className = "faq-item";
173
174      var question = document.createElement("div");
175      question.className = "faq-question";
176      question.innerHTML =
177        "<span>" + pair.q.textContent + "</span><span class=\"faq-arrow\">▼</span>";
178
179      var answerBody = document.createElement("div");
180      answerBody.className = "faq-answer";
181      answerBody.appendChild(pair.a);
182
183      question.addEventListener("click", function () {
184        question.classList.toggle("active");
185        answerBody.classList.toggle("show");
186      });
187
188      item.appendChild(question);
189      item.appendChild(answerBody);
190      list.appendChild(item);
191
192      pair.q.remove();
193    });
194
195    heading.insertAdjacentElement("afterend", list);
196  });
197
198});

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.