PageSourceSearch

https://stratego.ru/wp-content/themes/make-progress-3/assets/js/custom.js?ver=1.0.0

js stratego.ru collected 2026-10-08 22:44:06 UTC 6,190 bytes, 238 lines download raw bytes

1const swiperFeedback = document.querySelector('.feedback-list'),
2  swiperCpt = document.querySelector('.cpt-slider'),
3  homeCounter = document.querySelector('.benefits');
4
5// карусель для отзывов
6if (swiperFeedback) {
7  let feedSlider = new Swiper(swiperFeedback, {
8    autoHeight: true,
9    slidesPerView: 1,
10    slidesPerGroup: 1,
11    speed: 600,
12    spaceBetween:30,
13 
14    breakpoints: {
15      800: {
16        slidesPerView: 2,
17        slidesPerGroup: 2,
18      }
19    },
20
21  pagination: {
22    el: ".swiper-pagination",
23    clickable: true
24  },
25
26    navigation: {
27      nextEl: '.feedback-nav__next',
28      prevEl: '.feedback-nav__prev',
29    }
30  });
31}
32 
33// слайдер в карточках продуктов и услуг
34if (swiperCpt) {
35  let cptSlider = new Swiper(swiperCpt, {
36    loop: true,
37    preloadImages: false,
38    //lazy: true,
39    slidesPerView: 1,
40    spaceBetween: 40,
41    speed: 600,
42    navigation: {
43      nextEl: ".cpt-nav__next",
44      prevEl: '.cpt-nav__prev',
45    }
46  });
47}
48
49
50/*
51 ===============================================================
52 * подключаем lazyload, поп-ап, моб меню
53 =============================================================================
54 */
55jQuery(document).ready(function ($) {
56
57  // lazyload
58  $(window).lazyLoadXT({
59    edgeY: 100,
60    srcAttr: 'data-src',
61  });
62
63
64  $(window).on('ajaxComplete', function () {
65    setTimeout(function () {
66      $(window).lazyLoadXT();
67    }, 50);
68  });
69
70
71  // мобильное меню
72  var $trigger = $(".mobile-menu-btn, .mobile-overlay");
73  $trigger.on("click", function () {
74    var body = $(".body");
75    $trigger.toggleClass("is-active");
76    $('.mobile-overlay').toggleClass("is-open");
77    $('.mobile-nav').toggleClass("is-open");
78    $(body).toggleClass("disable-scroll");
79  });
80
81
82  // дочернее меню в мобильном
83  $('.mobile-menu .sub-menu').parent().click(function (e) {
84    var submenu = $(this).children('.sub-menu');
85    if ($(submenu).is(':hidden')) {
86      $(submenu).slideToggle();
87    } else {
88      $(submenu).slideToggle();
89    }
90    e.stopPropagation();
91  });
92
93
94  // поп-ап
95  $('.open_modal').click(function () {
96    var popup_id = $('#' + $(this).attr("rel"));
97    var overlay = $(".modal-overlay");
98    var body = $(".body");
99    $(popup_id).addClass("is-open");
100    $(overlay).addClass("is-open");
101    $(body).addClass("disable-scroll");
102  });
103
104  // закрываем поп-ап
105  $('.modal-overlay, .modal__close').click(function () {
106    var body = $(".body");
107    $('.modal-overlay, .modal').removeClass("is-open");
108    $(body).removeClass("disable-scroll");
109  });
110
111  // Кнопка скроллинга в Постере
112  var $root = $('html, body');
113  $('a[href^="#start-scrolling"]').click(function () {
114  $root.animate({
115  scrollTop: $( $.attr(this, 'href') ).offset().top
116  },'slow');
117  return false;
118  });
119
120  // кнопка Вверх
121  $(window).scroll(function () {
122    if ($(this).scrollTop() > 200) {
123      $(".back2top").addClass("is-active");
124    } else {
125      $(".back2top").removeClass("is-active");
126    }
127  });
128
129
130  // Аккордеон на Главной
131  $(function () {
132    $('.faq-accordion__title').click(function (j) {
133
134      var dropDown = $(this).closest('.faq-accordion__item').find('.faq-accordion__content');
135      $(this).closest('.faq-accordion').find('.faq-accordion__content').not(dropDown).slideUp(350);
136
137      if ($(this).hasClass('is-shown')) {
138        $(this).removeClass('is-shown');
139      } else {
140        $(this).closest('.faq-accordion').find('.faq-accordion__title.is-shown').removeClass('is-shown');
141        $(this).addClass('is-shown');
142      }
143
144      dropDown.stop(false, true).slideToggle(350);
145      j.preventDefault();
146    });
147  });
148
149
150  // Счетчик в преимуществах на Главной
151  if (homeCounter) {
152    function isScrolledIntoView(elem) {
153      var docViewTop = $(window).scrollTop();
154      var docViewBottom = docViewTop + $(window).height();
155      var elemTop = $(elem).offset().top;
156      var elemBottom = elemTop + $(elem).height();
157      return ((elemBottom <= docViewBottom));
158    }
159
160    function countUp() {
161      $('.benefits__num').each(function () {
162        var $this = $(this), // <- Don't touch this variable. It's pure magic.
163          countTo = $this.attr('data-count');
164        ended = $this.attr('ended');
165
166        if (ended != "true" && isScrolledIntoView($this)) {
167          $({ countNum: $this.text() }).animate({
168            countNum: countTo
169          },
170            {
171              duration: 2000, 
172              easing: 'swing',
173              step: function () {
174                $this.text(Math.floor(this.countNum));
175              },
176              complete: function () {
177                $this.text(this.countNum);
178              }
179            });
180          $this.attr('ended', 'true');
181        }
182      });
183    }
184
185    if (isScrolledIntoView(".benefits__num")) {
186      countUp();
187    }
188
189    $(document).scroll(function () {
190      if (isScrolledIntoView(".benefits__num")) {
191        countUp();
192      }
193    });
194}
195
196
197// поставить / снять чекбокс в форме отправки сообщений и комментариях
198  $(function () {
199    var chekBox = $('.form-checkbox__input');
200    var subBtn = $('.comment-form .submit');
201    var body = $('.body');
202    $(subBtn).attr('disabled', 'true');
203    
204    // отключаем блокировку кнопки для залогиненного юзера
205   if ($(body).hasClass("logged-in")) {
206     $(subBtn).removeAttr('disabled');
207   }
208   
209    $(chekBox).click(function () {
210      if ($(chekBox).is(':checked')) {
211        $(subBtn).removeAttr('disabled');
212      } else {
213        $(subBtn).attr('disabled', 'true');
214      }
215    });
216  });
217
218
219  $(function () {
220   // кнопка вверх
221   $(".back2top").click(function () {
222    $('html, body').animate({ scrollTop: 0 }, 'slow');
223    return false;
224  });
225});
226
227
228$(function () {
229// прилепляем текстовую часть FAQ при скролле
230  $(".faq-descr").theiaStickySidebar({
231    additionalMarginTop:60,
232    additionalMarginBottom: 60
233  });
234});
235
236});
237
238// EOF

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.