Advertisement
Konark

Untitled

May 22nd, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.35 KB | None | 0 0
  1. var preloader="<div class='loading'><div class='loader'></div></div>";
  2. window.vulcanNamespace = {};
  3. var xhr='';
  4.  
  5. $(function(){
  6. // piwik test
  7. var array = $('[data-piwik-event]');
  8. array.each(function(index){
  9. var item = $(this)
  10. ,eventName = item.attr('data-piwik-event').split(',');
  11.  
  12. item.bind('click', function(){
  13. _paq.push(['trackEvent', eventName[0], eventName[1], eventName[2]]);
  14. console.log("Group: " + eventName[0] + ", " + "Event Name: " + eventName[2] + ", " + "Event Action: " + eventName[1]);
  15. });
  16. });
  17. //piwik
  18.  
  19. $('.levels-table__item').on('touchend click', function(e) {
  20. $('.levels-table__item').removeClass('levels-table__item_active');
  21. $(this).addClass('levels-table__item_active');
  22. $('.levels-table__arrow').removeClass('levels-table__arrow_active');
  23. $(this).find('.levels-table__arrow').addClass('levels-table__arrow_active');
  24. });
  25.  
  26. $(".js-close-popup, [data-toggle='tab']").on('click', function(e) {
  27. $('.payment__tooltip').removeClass("payment__tooltip_open");
  28. //$(this).next('.payment__tooltip').toggleClass("payment__tooltip_open");
  29. });
  30.  
  31. $(".payitem").on('click', function(e) {
  32. var $index=$(this).index(),
  33. content = $('.payment__tooltip_open .pay-tooltip');
  34.  
  35. $('.pay-tooltip__summ input[type="radio"]').on('click',function( i ) {
  36. var volume_value = $(this).val();
  37. $(this).parent().parent().find('.l_num').val(volume_value);
  38. $(this).parent().parent().find('.input_summ_val').val(volume_value).focus();
  39. });
  40.  
  41. $('.js-input__inner').val('');
  42. $('.pay-tooltip__note').hide();
  43. $('.l_num').click().val('500');
  44. $('.input_summ_val').val('500');
  45. $('.input_summ_val').on('change, input', function () {
  46. var volume_value = $(this).val();
  47. $(this).parent().parent().find('.l_num').val(volume_value).click();
  48. });
  49.  
  50. $('.payment__tooltip').removeClass("payment__tooltip_open");
  51. $(this).parent().parent().next('.payment__tooltip').toggleClass("payment__tooltip_open");
  52.  
  53. var paysys=$(this).data("paysys");
  54. if(paysys)
  55. $(this).parents(".payment-form").attr('action','/engine/dir/pay/'+paysys+'/'+paysys+'.php');
  56.  
  57. if($(this).find('input').val() === "qiwi_rub" || $(this).find('input').val() === "beeline_rub" || $(this).find('input').val() === "mts_rub" || $(this).find('input').val() === "megafon_rub" || $(this).find('input').val() === "tele2_rub") {
  58. $('.pay-tooltip__phone').show();
  59. $('.pay-tooltip').addClass('pay-tooltip_withphone');
  60. //$('.pay-tooltip__phone_inner').mask("99999999999");
  61. $('.pay-tooltip__phone_inner').attr('required', true);
  62. } else {
  63. $('.pay-tooltip__summ').show();
  64. $('.pay-tooltip__phone').hide();
  65. $('.pay-tooltip').removeClass('pay-tooltip_withphone');
  66. $('.pay-tooltip').removeClass('pay-tooltip_withphone1');
  67. $('.pay-tooltip__phone_inner').attr('required', false);
  68. }
  69.  
  70. if($(this).find('input').val() === "card_rub") {
  71. $('.pay-tooltip__caption').attr('id', 'card_rub_id');
  72. document.getElementById("card_rub_id").textContent="Номер карты:";
  73. } else {
  74. $('.pay-tooltip__summ').show();
  75. $('.pay-tooltip__phone').hide();
  76. document.getElementById("card_rub_id").textContent="Номер телефона:";
  77. $('.pay-tooltip__caption').removeAttr('id');
  78. $('.pay-tooltip__phone_inner').attr('required', false);
  79. }
  80.  
  81. if ($(this).find('input').val() === "qiwi_rub" && $(this).find('input').hasClass('payout')) {
  82. $('.pay-tooltip__number').removeClass('pay-tooltip__number_withr');
  83. $('.pay-tooltip__number').addClass('pay-tooltip__number_withplus');
  84. $('.pay-tooltip__number_inner').removeClass('pay-tooltip__number_inner-noprefix');
  85. $('.pay-tooltip__number_inner')
  86. .attr({
  87. required: true,
  88. name: "account",
  89. type: "tel",
  90. placeholder: "70000000000",
  91. maxlength: "14"
  92. });
  93. } else if ($(this).find('input').val() === "webmoney") {
  94. $('.pay-tooltip__number').removeClass('pay-tooltip__number_withplus');
  95. $('.pay-tooltip__number').addClass('pay-tooltip__number_withr');
  96. $('.pay-tooltip__number_inner').removeClass('pay-tooltip__number_inner-noprefix');
  97. $('.pay-tooltip__number_inner')
  98. .attr({
  99. required: true,
  100. name: "account",
  101. type: "text",
  102. placeholder: "000000000000",
  103. maxlength: "20"
  104. });
  105. } else if ($(this).find('input').val() === "pin") {
  106. $('.pay-tooltip__summ').hide();
  107. $('.pay-tooltip__pin_inner')
  108. .attr({
  109. required: true,
  110. name: "pin",
  111. type: "text",
  112. placeholder: "0000000000",
  113. maxlength: "10"
  114. });
  115. $('.pay-tooltip__pin').show();
  116. } else {
  117. $('.pay-tooltip__summ').show();
  118. $('.pay-tooltip__number').removeClass('pay-tooltip__number_withplus');
  119. $('.pay-tooltip__number').removeClass('pay-tooltip__number_withr');
  120. $('.pay-tooltip__number_inner').addClass('pay-tooltip__number_inner-noprefix');
  121. $('.pay-tooltip__number_inner')
  122. .attr({
  123. required: true,
  124. name: "account",
  125. type: "text",
  126. placeholder: "0000000000000",
  127. maxlength: "20"
  128. });
  129. }
  130.  
  131.  
  132.  
  133. $(this).find('.l_num').click();
  134.  
  135.  
  136.  
  137. $('.js-input__inner').on("keyup, input", function(e) {
  138. //if (e.keyCode != 37) {
  139. if (this.value.match(/[^0-9]/g)) {
  140. this.value = this.value.replace(/[^0-9]/g, '');
  141. }
  142. // }
  143. });
  144.  
  145.  
  146. if($index==0){
  147. content.addClass('left').removeClass('right');
  148. } else if($index==1){
  149. content.removeClass('left').removeClass('right');
  150. } else if($index==2){
  151. content.removeClass('left').addClass('right');
  152.  
  153. }
  154.  
  155.  
  156. });
  157.  
  158.  
  159. $('.slider_small').slick({
  160. infinite: true,
  161. slidesToShow: 8,
  162. slidesToScroll: 1,
  163. swipe: true,
  164. draggable: true,
  165. touchMove: true,
  166. dots: false,
  167. responsive: [
  168. {
  169. breakpoint: 1440,
  170. settings: {
  171. slidesToShow: 7,
  172. slidesToScroll: 1,
  173. dots: false
  174. }
  175. },
  176. {
  177. breakpoint: 1240,
  178. settings: {
  179. slidesToShow: 5,
  180. slidesToScroll: 5,
  181. dots: false
  182. }
  183. },
  184. {
  185. breakpoint: 1000,
  186. settings: {
  187. slidesToShow: 3,
  188. slidesToScroll: 3,
  189. dots: false
  190. }
  191. },
  192. {
  193. breakpoint: 768,
  194. settings: {
  195. slidesToShow: 3,
  196. slidesToScroll: 2,
  197. dots: false,
  198. swipe: true,
  199. draggable: true
  200. }
  201. }
  202. ]
  203. });
  204.  
  205. $('.slider_info').slick({
  206. infinite: true,
  207. slidesToShow: 5,
  208. slidesToScroll: 1,
  209. dots: false,
  210. autoplay: true,
  211. autoplaySpeed: 1500
  212. });
  213.  
  214. $('.slider_tournament').slick({
  215. infinite: true,
  216. autoplay: false,
  217. autoplaySpeed: 1500,
  218. slidesToShow: 9,
  219. slidesToScroll: 1,
  220. dots: false,
  221. responsive: [
  222. {
  223. breakpoint: 1240,
  224. settings: {
  225. slidesToShow: 7,
  226. slidesToScroll: 1
  227. }
  228. },
  229. {
  230. breakpoint: 1000,
  231. settings: {
  232. slidesToShow: 6,
  233. slidesToScroll: 1
  234. }
  235. },
  236.  
  237. {
  238. breakpoint: 768,
  239. settings: {
  240. slidesToShow: 3,
  241. slidesToScroll: 2,
  242. dots: false,
  243. swipe: true,
  244. draggable: true
  245. }
  246. }
  247. ]
  248. });
  249.  
  250.  
  251. $('.slider_hero').slick({
  252. dots: true,
  253. arrows: false,
  254. infinite: true,
  255. autoplay: true,
  256. autoplaySpeed: 5000,
  257. speed: 500,
  258. fade: true,
  259. cssEase: 'linear',
  260. responsive: [
  261. {
  262. breakpoint: 767,
  263. settings: {
  264. dots: false
  265. }
  266. }
  267. ]
  268. });
  269.  
  270. $('.slider_hero').show();
  271.  
  272. $('.slider_gameplay').not('.slick-initialized').slick({
  273. infinite: true,
  274. slidesToShow: 7,
  275. slidesToScroll: 1,
  276. dots: false
  277. });
  278.  
  279. $('.winsline').slick({
  280. infinite: true,
  281. slidesToShow: 5,
  282. slidesToScroll: 1,
  283. swipe: true,
  284. dots: false,
  285. arrows: false,
  286. autoplay: true,
  287. autoplaySpeed: 1500,
  288. pauseOnFocus: true,
  289. responsive: [
  290. {
  291. breakpoint: 1240,
  292. settings: {
  293. slidesToShow: 4,
  294. slidesToScroll: 1,
  295. pauseOnFocus: true
  296. }
  297. },
  298. {
  299. breakpoint: 999,
  300. settings: {
  301. slidesToShow: 3,
  302. slidesToScroll: 1,
  303. pauseOnFocus: true
  304. }
  305. },
  306. {
  307. breakpoint: 767,
  308. settings: {
  309. slidesToShow: 1,
  310. slidesToScroll: 1,
  311. pauseOnFocus: true
  312. }
  313. }
  314. ]
  315. });
  316.  
  317. $('.winsline').show();
  318.  
  319.  
  320. (function($) {
  321. if ($(window).width() < 768) {
  322. $('.leaderboard__slider').slick({
  323. dots: true,
  324. infinite: false,
  325. arrows: false
  326. });
  327. $('.lottery-details__tickets').slick({
  328. dots: true,
  329. infinite: false,
  330. arrows: false
  331. });
  332. }
  333. })(jQuery);
  334.  
  335. (function($) {
  336. $('body').on('show', '.popup_tabs', function(){
  337. if ($(window).width() < 768) {
  338. $('.levels-table__table').ready(function(){
  339. $('.levels-table__table').not('.slick-initialized').slick({
  340. dots: true,
  341. infinite: false,
  342. arrows: false,
  343. slidesToShow: 1,
  344. slidesToScroll: 1
  345. });
  346. $('.levels-table__table').on('afterChange', function(event, slick, currentSlide, nextSlide){
  347. var $dataId = $(slick.$slides[currentSlide]).data('target');
  348. $(this).parent().find('.tab__content > div').removeClass('active');
  349. $($dataId).addClass('active');
  350. });
  351. })
  352. }
  353. });
  354. })(jQuery);
  355.  
  356. // Tabs script
  357.  
  358. // needs adding .not('.slick-initialized') to work properly - in that case it is not initialized on already "slicked" slider
  359.  
  360. $('.slider_small').not('.slick-initialized').slick({
  361. infinite: true,
  362. autoplay: true,
  363. autoplaySpeed: 1500,
  364. slidesToShow: 9,
  365. slidesToScroll: 1,
  366. dots: false
  367. });
  368.  
  369.  
  370.  
  371. // Gameplay scripts
  372. $('.show__nav').on('click', function () {
  373. $('.gameplay-nav-small').slideToggle();
  374. });
  375. $('.gameplay-nav__item').on('click', function() {
  376.  
  377. $('.gameplay-nav').find('li').not($(this)).removeClass('gameplay-nav__item_active');
  378. $('.gameplay__slider').not($($(this).data('target'))).removeClass('gameplay__slider_open').css('display', 'none');
  379.  
  380. if ($(this).hasClass('gameplay-nav__item_active')) {
  381. $(this).removeClass('gameplay-nav__item_active');
  382. $($(this).data('target')).removeClass('gameplay__slider_open').css('display', 'none');
  383. } else {
  384. $(this).addClass('gameplay-nav__item_active');
  385. $($(this).data('target')).addClass('gameplay__slider_open').css('display', 'block');
  386. }
  387. });
  388.  
  389.  
  390.  
  391. $('.socials__item').on('click', function(){
  392. $(this).toggleClass('socials__item_active');
  393. });
  394.  
  395. // Perfect scrollbar initialization
  396.  
  397. (function($) {
  398. if ($(window).width() > 700) {
  399. $('.summary__content').not('.ps-container').perfectScrollbar({
  400. theme: 'details',
  401. suppressScrollX: true
  402. // maxScrollbarLength: 213
  403. });
  404. $('.popup__gallery').not('.ps-container').perfectScrollbar({
  405. theme: 'tabs',
  406. suppressScrollX: true
  407. // maxScrollbarLength: 213
  408. });
  409. $('.payment').not('.ps-container').perfectScrollbar({
  410. theme: 'tabs',
  411. suppressScrollX: true,
  412. scrollXMarginOffset: 5
  413. // maxScrollbarLength: 213
  414. });
  415.  
  416. $('.history').not('.ps-container').perfectScrollbar({
  417. theme: 'tabs',
  418. suppressScrollX: true
  419. // maxScrollbarLength: 213
  420. });
  421.  
  422. $('.popup__history').not('.ps-container').perfectScrollbar({
  423. theme: 'tabs',
  424. suppressScrollX: true
  425. // maxScrollbarLength: 213
  426. });
  427. $('.table-panel').not('.ps-container').perfectScrollbar({
  428. theme: 'details',
  429. suppressScrollX: true
  430. // maxScrollbarLength: 213
  431. });
  432. }
  433.  
  434. })(jQuery);
  435.  
  436.  
  437. (function($) {
  438. if ($(window).width() < 768) {
  439. $('.main-nav').not('.ps-container').perfectScrollbar({
  440. theme: 'hidden',
  441. suppressScrollY: true,
  442. scrollXMarginOffset: 5
  443. // maxScrollbarLength: 213
  444. });
  445. }
  446. })(jQuery);
  447.  
  448. (function($) {
  449. $('.header__wrap_scroll').not('.ps-container').perfectScrollbar({
  450. theme: 'hidden',
  451. suppressScrollY: true,
  452. scrollXMarginOffset: 5
  453. // maxScrollbarLength: 213
  454. });
  455. })(jQuery);
  456.  
  457.  
  458. (function($) {
  459. if ($(window).width() > 768) {
  460. $('.modal_open .popup').not('.ps-container').not('.popup_tabs').perfectScrollbar({
  461. theme: 'hidden'
  462. });
  463. }
  464. })(jQuery);
  465.  
  466. // Chosen Select styling
  467.  
  468. $(".filter__select").chosen({disable_search: true});
  469.  
  470. // Date picker - Zebra_Datepicker
  471.  
  472.  
  473. $('input.datepicker_start').Zebra_DatePicker({
  474. offset: [-150, 40],
  475. default_position: 'below',
  476. show_icon: false,
  477. direction: true,
  478. format: 'm/d/Y',
  479. show_clear_date: false,
  480. show_select_today: false,
  481. pair: $('input.datepicker_end')
  482. });
  483.  
  484. $('input.datepicker_end').Zebra_DatePicker({
  485. offset: [-150, 40],
  486. default_position: 'below',
  487. show_icon: false,
  488. format: 'm/d/Y',
  489. show_clear_date: false,
  490. show_select_today: false,
  491. direction: 1
  492. });
  493.  
  494. $('input.datepicker_birth').Zebra_DatePicker({
  495. offset: [-280, 40],
  496. days: ['Вс.', 'Пн.', 'Вт.', 'Ср.', 'Чт.', 'Пт.', 'Сб.'],
  497. months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
  498. default_position: 'below',
  499. show_icon: false,
  500. format: 'Y-m-d',
  501. show_clear_date: false,
  502. show_select_today: false
  503. });
  504.  
  505. // Lottery range input
  506.  
  507. $('input.range__input').ionRangeSlider({
  508. type: "double",
  509. grid: true,
  510. grid_snap: true,
  511. min: 1,
  512. max: 7,
  513. from: 1,
  514. step: 1,
  515. to: 2,
  516. from_fixed: true,
  517. prefix: "x",
  518. hide_from_to: true,
  519. hide_min_max: true,
  520. onStart: function (data) {
  521. $('.irs-grid-text').each( function( index, element ){
  522. $(this).removeClass('irs-grid-text_active');
  523. if (index === data.to - 1) {
  524. $(this).addClass('irs-grid-text_active');
  525. }
  526. });
  527. },
  528. onChange: function (data) {
  529. var toValue = data.to;
  530. //console.log(toValue);
  531. $('.irs-grid-text').each( function( index, element ){
  532. $(this).removeClass('irs-grid-text_active');
  533. if (index === data.to - 1) {
  534. $(this).addClass('irs-grid-text_active');
  535. }
  536. });
  537. }
  538. });
  539.  
  540.  
  541. // Nav scripts
  542.  
  543. var heroHeight = $('.hero__wrap').outerHeight();
  544. var subnavHeight = $('.main-nav__subnav').outerHeight();
  545.  
  546.  
  547. $(".main-nav__item_subnav").hover(
  548. function() {
  549. if(!$(this).hasClass('main-nav__item_active')) {
  550. if (!$(".hero__nav").hasClass("hero__nav_sticky")) {
  551. if ($('.main-nav').outerHeight() <= 50) {
  552. $('.hero__wrap').animate({height: (subnavHeight + heroHeight) + "px"}, {queue: false, duration: 100});
  553. $('.main-nav').attr('style', 'overflow: initial !important');
  554. } else {
  555. $('.hero__wrap').animate({height: (subnavHeight + heroHeight) + "px"}, {queue: false, duration: 100});
  556. }
  557. }
  558. }
  559. }, function() {
  560. if(!$(this).hasClass('main-nav__item_active')) {
  561. if ($('.main-nav').outerHeight() <= 50) {
  562. $('.hero__wrap').animate( { height: heroHeight + "px" }, { queue:false, duration:100 });
  563. $('.main-nav').attr('style', 'overflow: hidden !important');
  564. } else {
  565. $('.hero__wrap').animate( { height: heroHeight + "px" }, { queue:false, duration:100 });
  566. }
  567. }
  568. }
  569. );
  570.  
  571. (function($) {
  572. $('.main-nav').attr('style', 'overflow: auto !important');
  573. if ($(".main-nav__item_subnav").hasClass('main-nav__item_active')) {
  574. var heroHeight = $('.hero__wrap').outerHeight();
  575. var heroSubnav = $('.main-nav__subnav').outerHeight();
  576.  
  577. $('.hero__wrap').css('height', heroHeight + heroSubnav);
  578. $('.main-nav').attr('style', 'overflow: initial !important');
  579.  
  580. }
  581. })(jQuery);
  582.  
  583. // top nav sticky script
  584.  
  585. $(function(){
  586. var alertPanel = $(".alert-panel").height();
  587. var header = $(".header").height();
  588. var hero = $(".hero").height();
  589. var heightSum;
  590. if (alertPanel !== undefined) {
  591. heightSum = alertPanel + header + hero;
  592. } else {
  593. heightSum = header + hero;
  594. }
  595. var window_width = $(window).width();
  596. if ($('.main-nav li').width() >= window_width) {
  597. $('.hero__nav').addClass('hero__nav_scroll');
  598. }
  599. $(window).scroll(function() {
  600. var scroll = getCurrentScroll();
  601.  
  602. if ( window_width > 768) {
  603. if ( scroll >= heightSum - 78) {
  604. $('.hero__nav').addClass('hero__nav_sticky');
  605. }
  606. else {
  607. $('.hero__nav').removeClass('hero__nav_sticky');
  608. }
  609.  
  610. if ( scroll >= 1 && scroll < heightSum - (78+43) && $('.alert-panel').is(':visible')) {
  611. $('header').css({'margin-top':alertPanel});
  612. $('.alert-panel').addClass('hero__nav_sticky');
  613. }
  614. else {
  615. $('header').css({'margin-top':0});
  616. $('.alert-panel').removeClass('hero__nav_sticky');
  617. }
  618. }
  619.  
  620.  
  621. });
  622. function getCurrentScroll() {
  623. return window.pageYOffset || document.documentElement.scrollTop;
  624. }
  625. });
  626. $(function () {
  627. if (window.location.hash != undefined) {
  628. if (window.location.hash == '#registration') {
  629. $('#registration-modal').show();
  630. var link = window.location.href;
  631. link = link.replace(window.location.hash, '');
  632. history.pushState({}, '', link);
  633. }
  634. if (window.location.hash == '#login') {
  635. $('#login-modal').show();
  636. var link = window.location.href;
  637. link = link.replace(window.location.hash, '');
  638. history.pushState({}, '', link);
  639. }
  640. }
  641. });
  642.  
  643. $(document).on('click','[data-toggle="modal"]',function(e){
  644. e.preventDefault();
  645. if ($(this).data('tab') == '#cashier'){
  646. $(window).scrollTop(0);
  647. }
  648.  
  649. $('.modal,.popup').hide();
  650. var $id=$(this).attr('href');
  651. if($id==undefined){
  652. $id=$(this).data('target');
  653. }
  654.  
  655. $($id).show();
  656.  
  657. $('html').addClass('modal_open');
  658.  
  659. if ($(window).width() < 768) {
  660. $('.modal_open .popup').not('.ps-container').not('.popup_tabs').perfectScrollbar({
  661. theme: 'hidden'
  662. });
  663. }
  664.  
  665. if($(this).data('tab')!=undefined){
  666. $($(this).data('tab')).parent().find('>div').removeClass('active');
  667. $($(this).data('tab')).addClass('active');
  668. $('.tab__item[href="'+$(this).data('tab')+'"]').parent().find('.tab__item').removeClass('tab__item_active');
  669. $('.tab__item[href="'+$(this).data('tab')+'"]').addClass('tab__item_active');
  670.  
  671.  
  672.  
  673. }
  674. });
  675. window.getTimeRemaining = function(endtime) {
  676. var today=(new Date()).toUTCString();
  677. endtime = (new Date(endtime*1000)).toUTCString();
  678. var t = Date.parse(endtime) - Date.parse(today);
  679. var seconds = Math.floor( (t/1000) % 60 );
  680. var minutes = Math.floor( (t/1000/60) % 60 );
  681. var hours = Math.floor( (t/(1000*60*60)) % 24 );
  682. var days = Math.floor( t/(1000*60*60*24) );
  683. return {
  684. 'total': t,
  685. 'days': days,
  686. 'hours': hours,
  687. 'minutes': minutes,
  688. 'seconds': seconds
  689. };
  690. };
  691.  
  692. function initializeClock(id, endtime){
  693. var clock = document.getElementById(id);
  694. var timeinterval = setInterval(function(){
  695. var t = getTimeRemaining(endtime);
  696. if(t.days<0){t.days=0}
  697. if(t.hours<0){t.hours=0}
  698. if(t.minutes<0){t.minutes=0}
  699. if(t.seconds<0){t.seconds=0}
  700.  
  701. if(t.hours<10 && t.hours>=0){t.hours='0'+t.hours}
  702. if(t.minutes<10 && t.minutes>=0){t.minutes='0'+t.minutes}
  703. if(t.seconds<10 && t.seconds>=0){t.seconds='0'+t.seconds}
  704.  
  705. clock.innerHTML = ' <div class="timer__cell">' + t.days + '</div> ' +
  706. '<div class="timer__cell timer__cell_empty"></div> ' +
  707. '<div class="timer__cell">'+ t.hours + '</div>' +
  708. ' <div class="timer__cell">:</div> ' +
  709. '<div class="timer__cell">' + t.minutes + '</div> ' +
  710. '<div class="timer__cell">:</div> ' +
  711. '<div class="timer__cell">' + t.seconds + '</div> ';
  712. if(t.total<=0){
  713. clearInterval(timeinterval);
  714. }
  715. },1000);
  716. }
  717. function initializeJackpot(id, jackpot){
  718.  
  719. var jack = document.getElementById(id);
  720. var numbers = (jackpot+ '').split('',-4);
  721. var $j=numbers.reverse();
  722. var timeinterval = setInterval(function(){
  723. $j[0]=parseInt($j[0])+randomInteger(0,5);
  724. if($j[0]>=10){
  725. $j[0]=parseInt($j[0])-10;
  726. $j[1]=parseInt($j[1])+1;
  727. if($j[1]>=10){
  728. $j[1]=10-$j[1];
  729. $j[2]=parseInt($j[2])+1;
  730. if($j[2]>=10){
  731. $j[2]=10-$j[2];
  732. $j[3]=parseInt($j[3])+1
  733. }
  734. }
  735. }
  736. if($j[0]<0){
  737. $j[0]=0;
  738. $j[1]=parseInt($j[1])-1;
  739. if($j[1]<0){
  740. $j[1]=0;
  741. $j[2]=parseInt($j[2])-1;
  742. if($j[2]<0){
  743. $j[2]=0;
  744. $j[3]=parseInt($j[3])-1;
  745. }
  746. }
  747. }
  748. $(jack).find('.js-countdown__item:last').html($j[0]);
  749. //console.log($(jack).find('.js-countdown__item').length);
  750. $(jack).find('.js-countdown__item').eq(parseInt($(jack).find('.js-countdown__item').length)-2).html($j[1]);
  751. $(jack).find('.js-countdown__item').eq(parseInt($(jack).find('.js-countdown__item').length)-3).html($j[2]);
  752. $(jack).find('.js-countdown__item').eq(parseInt($(jack).find('.js-countdown__item').length)-4).html($j[3]);
  753.  
  754.  
  755. },3000);
  756. }
  757. function randomInteger(min, max) {
  758. var rand = min + Math.random() * (max - min)
  759. rand = Math.round(rand);
  760. return rand;
  761. }
  762. $(function () {
  763.  
  764. function randomInteger(min, max) {
  765. var rand = min + Math.random() * (max - min)
  766. rand = Math.round(rand);
  767. return rand;
  768. }
  769.  
  770.  
  771. $('.js-close-popup').on('click', function (e) {
  772. e.preventDefault();
  773. var popup = $(this).parents('.popup');
  774. if (popup.length != 0) {
  775. var Class = popup.attr('class').split(' ');
  776. var ClassName = Class[1];
  777.  
  778. } else {
  779. var ClassName = 'modal';
  780. }
  781. $("." + ClassName).hide();
  782.  
  783. $('.modal').hide();
  784. //$('.overflow').hide();
  785. $('html').removeClass('modal_open');
  786. });
  787. $('.alert-panel__icon .icon_cross').on('click', function (e) {
  788. e.preventDefault();
  789. $('.alert-panel').hide();
  790. });
  791. $('.notify-panel__icon .icon_cross').on('click', function (e) {
  792. e.preventDefault();
  793. $('.notify-panel').hide();
  794. });
  795. $.each($('[data-toggle="timer"]'),function(){
  796. initializeClock($(this).attr("id"), $(this).data('time'))
  797. });
  798.  
  799. $.each($('[data-toggle="jackpot"]'),function(){
  800. initializeJackpot($(this).attr("id"), $(this).data('jack'))
  801. });
  802. });
  803.  
  804. function showRegistrationPopup(){
  805. $('.modal,.popup').hide();
  806.  
  807. $('#registration-confirm').show();
  808. $('html').addClass('modal_open');
  809. if ($(window).width() < 768) {
  810. $('.modal_open .popup').not('.ps-container').perfectScrollbar({
  811. theme: 'hidden'
  812. });
  813. }
  814. $('#registration-confirm #bonus').val($('#registration-modal [name="bonus"]:checked').val());
  815. $('#registration-confirm .registration__image img').attr('src',$('#registration-modal [name="bonus"]:checked').prev('label').find('img').attr('src'));
  816. }
  817.  
  818. if(!$('#registration-modal [name="bonus"]').data("binding"))
  819. $('#registration-modal [name="bonus"]').on('change',function(e){
  820.  
  821. e.preventDefault();
  822. showRegistrationPopup();
  823. $('html').addClass('modal_open');
  824. });
  825.  
  826.  
  827. $(document).on('submit','form[data-type="ajax"]',function(e){
  828. e.preventDefault();
  829. var $type=$(this).attr('method');
  830. var $action=$(this).attr('action');
  831. var $data=$(this).serialize();
  832. var $answer=$(this).data('answer');
  833. var $form=$(this);
  834. $.ajax({
  835. type:$type,
  836. url:$action,
  837. data:$data,
  838. dataType:'json',
  839. beforeSend:function(){
  840. $form.find('.modal__error').hide();
  841. $form.find('.pay-tooltip__note').hide();
  842. $form.closest('.modal,.popup').append(preloader);
  843. },
  844. success:function(data){
  845. $('.loading').remove();
  846. if(!data.success){
  847. $('[type="password"]').val('');
  848. if($.type(data.error)=='object'){
  849. $form.find('.modal__error .modal__note_important,.pay-tooltip__note .error__info').html('');
  850. $.each(data.error,function($key,$value){
  851. $form.find('.modal__error .modal__note_important,.pay-tooltip__note .error__info').append($value + "<br/>");
  852. });
  853. } else {
  854. $form.find('.modal__error .modal__note_important,.pay-tooltip__note .error__info').html(data.error);
  855. }
  856. $form.find('.modal__error').show();
  857. $form.find('.pay-tooltip__note').show();
  858. } else {
  859. if(data.uid!=undefined && _ggcounter!=undefined){
  860. _ggcounter.push({
  861. event: "login",
  862. uid: data.uid,
  863. callback: function(){
  864. }
  865. });
  866. }
  867. if(data.form!=undefined){
  868. $('body').append(data.form);
  869. $('#'+data.form_id).submit();
  870. } else {
  871. if($answer!=undefined){
  872. $('.modal,.popup').hide();
  873. $($answer).show();
  874. } else {
  875. window.location.reload();
  876. }
  877.  
  878. }
  879. }
  880. }
  881. });
  882.  
  883. });
  884.  
  885. $(document).on('submit','form.payment-form',function(e){
  886. e.preventDefault();
  887. var $type=$(this).attr('method');
  888. var $action=$(this).attr('action');
  889. var $data=$(this).serialize();
  890. var $answer=$(this).data('answer');
  891. var $form=$(this);
  892. $.ajax({
  893. type:$type,
  894. url:$action,
  895. data:$data,
  896. dataType:'json',
  897. beforeSend:function(){
  898. $form.find('.pay-tooltip__note').hide();
  899. $form.closest('.modal,.popup').append(preloader);
  900. },
  901. success:function(data){
  902. $('.loading').remove();
  903. if(data.result!='ok'){
  904. if($.type(data.message)=='object'){
  905. $form.find('.pay-tooltip__note .error__info').html('');
  906. $.each(data.message,function($key,$value){
  907. $form.find('.pay-tooltip__note .error__info').append($value + "<br/>");
  908. });
  909. } else {
  910. $form.find('.pay-tooltip__note .error__info').html(data.message);
  911. }
  912. $form.find('.pay-tooltip__note').show();
  913. } else {
  914.  
  915. if(data.form!=undefined){
  916. $('body').append(data.form);
  917. $('#'+data.form_id).submit();
  918. } else {
  919. if ($answer != undefined) {
  920. $('.modal,.popup').hide();
  921. $($answer).show();
  922. } else {
  923. window.location.reload();
  924. }
  925. }
  926. }
  927. }
  928. })
  929. });
  930. $(function () {
  931. $(".activate-bonus").on('click', function (e) {
  932. e.preventDefault();
  933. if(xhr!=''){
  934. xhr.abort();
  935. }
  936. var id= $(this).data('id');
  937. xhr =$.post('/engine/ajax/activate_bonus.php', {'id': id}, function (data) {
  938. xhr='';
  939. if (data.status && data.is_deposit) {
  940. $('#bonus-img').attr('src', data.image);
  941. $('#bonus-deposit-sum').html(data.deposit);
  942. console.log($('.min'));
  943. $('.min').html(data.deposit);
  944. $('.deposit-campaign-id').val(data.campaign_id);
  945. $('#deposit-for-bonus-modal .aside__promo-table .table__body').html('');
  946. $('#deposit-for-bonus-modal input[name=bonus_id]').val(id);
  947. $.each(data.winners, function ($key, $item) {
  948. var $row = "<tr class='table__row'><td class='table__cell'>" + ($key + 1) + "</td><td class='table__cell'>" + $item.login + "</td><td class='table__cell'>" + Math.round($item.win) + "</td></tr>";
  949. $('#deposit-for-bonus-modal .aside__promo-table .table__body').append($row);
  950. });
  951. $('#cabinet-modal').hide();
  952. $('#deposit-for-bonus-modal').show();
  953. $('html').addClass('modal_open');
  954. } else {
  955. if(!data.status){
  956. $('#cabinet-modal').hide();
  957. $('#have_active_bonus .popup__content .popup__title').html(data.error);
  958. $('#have_active_bonus').show();
  959. } else {
  960. window.location.reload();
  961. }
  962. }
  963. $(window).scrollTop(0);
  964. }, 'json')
  965. });
  966. });
  967.  
  968. $(document).on('click','button[data-type="ajax"]',function(e){
  969. e.preventDefault();
  970. var $success=$(this).data('success');
  971. var $fail=$(this).data('fail');
  972. console.log ($(this).data('target'));
  973. $.post($(this).data('target'),{},function(data){
  974. if(data.success){
  975. $($success).show();
  976. } else {
  977. $($fail).show();
  978. }
  979. },'json')
  980. });
  981. (function () {
  982. $('.popup_favoritesAdded .js-close-popup').on('click', function(){
  983. $('button[data-success =".popup_favoritesAdded"]').hide()
  984. })
  985. })();
  986. $(document).on('submit','#search-form',function(e){
  987. e.preventDefault();
  988. $.ajax({
  989. type:"GET",
  990. data:{'page':$("#page").val(),'group':$("#gamegroup").val(),'type':'html','q':$("#search-form input").val()},
  991. url:'/engine/ajax/game_list.php',
  992. success:function(data){
  993. if($("#search-form input").val()!=''){
  994. history.pushState({q: $("#search-form input").val()}, '', window.location.pathname+'/?q='+$("#search-form input").val());
  995. } else {
  996. history.pushState({}, '', window.location.pathname);
  997. }
  998.  
  999. $('.main_gallery').html(data);
  1000. }
  1001. })
  1002. });
  1003.  
  1004. $(document).on('keyup','#search-form input',function(e){
  1005. e.preventDefault();
  1006. if(xhr!=''){
  1007. xhr.abort();
  1008. }
  1009. xhr =$.ajax({
  1010. type:"GET",
  1011. data:{'page':$("#page").val(),'group':$("#gamegroup").val(),'type':'html','q':$("#search-form input").val()},
  1012. url:'/engine/ajax/game_list.php',
  1013. success:function(data){
  1014. xhr='';
  1015. if($("#search-form input").val()!=''){
  1016. history.pushState({q: $("#search-form input").val()}, '', window.location.pathname.replace(new RegExp("[/]+$", "g"), "")+'/?q='+$("#search-form input").val());
  1017. } else {
  1018. history.pushState({}, '', window.location.pathname);
  1019. }
  1020.  
  1021. $('.main_gallery').html(data);
  1022. }
  1023. });
  1024. });
  1025. (function ($) {
  1026. $.each(['show', 'hide'], function (i, ev) {
  1027. var el = $.fn[ev];
  1028. $.fn[ev] = function () {
  1029. this.trigger(ev);
  1030. return el.apply(this, arguments);
  1031. };
  1032. });
  1033. })(jQuery);
  1034.  
  1035. $('#registration-modal').on('show', function(){
  1036. $('[name="bonus"]').prop('checked',false);
  1037. });
  1038. $('#soc_registration-modal').on('show', function(){
  1039. $('[name="bonus"]').prop('checked',false);
  1040. });
  1041. $('.modal,.popup').on('show', function(){
  1042. $('.modal__error').hide();
  1043. $('.pay-tooltip__note').hide();
  1044. if ($('.tab-profile__form').length >= 1) {
  1045. $('.tab-profile__form')[0].reset();
  1046. $('.js-input__inner_tel').on('change keyup input click',function(){
  1047. if (this.value.match(/[^0-9]/g)) {
  1048. this.value = this.value.replace(/[^0-9]/g, '');
  1049. }
  1050.  
  1051. });
  1052. }
  1053.  
  1054. });
  1055.  
  1056. $(document).on('click','[data-verification]',function(e){
  1057. e.preventDefault();
  1058. var $type=$(this).data('verification');
  1059. if(xhr!=''){
  1060. xhr.abort();
  1061. }
  1062. xhr =$.ajax({
  1063. type:"POST",
  1064. data:{'val':$("#profileform-"+$type).val(),'type':$type},
  1065. url:'/engine/ajax/activate.php',
  1066. dataType:'json',
  1067. success:function(data){
  1068. xhr='';
  1069. $('.loading').remove();
  1070. if(!data.success){
  1071. $("#profile").find('.modal__error .modal__note_important').html(data.error);
  1072. $("#profile").find('.modal__error').show();
  1073. } else {
  1074. if ($type == 'phone') {
  1075. var timeinterval = setInterval(function() {
  1076. var $time = getTimeRemaining(data.time);
  1077.  
  1078. if ($time.seconds <= 0 && $time.minutes <= 0) {
  1079. $('.clock-timer__counter').text('0:00');
  1080. clearInterval(timeinterval);
  1081. } else {
  1082. $('.clock-timer__counter').text($time.minutes + ':' + $time.seconds);
  1083. }
  1084. }, 100);
  1085. $('.popup_phoneVerification').show();
  1086. }
  1087. if($type=='email'){
  1088. $('.popup_emailVerification').show();
  1089. }
  1090. }
  1091. }
  1092. })
  1093. });
  1094.  
  1095. $(document).on('click','.disabled',function(e){
  1096. e.preventDefault();
  1097. if($(this).data('target')!=undefined){
  1098. $('.modal,.popup').hide();
  1099. $($(this).data('target')).show();
  1100. }
  1101. $(this).removeClass('disabled');
  1102. });
  1103. });
  1104. $(function () {
  1105. $('.vipclub__row .vipclub__item').on('click', function () {
  1106. var infoBlock = $($(this).data('target'));
  1107. var padding_for = infoBlock.height() + 76;
  1108. $('.vipclub__row').not(infoBlock.parent()).css('padding-bottom', '0');
  1109. $('.vipclub__info').not(infoBlock).removeClass('vipclub__info_open');
  1110.  
  1111. if(infoBlock.hasClass('vipclub__info_open')) {
  1112.  
  1113. infoBlock.removeClass('vipclub__info_open');
  1114. infoBlock.parent().css('padding-bottom', 0);
  1115.  
  1116. } else {
  1117.  
  1118. infoBlock.addClass('vipclub__info_open');
  1119. infoBlock.parent().css('padding-bottom', padding_for);
  1120.  
  1121. if ($(this).is(':first-child')) {
  1122. infoBlock.find('.vipclub__arrow').removeClass('vipclub__arrow_right');
  1123. infoBlock.find('.vipclub__arrow').addClass('vipclub__arrow_left');
  1124. } else if ($(this).is(':nth-last-child(2)')) {
  1125. infoBlock.find('.vipclub__arrow').removeClass('vipclub__arrow_left');
  1126. infoBlock.find('.vipclub__arrow').addClass('vipclub__arrow_right');
  1127. } else {
  1128. infoBlock.find('.vipclub__arrow').removeClass('vipclub__arrow_left vipclub__arrow_right');
  1129. }
  1130. }
  1131. });
  1132. });
  1133.  
  1134. $(function(){
  1135. $('[data-toggle="tab"]').on('click tap swipe', function(e) {
  1136. e.preventDefault();
  1137. var $id = $(this).attr('href'),
  1138. $viewport = $('html, body');
  1139. if ($id == undefined) {
  1140. $id = $(this).data('target');
  1141. }
  1142.  
  1143.  
  1144. if ($(this).hasClass('levels-table__item') && $(window).width() > 768) {
  1145.  
  1146. $viewport.stop().animate({ scrollTop: $(".levels-table").offset().top}, 'slow', function(){
  1147. $viewport.off("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove");
  1148. });
  1149. $viewport.bind("scroll mousedown DOMMouseScroll mousewheel keyup", function(e){
  1150. if ( e.which > 0 || e.type === "mousedown" || e.type === "mousewheel"){
  1151. $viewport.stop().unbind('scroll mousedown DOMMouseScroll mousewheel keyup'); // This identifies the scroll as a user action, stops the animation, then unbinds the event straight after (optional)
  1152. }
  1153. });
  1154.  
  1155. }
  1156.  
  1157. $($id).parent().find('>div').removeClass('active');
  1158. $($id).addClass('active');
  1159. //hide error message from server
  1160. $('.modal__error').hide();
  1161.  
  1162. if($(this).data('remote')!=undefined && $(this).data('remote')!=''){
  1163. var $content=$(this).data('content');
  1164. $.post($(this).data('remote'),{},function(data){
  1165. var $response=$(data).find($content);
  1166. var $html=$response.html();
  1167. $($id).html($html);
  1168. });
  1169. }
  1170. if (!$(this).hasClass('levels-table__item')) {
  1171. if($(this).hasClass('lottery__tabitem')){
  1172. $(this).parent().find('.lottery__tabitem').removeClass('lottery__tabitem_active');
  1173. $(this).addClass('lottery__tabitem_active');
  1174. } else {
  1175. $(this).parent().find('.tab__item').removeClass('tab__item_active');
  1176. $(this).addClass('tab__item_active');
  1177. }
  1178. }
  1179. });
  1180. /*$('.levels-table__item[data-toggle="tab"]').on('swipe', function(e) {
  1181. e.preventDefault();
  1182. $(this).click();
  1183.  
  1184. $(this).parent().find('>div').removeClass('active');
  1185. $(this).addClass('active');
  1186. if($(this).data('remote')!=undefined && $(this).data('remote')!=''){
  1187. var $content=$(this).data('content');
  1188. $.post($(this).data('remote'),{},function(data){
  1189. var $response=$(data).find($content);
  1190. var $html=$response.html();
  1191. $($id).html($html);
  1192. });
  1193. }
  1194. });*/
  1195. });
  1196.  
  1197.  
  1198. $(function () {
  1199. // window.vulcanNamespace.resetStarHandlers = function() {
  1200. $(document).off('click','[data-toggle]');
  1201. $(document).on('click','[data-toggle]',function(e){
  1202. e.preventDefault();
  1203.  
  1204. var $el = $(this);
  1205. if ($el.attr('data-toggle') == 'add-fav') {
  1206. $.get('/engine/ajax/add_to_favorites.php',{'id':$(this).data('id')},function(data){
  1207. if(data.success){
  1208. //$('.popup_favoritesAdded').css('position', 'fixed').show();
  1209. //$('.overflow').show();
  1210. $el.addClass('in_favorites');
  1211. $el.attr('data-toggle','remove-fav');
  1212. $el.attr('title','Удалить из избранного');
  1213. } else {
  1214. $('.popup_favoritesAddedFail').css('position', 'fixed').show();
  1215. $('html').addClass('modal_open');
  1216. $el.removeClass('in_favorites');
  1217. }
  1218. },'json')
  1219. } else if ($el.attr('data-toggle') == 'remove-fav') {
  1220. $.get('/engine/ajax/remove_favorites.php',{'id':$el.data('id')},function(data){
  1221. $el.removeClass('in_favorites');
  1222. $el.attr('data-toggle','add-fav');
  1223. $el.attr('title','Добавить в избранное');
  1224. },'json')
  1225. }
  1226. });
  1227.  
  1228.  
  1229. // };
  1230. //window.vulcanNamespace.resetStarHandlers();
  1231. });
  1232. function user_ajax(form,action){
  1233.  
  1234. data=$(form).serialize();
  1235. $(form).closest('.modal,.popup').append(preloader);
  1236. error_box= $(form).find('.modal__error .modal__note_important').empty();
  1237. $.post('/engine/ajax/user.php',data+'&action='+action,function(res){
  1238. $('.loading').remove();
  1239. if(res.success==true)
  1240. {
  1241. if(res.txt){
  1242. $(form).find('.modal__error .modal__note_important').html('');
  1243. //$(form).find('.modal__error .modal__note_accent').html(res.txt);
  1244. $(form).find('.modal__error').show();
  1245. }
  1246. //setTimeout (function(){ window.location.reload()}, 3000);
  1247. window.location.reload();
  1248. }
  1249. else
  1250. {
  1251. if(res.error){
  1252. error_box.html(res.error);
  1253. $(form).find('.modal__error').show();
  1254. }
  1255. }
  1256. },'json');
  1257. return false;
  1258. }
  1259. function decimalAdjust(type, value, exp) {
  1260. // Если степень не определена, либо равна нулю...
  1261. if (typeof exp === 'undefined' || +exp === 0) {
  1262. return Math[type](value);
  1263. }
  1264. value = +value;
  1265. exp = +exp;
  1266. // Если значение не является числом, либо степень не является целым числом...
  1267. if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
  1268. return NaN;
  1269. }
  1270. // Сдвиг разрядов
  1271. value = value.toString().split('e');
  1272. value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));
  1273. // Обратный сдвиг
  1274. value = value.toString().split('e');
  1275. return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));
  1276. }
  1277.  
  1278. // Десятичное округление к ближайшему
  1279. if (!Math.round10) {
  1280. Math.round10 = function(value, exp) {
  1281. return decimalAdjust('round', value, exp);
  1282. };
  1283. }
  1284. $(document).on('change keyup input click','#exchange-input',function(){
  1285. if (this.value.match(/[^0-9]/g)) {
  1286. this.value = this.value.replace(/[^0-9]/g, '');
  1287. }
  1288. var $value=$(this).val()*$(this).data('cours');
  1289. $('#exchange-output').val(Math.round10($value,-2));
  1290. $('#exchange-input').val($(this).val()*1);
  1291.  
  1292. });
  1293. $(document).on('change keyup input click','#exchange-output',function(){
  1294.  
  1295. this.value = this.value.replace(/[^\d\.]/g, '');
  1296.  
  1297. var $value=$(this).val()/$(this).data('cours');
  1298. $('#exchange-input').val(Math.round10($value,-2));
  1299. $('#exchange-output').val($(this).val()*1);
  1300. });
  1301.  
  1302. // script fro scroll to top button
  1303.  
  1304. $(document).ready(function(){
  1305. var calculateSize = function($el) {
  1306.  
  1307. var width = $el.width();
  1308. var height = $el.height();
  1309. var maxWidth = $el.parent().parent().width();
  1310. var maxHeight = $el.parent().parent().height();
  1311. var proportions = 3 / 4;
  1312.  
  1313. if (maxHeight / maxWidth < proportions) {
  1314. height = Math.floor(maxHeight);
  1315. width = Math.floor(height / proportions);
  1316. } else {
  1317. width = Math.floor(maxWidth);
  1318. height = Math.floor(width * proportions);
  1319. }
  1320.  
  1321. $el.css({
  1322. width: width + 'px',
  1323. height: height + 'px',
  1324. display: 'block'
  1325. })
  1326. return {
  1327. width: width,
  1328. height: height
  1329. };
  1330. }
  1331. setTimeout(function(){
  1332. calculateSize($('.gameplay__canvas_inner object'));
  1333. }, 100);
  1334.  
  1335. // validation
  1336. $('form button.validate').click(function(e){
  1337. e.preventDefault();
  1338. var $form = $(this).closest('form');
  1339. // $form.find('.modal__note_important');
  1340. var hasErrors = false;
  1341. $form.find('.modal__error').hide();
  1342. $form.find('.modal__note_important').html('');
  1343. $(this).closest('form').find('[required][type="checkbox"]').each(function(index, el) {
  1344. if (!$(el)[0].checked) {
  1345. hasErrors = true;
  1346. $form.find('.modal__error').show();
  1347. $form.find('.modal__note_important').append($(el).attr('data-error-message'));
  1348. }
  1349. });
  1350. if (!hasErrors) {
  1351. $form.submit();
  1352. }
  1353. });
  1354.  
  1355. $(window).resize(function() {
  1356. calculateSize($('.gameplay__canvas_inner object'));
  1357. });
  1358. $(window).scroll(function () {
  1359. if ($(this).scrollTop() > 0) {
  1360. $('.scroller').fadeIn();
  1361. }
  1362. else {
  1363. $('.scroller').fadeOut();
  1364. }
  1365. });
  1366. $('.popup_tournamentGames').scroll(function () {
  1367. if ($(this).scrollTop() > 0) {
  1368. $('.scroller').fadeIn();
  1369. }
  1370. else {
  1371. $('.scroller').fadeOut();
  1372. }
  1373. });
  1374. $('.scroller').click(function () {
  1375. $('body,html').animate({
  1376. scrollTop: 0
  1377. }, 400);
  1378. if ($('.popup_tournamentGames').css('display') == 'block') {
  1379. $('.popup_tournamentGames').animate({
  1380. scrollTop: 0
  1381. }, 400);
  1382. }
  1383. return false;
  1384. });
  1385.  
  1386.  
  1387. });
  1388. function searchGame(text){
  1389. if(text==''){
  1390. $('.popup__gallery .main__item.preview').show();
  1391. return true;
  1392. }
  1393. var search=text.toLowerCase();
  1394. $.each($('.popup__gallery .main__item.preview'),function(){
  1395. var $title=$(this).find('.preview__title').html().toLowerCase();
  1396. $('.popup__gallery').perfectScrollbar('update');
  1397. if($title.indexOf(search)<0){
  1398. $(this).hide();
  1399. } else {
  1400. $(this).show();
  1401. }
  1402. })
  1403. }
  1404.  
  1405. // Script for xs header
  1406.  
  1407. $(function(){
  1408. $('.js-userpanel-button').on('click', function(){
  1409. $(this).toggleClass('user-toppanel__button_close');
  1410. $(this).toggleClass('js-userpanel-button-close');
  1411. $('.header__panel').toggleClass('open');
  1412. $('.header').toggleClass('header_panel-open');
  1413. $('.header__wrap').toggleClass('header__wrap_scroll');
  1414. $('.header__wrap_scroll').not('.ps-container').perfectScrollbar({
  1415. theme: 'hidden',
  1416. suppressScrollY: true,
  1417. scrollXMarginOffset: 5
  1418. // maxScrollbarLength: 213
  1419. });
  1420. $('.header__toppanel').toggleClass('open');
  1421. $('body, html').toggleClass('hidden');
  1422. });
  1423. });
  1424.  
  1425. $(function(){
  1426. $('.js-toppanel-button').on('click', function(){
  1427. $(this).toggleClass('toppanel__button_close');
  1428. $(this).toggleClass('js-toppanel-button-close');
  1429. $('.js-mobilenav-dropdown').toggleClass('open');
  1430. $('.header__toppanel').toggleClass('open');
  1431. $('body, html').toggleClass('hidden');
  1432. });
  1433. });
  1434.  
  1435.  
  1436. // Promo details script for xSmall screen
  1437.  
  1438. $(function(){
  1439. $('.js-promo-details-button').on('click', function(){
  1440. $('.promo-details__dropdown').slideToggle('fast').toggleClass('active');
  1441. });
  1442. });
  1443. //$(function() {
  1444. //if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
  1445. //$('html').addClass('Sa');
  1446. //}
  1447. //});
  1448.  
  1449. // Popup_gameplayGallery Close button positioning on mobile devices
  1450.  
  1451. //$(function() {
  1452. // $('.popup_gameplayGallery')
  1453. // .find('.popup__close')
  1454. // .css('top', $('.popup_gameplayGallery').find('.popup__content').height() + 80);
  1455. //});
  1456.  
  1457. $(function(){
  1458. if($('.finecountdown').length>0)
  1459. {
  1460. $('.finecountdown').each(function(){
  1461. var suma=$(this).data('sum').toString();
  1462. var i=k=0;
  1463.  
  1464. $(this).empty();
  1465. for(i=suma.length-1; i>=0; --i)
  1466. {
  1467. if($(this).hasClass('countdown')==true)
  1468. {
  1469. $(this).prepend('<span class="countdown__item js-countdown__item">'+suma[i]+'</span>');
  1470. if(++k%3==0 && k>0 && k<=suma.length-1)
  1471. $(this).prepend('<span class="countdown__divider"></span>');
  1472. }
  1473. else
  1474. {
  1475. $(this).prepend('<span class="js-countdown__item">'+suma[i]+'</span>');
  1476. if(++k%3==0 && k>0 && k<=suma.length-1)
  1477. $(this).prepend(' , ');
  1478. }
  1479.  
  1480.  
  1481. }
  1482. });
  1483. }
  1484. });
  1485.  
  1486. function get_cookie ( cookie_name )
  1487. {
  1488. var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
  1489.  
  1490. if ( results )
  1491. return ( unescape ( results[2] ) );
  1492. else
  1493. return null;
  1494. }
  1495.  
  1496. function delete_cookie ( cookie_name )
  1497. {
  1498. var cookie_date = new Date ( ); // Текущая дата и время
  1499. cookie_date.setTime ( cookie_date.getTime() - 1 );
  1500. document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
  1501. }
  1502.  
  1503. function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
  1504. {
  1505. var cookie_string = name + "=" + escape ( value );
  1506.  
  1507. if ( exp_y )
  1508. {
  1509. var expires = new Date ( exp_y, exp_m, exp_d );
  1510. cookie_string += "; expires=" + expires.toGMTString();
  1511. }
  1512.  
  1513. if ( path )
  1514. cookie_string += "; path=" + escape ( path );
  1515.  
  1516. if ( domain )
  1517. cookie_string += "; domain=" + escape ( domain );
  1518.  
  1519. if ( secure )
  1520. cookie_string += "; secure";
  1521.  
  1522. document.cookie = cookie_string;
  1523. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement