PageSourceSearch

https://new88-dangnhap.com/wp-content/themes/cafeandwifitheme/assets/js/main.js?ver=4.51

js new88-dangnhap.com collected 2026-10-09 23:05:12 UTC 9,931 bytes, 362 lines download raw bytes

1let flagNeedArrowTop = false;
2$(document).ready(function() {
3	$(window).on("scroll", function() {
4		if ($(document).scrollTop() >= 100) {
5			if (!flagNeedArrowTop) {
6				flagNeedArrowTop = true;
7				$("#goUp").stop().fadeIn();
8				$("#goUp").addClass("active");
9				$("#main-bar").addClass("active");
10			}
11		} else {
12			if (flagNeedArrowTop) {
13				flagNeedArrowTop = false;
14				$("#goUp").stop().fadeOut();
15				$("#goUp").removeClass("active");
16				$("#main-bar").removeClass("active");
17			}
18		}
19	});
20	$("#option-choice").on("click", function() {
21		$(this).parent(".languages").toggleClass("active");
22	});
23
24	$(document).click(function(e) {
25		if ($(e.target).closest("#option-choice").length || $(e.target).closest(".ml-auto").length) {
26			return;
27		}
28
29		if ($(e.target).closest(".overlap").length || $(e.target).closest("#hamburger").length) {
30			return;
31		}
32		$(".languages").removeClass("active");
33		$(".overlap").removeClass("open");
34		$('#best-toggle').removeClass('active open');
35	});
36
37	$(".toc-default").on("click", function() {
38		let dropSelect = $(this).parents(".drop");
39		let dropContent = $(this).next(".options-holder");
40		dropSelect.toggleClass("active");
41		if (dropSelect.hasClass("active")) {
42			dropContent.stop().slideDown();
43		} else {
44			dropContent.stop().slideUp();
45		}
46	});
47	
48	 $('.drop#openCont').each(function() {
49        const $drop = $(this);
50        $drop.addClass('active');
51        $drop.find('.options-holder').stop(true, true).slideDown(0);
52    });
53
54	$(".ancor").on("click", function (e) {
55  e.preventDefault();
56
57  var href = $(this).attr("href");
58  var headerH = $("#main-bar").outerHeight();
59  var extra = $(window).width() < 1023 ? 5 : 0;
60
61  var offsetTop = href === "#" ? 0 : $(href).offset().top - headerH - extra;
62
63  $("html, body").stop().animate({ scrollTop: offsetTop }, 400);
64});
65
66
67	$("#goUp").on("click", function() {
68		$("html, body").stop().animate({ scrollTop: 0 }, 500, "swing");
69	});
70
71const $header = $('#main-bar');
72  const $mainWrapper = $('#page-content-haeder');
73
74  function updatePadding() {
75    const headerHeight = $header.outerHeight();
76    $mainWrapper.css('padding-top', headerHeight + 'px');
77  }
78
79  updatePadding();
80
81  $(window).on('resize', function () {
82    updatePadding();
83  });
84
85	/*menu*/
86	$("#best-toggle").on("click", function() {
87		$(this).toggleClass("active open");
88		$("#hamburger").toggleClass("active open");
89		$(".overlap").toggleClass("open");
90		$("body").toggleClass("non-scroll");
91	});
92	$('#menu-main a').on("click", function() {
93		$(".overlap").removeClass("open");
94		$("#hamburger").removeClass("active open");
95		$('#best-toggle').removeClass('active open');
96		$("body").removeClass("non-scroll");
97	});
98	/*menu end*/
99
100
101$('[data-has-submenu="true"]').on("click", function(event) {
102    if (window.innerWidth <= 1023) {
103        $("#menu-main").toggleClass("active");
104        $(this).toggleClass("active");
105        
106        var $submenu = $(this).closest("[id='submenu-has']").find("[id='menu-div']").first();
107
108        $("#menu-main [id='submenu-has'] [id='menu-div']").not($submenu).slideUp();
109
110        $submenu.stop(true, true).slideToggle();
111    }
112});
113	
114	// блок с казино
115	const section = document.querySelector('#casinoSection1');
116
117if (section) {
118  const buttons = section.querySelectorAll('[id][data-tab]');
119  const grids = section.querySelectorAll('[id]');
120
121  buttons.forEach(btn => {
122    btn.addEventListener('click', () => {
123      const tabId = btn.getAttribute('data-tab');
124      if (!tabId) return;
125
126      const targetGrid = section.querySelector(`#${CSS.escape(tabId)}`);
127      if (!targetGrid) return;
128
129      buttons.forEach(b => b.classList.remove('active'));
130      grids.forEach(g => g.classList.remove('active'));
131
132      btn.classList.add('active');
133      targetGrid.classList.add('active');
134    });
135  });
136}
137
138
139	
140// (function ($) {
141//   const speed = 120; // px/s
142
143//   $('.mirrorMarquee').each(function () {
144//     const $root = $(this);
145//     const $viewport = $root.find('#marqueeViewp').first();
146//     const $track = $root.find('#marqueeTr').first();
147//     const $group = $root.find('#marqueeGr').first();
148
149//     if (!$viewport.length || !$track.length || !$group.length) return;
150
151//     let offset = 0;
152//     let lastTime = null;
153//     let baseWidth = 0;
154//     let lastViewportWidth = 0;
155//     let rafResize = null;
156
157//     function build() {
158//       $track.find('.marqueeGroup').not($group).remove();
159
160//       const $clone = $group.clone(true).removeAttr('id');
161//       $track.append($clone);
162
163//       baseWidth = $group.outerWidth(true) || 0;
164
165//       if (!baseWidth) {
166//         requestAnimationFrame(build);
167//         return;
168//       }
169
170//       lastViewportWidth = $viewport.outerWidth() || 0;
171
172//       offset = offset % baseWidth;
173//       $track.css('transform', `translateX(${offset}px)`);
174//     }
175
176//     requestAnimationFrame(build);
177//     $(window).on('load', build);
178//     $(window).on('orientationchange', build);
179
180//     $(window).on('resize', function () {
181//       if (rafResize) cancelAnimationFrame(rafResize);
182
183//       rafResize = requestAnimationFrame(function () {
184//         const w = $viewport.outerWidth() || 0;
185
186//         if (Math.abs(w - lastViewportWidth) >= 2) {
187//           build();
188//         }
189//       });
190//     });
191
192//     function animate(time) {
193//       if (!lastTime) lastTime = time;
194//       const delta = (time - lastTime) / 1000;
195//       lastTime = time;
196
197//       if (baseWidth) {
198//         offset -= speed * delta;
199
200//         if (offset <= -baseWidth) offset += baseWidth;
201
202//         $track.css('transform', `translateX(${offset}px)`);
203//       }
204
205//       requestAnimationFrame(animate);
206//     }
207
208//     requestAnimationFrame(animate);
209//   });
210// })(jQuery);
211
212
213// marquee
214(function () {
215  const speed = 120; // px/s
216
217  document.querySelectorAll('.mirrorMarquee').forEach(root => {
218    const viewport = root.querySelector('#marqueeViewp');
219    const track = root.querySelector('#marqueeTr');
220    const group = root.querySelector('#marqueeGr');
221
222    if (!viewport || !track || !group) return;
223
224    let offset = 0;
225    let lastTime = null;
226    let baseWidth = 0;
227    let lastViewportWidth = 0;
228    let rafResize = null;
229
230    const outerWidth = (el) => {
231      const style = getComputedStyle(el);
232      return el.offsetWidth
233        + (parseFloat(style.marginLeft) || 0)
234        + (parseFloat(style.marginRight) || 0);
235    };
236
237    function build() {
238      // удалить старые клоны
239      track.querySelectorAll('.marqueeClone').forEach(n => n.remove());
240
241      baseWidth = outerWidth(group) || 0;
242      if (!baseWidth) {
243        requestAnimationFrame(build);
244        return;
245      }
246
247      const viewportWidth = viewport.offsetWidth || 0;
248      lastViewportWidth = viewportWidth;
249
250      // добавляем клоны пока не перекроем viewport с запасом
251      let totalWidth = baseWidth;
252      while (totalWidth < viewportWidth + baseWidth) {
253        const clone = group.cloneNode(true);
254        clone.classList.add('marqueeClone');
255        clone.removeAttribute('id'); // чтобы не плодить одинаковые id
256        track.appendChild(clone);
257        totalWidth += baseWidth;
258      }
259
260      offset = offset % baseWidth;
261      track.style.transform = `translateX(${offset}px)`;
262    }
263
264    function animate(time) {
265      if (!lastTime) lastTime = time;
266      const delta = (time - lastTime) / 1000;
267      lastTime = time;
268
269      if (baseWidth) {
270        offset -= speed * delta;
271        if (offset <= -baseWidth) offset += baseWidth;
272
273        track.style.transform = `translateX(${offset}px)`;
274      }
275
276      requestAnimationFrame(animate);
277    }
278
279    // первый запуск (и после загрузки всего, включая картинки)
280    requestAnimationFrame(build);
281    window.addEventListener('load', build);
282    window.addEventListener('orientationchange', build);
283
284    window.addEventListener('resize', () => {
285      if (rafResize) cancelAnimationFrame(rafResize);
286
287      rafResize = requestAnimationFrame(() => {
288        const w = viewport.offsetWidth || 0;
289        if (Math.abs(w - lastViewportWidth) >= 2) build();
290      });
291    });
292
293    requestAnimationFrame(animate);
294  });
295})();
296
297
298/*Swiper Slider START*/
299const swiper = new Swiper('.swiper', {
300	loop: true,
301	speed: 500,
302	slidesPerView: 1,
303	spaceBetween: 20,
304	pagination: {
305		el: '.swiper-pagination',
306	},
307	navigation: {
308		nextEl: '.swiper-button-next',
309		prevEl: '.swiper-button-prev',
310	},
311});
312	
313/*Swiper Slider END*/
314	
315	
316	
317document.querySelectorAll('#homeAppPromoCopy').forEach((btn) => {
318  btn.addEventListener('click', async () => {
319    const targetId = btn.getAttribute('data-copy-target');
320    const target = targetId ? document.getElementById(targetId) : null;
321    if (!target) return;
322
323    const textToCopy = (target.textContent || '').trim();
324    if (!textToCopy) return;
325
326    const setCopiedState = () => {
327      const originalHtml = btn.dataset.originalHtml || btn.innerHTML;
328      const copiedText = btn.getAttribute('data-copy-success-text') || 'Скопировано';
329
330      btn.dataset.originalHtml = originalHtml;
331      btn.textContent = copiedText;
332
333      setTimeout(() => {
334        btn.innerHTML = originalHtml;
335      }, 1200);
336    };
337
338    try {
339      if (navigator.clipboard && window.isSecureContext) {
340        await navigator.clipboard.writeText(textToCopy);
341        setCopiedState();
342        return;
343      }
344
345      const textarea = document.createElement('textarea');
346      textarea.value = textToCopy;
347      textarea.setAttribute('readonly', '');
348      textarea.style.position = 'absolute';
349      textarea.style.left = '-9999px';
350      document.body.appendChild(textarea);
351      textarea.select();
352      document.execCommand('copy');
353      document.body.removeChild(textarea);
354      setCopiedState();
355    } catch (error) {
356      console.error('Copy failed:', error);
357    }
358  });
359});
360	
361
362});

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.