PageSourceSearch

https://olimp40-casino.com/wp-content/themes/olimp40-casinotheme/assets/js/main.js?ver=0.2193

js olimp40-casino.com collected 2026-10-07 19:49:34 UTC 7,242 bytes, 286 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) {
26			return;
27		}
28		if ($(e.target).closest(".ml-auto ").length) {
29			return;
30		}
31		$(".languages").removeClass("active");
32		$(".overlap").removeClass("open");
33		$('#menu-toggle').removeClass('active open');
34
35		e.stopPropagation();
36	});
37
38	// Кнопка "Скопировать"
39  $("#duplicate-action").on("click", function () {
40    let copyText = $(this).data("copy");
41    var inputElement = $("<input>").val(copyText);
42    $("body").append(inputElement);
43    inputElement.select();
44    inputElement[0].setSelectionRange(0, 99999);
45    document.execCommand("copy");
46    inputElement.remove();
47
48    $(this).css("background-color", "#28a745"); // зелёный
49  });
50
51	$(".drop").on("click", function() {
52	// Получаем текущий блок
53	let dropSelect = $(this);
54	let dropContent = dropSelect.find(".options-holder");
55	dropSelect.toggleClass("active");
56
57	if (dropSelect.hasClass("active")) {
58		dropContent.stop().slideDown();
59	} else {
60		dropContent.stop().slideUp();
61	}
62});
63
64
65	$(".ancor").on("click", function(e) {
66		e.preventDefault()
67		var href = $(this).attr("href");
68		var offsetTop = href === "#" ? 0 : $(href).offset().top - $("#main-bar").height() + 1;
69		$("html, body").stop().animate({
70			scrollTop: offsetTop
71		}, 400);
72	});
73
74	$("#goUp").on("click", function() {
75		$("html, body").stop().animate({ scrollTop: 0 }, 500, "swing");
76	});
77
78	/*Menu*/
79$("#menu-toggle").on("click", function () {
80  $("#hamburger").toggleClass("active open");
81  $(".overlap").toggleClass("open");
82
83  if ($(".overlap").hasClass("open")) {
84    $("body").addClass("non-scroll");
85  } else {
86    $("body").removeClass("non-scroll");
87  }
88});
89/*Menu end*/
90
91
92
93	$('.menu-item').each(function() {
94  const $item = $(this);
95  const $subMenu = $item.find('.sub-menu');
96
97  if ($subMenu.length) {
98    $item.addClass('has-submenu');
99
100    if ($item.find('.arrow').length === 0) {
101      $item.append('<span class="arrow"></span>');
102    }
103
104    $item.find('.arrow').on('click', function(e) {
105      e.preventDefault();
106      e.stopPropagation();
107      $item.toggleClass('open');
108    });
109  }
110});
111
112
113	$('a.ancor').on('click', function(e) {
114    e.preventDefault();
115
116    var targetId = $(this).attr('href').slice(1); // Получаем ID цели
117    var targetElement = $('#' + targetId);
118
119    if (targetElement.length) {
120      var headerHeight = $(window).width() <= 1023 ? 53 : 80; // Определяем высоту хедера
121      var elementPosition = targetElement.offset().top; // Позиция элемента относительно страницы
122      var offsetPosition = elementPosition - headerHeight;
123
124      $('html, body').animate({
125        scrollTop: offsetPosition
126      }, 600); // 600 - время анимации
127    }
128  });
129
130
131
132
133function toggleFooterOverlap() {
134	const $footer = $('footer');
135	const $gohome = $('.gohome');
136	const $arrowTop = $('.arrow-top');
137
138	if ($footer.length === 0 || $gohome.length === 0 || $arrowTop.length === 0) return;
139
140	const footerTop = $footer.offset().top;
141	const windowBottom = $(window).scrollTop() + $(window).height();
142
143	if (windowBottom > footerTop) {
144		$gohome.css({ opacity: 0, 'pointer-events': 'none' });
145		$arrowTop.css({ opacity: 0, 'pointer-events': 'none' });
146	} else {
147		$gohome.css({ opacity: 1, 'pointer-events': 'auto' });
148		$arrowTop.css({ opacity: 1, 'pointer-events': 'auto' });
149	}
150}
151
152$(window).on('scroll resize', toggleFooterOverlap);
153toggleFooterOverlap();
154
155
156
157
158if (window.innerWidth <= 1023) {
159  $(".menu-item.has-submenu").each(function () {
160    const $item = $(this);
161    const $link = $item.children("a"); // прямо ссылка
162    const $subMenu = $item.children(".sub-menu"); // прямо сабменю
163
164    $subMenu.hide();
165
166    $link.on("click", function (e) {
167      e.preventDefault();
168
169      $item.toggleClass("open");
170      $subMenu.stop(true, true).slideToggle(200);
171    });
172  });
173}
174
175
176const $depositInput = $("#price-field1");
177const $resultBox = $("#quantity");
178
179function calculateBonus() {
180  const deposit = parseFloat($depositInput.val());
181
182  if (!isNaN(deposit)) {
183    const result = deposit * 2;
184    $resultBox.text(result.toFixed(2) + " $");
185  } else {
186    $resultBox.text("0 $");
187  }
188}
189
190$depositInput.on("input", calculateBonus);
191
192
193	
194	
195	 $(function () {
196    $('#price-field1, #price-field2')
197      .on('keypress', function (e) {
198        // Только цифры (коды клавиш 48-57)
199        var charCode = e.which;
200        if (charCode < 48 || charCode > 57) {
201          e.preventDefault();
202        }
203      })
204      .on('input', function () {
205        // Удаляем всё, кроме цифр
206        var cleanValue = $(this).val().replace(/\D/g, '');
207        $(this).val(cleanValue);
208      })
209      .on('paste', function (e) {
210        // Разрешаем вставку только цифр
211        var pastedData = (e.originalEvent || e).clipboardData.getData('text');
212        if (!/^\d+$/.test(pastedData)) {
213          e.preventDefault();
214        }
215      });
216  });
217	
218	if ($('.languages ul li').length === 0) {
219    $('.languages').hide();
220}
221
222	
223  const $section = $('#casinoSection1'); 
224  const $buttons = $section.find('[id][data-tab]');
225  const $grids = $section.find('[id]'); 
226
227  $buttons.on('click', function() {
228    const tabId = $(this).data('tab'); 
229    const $targetGrid = $('#' + tabId); 
230
231    $buttons.removeClass('active');
232    $grids.removeClass('active');
233
234    $(this).addClass('active');
235    $targetGrid.addClass('active');
236  });
237	
238	(function($) {
239  const $track = $('#marqueeTr');
240  const $group = $('#marqueeGr');
241  const speed = 120; // px/s
242
243  if (!$track.length || !$group.length) return;
244
245  function fillTrack() {
246    const groupWidth = $group.outerWidth(true);
247    const viewportWidth = $track.parent().outerWidth();
248    const minTotalWidth = viewportWidth * 2;
249    let totalWidth = groupWidth;
250
251    while (totalWidth < minTotalWidth) {
252      const $clone = $group.clone(true);
253      $track.append($clone);
254      totalWidth += groupWidth;
255    }
256  }
257
258  fillTrack();
259
260  let offset = 0;
261  let lastTime = null;
262
263  function animate(time) {
264    if (!lastTime) lastTime = time;
265    const delta = (time - lastTime) / 1000;
266    lastTime = time;
267
268    offset -= speed * delta;
269
270    const $firstGroup = $track.children().first();
271    const firstWidth = $firstGroup.outerWidth(true);
272
273    if (-offset >= firstWidth) {
274      offset += firstWidth;
275      $track.append($firstGroup);
276    }
277
278    $track.css('transform', `translateX(${offset}px)`);
279    requestAnimationFrame(animate);
280  }
281
282  requestAnimationFrame(animate);
283})(jQuery);
284
285
286});

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.