PageSourceSearch

https://mafclub.biz/js/dates.js

js mafclub.biz collected 2026-10-07 15:39:30 UTC 2,386 bytes, 51 lines download raw bytes

1// ЕДИНЫЙ ИСТОЧНИК ДАТ ИГР.
2// Правишь только этот список — меняется и на сайте (герой, расписание, цена),
3// и в форме регистрации (выбор дня). Прошедшие игры отпадают сами.
4window.MAFCLUB_GAMES = [
5  { date: "2026-08-08", label: "8 августа (Сб)" },
6  { date: "2026-08-22", label: "22 августа (Сб)" },
7  { date: "2026-09-12", label: "12 сентября (Сб)" },
8  { date: "2026-09-26", label: "26 сентября (Сб)" },
9  { date: "2026-10-10", label: "10 октября (Сб)" },
10  { date: "2026-10-24", label: "24 октября (Сб)" }
11];
12window.MAFCLUB_TIME = "12:00–18:30";
13window.MAFCLUB_METRO = "м. Улица 1905 года";
14
15// Ближайшие игры (сегодня и позже). Если все прошли — вернём полный список (fallback).
16window.mafcUpcoming = function () {
17  var t = new Date(); t.setHours(0, 0, 0, 0);
18  var up = (window.MAFCLUB_GAMES || []).filter(function (g) {
19    return new Date(g.date + "T00:00:00") >= t;
20  });
21  return up.length ? up : (window.MAFCLUB_GAMES || []);
22};
23
24// Отрисовка сайта из источника: герой, карточка цены, плитки расписания.
25window.mafcRenderSite = function () {
26  var games = window.mafcUpcoming();
27  if (!games.length) return;
28  var next = games[0];
29
30  // 1) дата в герое
31  var hd = document.getElementById("mfc-hero-date");
32  if (hd) hd.textContent = "Ближайшая — " + next.label + " · " + window.MAFCLUB_TIME + " · " + window.MAFCLUB_METRO + ".";
33
34  // 2) дата в карточке цены
35  var pd = document.getElementById("mfc-price-date");
36  if (pd) pd.textContent = next.label;
37
38  // 3) плитки расписания
39  var box = document.querySelector(".mfc-sched__dates");
40  if (box) {
41    box.innerHTML = games.map(function (g, i) {
42      var cls = "mfc-sched__pill" + (i === 0 ? " mfc-sched__pill--next" : "");
43      var note = i === 0 ? " <span>(ближайшая)</span>" : "";
44      return '<span class="' + cls + '">' + g.label.replace(/ \((Сб)\)/, ' <span>($1)</span>') + note + "</span>";
45    }).join("");
46  }
47};
48
49document.addEventListener("DOMContentLoaded", function () {
50  try { window.mafcRenderSite(); } catch (e) {}
51});

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.