PageSourceSearch

https://aleksandrow-lodzki.pl/wp-content/themes/al/main.js

js aleksandrow-lodzki.pl collected 2026-10-02 18:55:14 UTC 4,218 bytes, 128 lines download raw bytes

1try {
2  var fontSize = parseInt(
3    document.querySelector("html").style.fontSize || 16,
4    10
5  );
6  function setFontSize(diff) {
7    fontSize += diff;
8    if (fontSize > 20) {
9      fontSize = 16;
10    }
11    document.querySelector("html").style.fontSize = fontSize + "px";
12    setCookie("fontSize", fontSize, 365 * 10);
13  }
14  document
15    .querySelector('[data-js="font-size-change"]')
16    .addEventListener("click", function () {
17      setFontSize(+2);
18    });
19} catch (e) {}
20
21try {
22  document
23    .querySelector('[data-js="a11y-contrast"]')
24    .addEventListener("click", function () {
25      var hasContrast = document.body.classList.contains("a11y_contrast");
26      if (hasContrast) {
27        eraseCookie("a11y_contrast");
28      } else {
29        setCookie("a11y_contrast", true, 365 * 10);
30      }
31      document.body.classList.toggle("a11y_contrast");
32    });
33} catch (e) {}
34
35function setCookie(name, value, days) {
36  var expires = "";
37  if (days) {
38    var date = new Date();
39    date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
40    expires = "; expires=" + date.toUTCString();
41  }
42  document.cookie = name + "=" + (value || "") + expires + "; path=/";
43}
44function getCookie(name) {
45  var nameEQ = name + "=";
46  var ca = document.cookie.split(";");
47  for (var i = 0; i < ca.length; i++) {
48    var c = ca[i];
49    while (c.charAt(0) == " ") c = c.substring(1, c.length);
50    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
51  }
52  return null;
53}
54function eraseCookie(name) {
55  document.cookie = name + "=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
56}
57
58jQuery(".carousel-container").each(function (it, el) {
59  var trigger = document.createElement("span");
60  trigger.className = "carousel-container__trigger";
61  trigger.addEventListener("click", function (element) {
62    var count = 12;
63    var show = 1;
64    if (window.document.body.clientWidth > 690) show = 2;
65    if (window.document.body.clientWidth > 850) show = 3;
66    if (window.document.body.clientWidth > 1280) show = 4;
67    var max = -1 * (count - show) * 18;
68    var track = element.currentTarget.parentNode;
69    var position = parseInt(track.getAttribute("position") || 0, 10);
70    position -= 19;
71    if (position < max) return;
72    track.querySelector(".container > .flex").style.transform =
73      "translateX(" + position + "em)";
74    track.setAttribute("position", position);
75  });
76
77  el.appendChild(trigger);
78
79  var triggerL = document.createElement("span");
80  triggerL.className =
81    "carousel-container__trigger carousel-container__trigger--left";
82  triggerL.addEventListener("click", function (element) {
83    var track = element.currentTarget.parentNode;
84    var position = parseInt(track.getAttribute("position") || 0, 10);
85    position += 19;
86    console.log(position);
87    if (position >= 0) position = 0;
88    track.querySelector(".container > .flex").style.transform =
89      "translateX(" + position + "em)";
90    track.setAttribute("position", position);
91  });
92
93  el.appendChild(triggerL);
94});
95
96jQuery(".js-menu__trigger").each(function (it, el) {
97  el.addEventListener("click", function () {
98    document.body.classList.toggle("menu-open");
99  });
100});
101
102var tiles = document.querySelectorAll('[data-js="tile-switch"]');
103if (tiles.length) {
104  tiles[0].classList.add("tile--switch--active");
105  tiles.forEach(function (el) {
106    el.addEventListener("mouseenter", function (event) {
107      var id = event.currentTarget.getAttribute("data-id");
108      var show = document.querySelector(
109        '[data-js="tile-preview"][data-id="' + id + '"]'
110      );
111      if (show) {
112        show.parentNode
113          .querySelectorAll('[data-js="tile-preview"]')
114          .forEach(function (item) {
115            item.classList.add("hidden");
116          });
117        show.classList.remove("hidden");
118
119        event.currentTarget.parentNode
120          .querySelectorAll('[data-js="tile-switch"]')
121          .forEach(function (item) {
122            item.classList.remove("tile--switch--active");
123          });
124        event.currentTarget.classList.add("tile--switch--active");
125      }
126    });
127  });
128}

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.