PageSourceSearch

https://salesdoubler.pro/wp-content/themes/salesdoubler/js-necessa…/app.js?rnd=7777&ver=1790869187

js salesdoubler.pro collected 2026-10-01 15:40:10 UTC 15,048 bytes, 537 lines download raw bytes

1// Save utm parameters to local storage from link (SDD-4358/SDD-5623)
2const queryString = window.location.search,
3  urlParams = new URLSearchParams(queryString),
4  utm_source = urlParams.get("utm_source"),
5  utm_medium = urlParams.get("utm_medium"),
6  utm_campaign = urlParams.get("utm_campaign"),
7  utm_content = urlParams.get("utm_content"),
8  utm_term = urlParams.get("utm_term");
9
10if (urlParams.has("utm_source")) {
11  localStorage.setItem("utm_source", utm_source);
12}
13if (urlParams.has("utm_medium")) {
14  localStorage.setItem("utm_medium", utm_medium);
15}
16if (urlParams.has("utm_campaign")) {
17  localStorage.setItem("utm_campaign", utm_campaign);
18}
19if (urlParams.has("utm_content")) {
20  localStorage.setItem("utm_content", utm_content);
21}
22if (urlParams.has("utm_term")) {
23  localStorage.setItem("utm_term", utm_term);
24}
25
26$(document).ready(function () {
27  // 	Fix mobile menu 100vh
28  function fixMobileMenu() {
29    let vh = window.innerHeight * 0.01;
30    document.documentElement.style.setProperty("--vh", `${vh}px`);
31  }
32  window.addEventListener("resize", () => {
33    fixMobileMenu();
34  });
35  fixMobileMenu();
36
37  //arrows to cursor
38  var mouseXY = {};
39  $(".gain-center").on("mousemove", function (event) {
40    mouseXY.X = event.pageX;
41    mouseXY.Y = event.pageY;
42    $(".arrow").each(function () {
43      $(this).addClass("transformed");
44    });
45  });
46  function mouseOut() {
47    $(".arrow").each(function () {
48      $(this).removeAttr("style");
49      $(this).removeClass("transformed");
50    });
51  }
52  $(document).on("mousemove", function (e) {
53    if ($(e.target).closest(".gain-center").length === 0) {
54      mouseOut();
55    }
56  });
57  $(".arrow").each(function () {
58    var iCow = $(this);
59    var prevXY = { X: null, Y: null };
60    var cowInterval = setInterval(function () {
61      if (
62        prevXY.Y != mouseXY.Y ||
63        (prevXY.X != mouseXY.X && (prevXY.Y != null || prevXY.X != null))
64      ) {
65        var cowXY = iCow.position();
66        var diffX = cowXY.left - mouseXY.X;
67        var diffY = cowXY.top - mouseXY.Y;
68        var tan = diffY / diffX;
69
70        var atan = (Math.atan(tan) * 180) / Math.PI;
71        if (diffY > 0 && diffX > 0) {
72          atan -= 180;
73        } else if (diffY < 0 && diffX > 0) {
74          atan += 180;
75        }
76
77        prevXY.X = mouseXY.X;
78        prevXY.Y = mouseXY.Y;
79        iCow.css({ transform: "rotate(" + atan + "deg)" });
80      }
81    }, 20);
82  });
83
84  //rotated circles
85  $(".circle").each(function () {
86    var dataX = $(this).attr("data-x");
87    var dataY = $(this).attr("data-y");
88    var dataRotate = $(this).attr("data-rotate");
89    $(".circle").on("mouseenter", function () {});
90  });
91
92  //lang menu
93  $(".lang a").click(function () {
94    var chooseLang = $(this).text();
95    var prevLang = $(this).closest(".lang").find("span").text();
96    $(this).closest(".lang").find("span").text(chooseLang);
97    $(this).text(prevLang);
98  });
99
100  $(".mob-nav .lang").click(function () {
101    $(this).toggleClass("opened");
102  });
103
104  //animate library
105  if (typeof AOS != "undefined") {
106    // AOS.init({ once: true });
107    AOS.init({ disable: true });
108  }
109
110  //social switcher
111  $(".switch").click(function () {
112    var inputText = $(this).attr("data-placeholder");
113    $(this)
114      .closest(".messenger")
115      .find(".form-control")
116      .attr("placeholder", inputText);
117  });
118
119  //theme switcher
120  if ($("body").hasClass("light")) {
121    $("#switcher").prop("checked", true);
122  } else {
123    $("#switcher").prop("checked", false);
124  }
125
126  //mob-nav
127  $(".hamburger").click(function () {
128    $(this).toggleClass("is-active");
129    $(".mob-nav").toggleClass("opened");
130    $("body").toggleClass("menu-opened");
131  });
132
133  //video-modal
134  $(".play-btn").click(function () {
135    var videoUrl = $(this).attr("data-src");
136    $(".video-modal iframe").attr("src", videoUrl + "?autoplay=1");
137  });
138  $(".modal").on("hidden.bs.modal", function () {
139    $(".video-modal iframe").attr("src", " ");
140  });
141
142  // radio
143  $(".vertical-radio").click(function () {
144    $(".vertical-radio").removeClass("active");
145    $(this).addClass("active");
146  });
147
148
149
150  // select
151  $(".js-select2").select2({
152    width: "100%",
153    closeOnSelect: false,
154    placeholder: "Выбрать",
155    allowHtml: true,
156    allowClear: true,
157    tags: false,
158    minimumResultsForSearch: -1,
159  });
160
161  $(".default-select").select2({
162    width: "resolve",
163    closeOnSelect: true,
164    allowHtml: false,
165    allowClear: false,
166    tags: false,
167    dropdownCssClass: "default-dropdown",
168  });
169
170  // disable SEARCH FIELD when opening and closing select2, only for some fields
171  $(".js-select2").on("select2:opening select2:closing", function () {
172    $(this).parent().find(".select2-search__field").prop("disabled", true);
173  });
174
175
176
177  // main-slider
178  function initSlickSlider(slider) {
179    $(".carousel")
180      .not(".unslick")
181      .each(function () {
182        var slickInduvidual = $(this);
183        var slideCount = null;
184        slickInduvidual.on("init", function (event, slick) {
185          slideCount = slick.slideCount;
186          setSlideCount();
187          setCurrentSlideNumber(slick.currentSlide);
188        });
189        slickInduvidual.on(
190          "beforeChange",
191          function (event, slick, currentSlide, nextSlide) {
192            setCurrentSlideNumber(nextSlide);
193            const imgActive = $(".slick-current");
194            imgActive.addClass("prepared");
195            setTimeout(function () {
196              imgActive.removeClass("prepared");
197            }, 2000);
198          },
199        );
200        slickInduvidual.slick({
201          infinite: true,
202          arrows: true,
203          autoplay: false,
204          autoplaySpeed: 3000,
205          // mobileFirst:true,
206          prevArrow:
207            "<button type='button' class='slick-prev pull-left'><img src='" +
208            window.my_wp_data.stylesheet_directory_uri +
209            "/img/arrow-chevron.svg' alt=''></button>",
210          nextArrow:
211            "<button type='button' class='slick-next pull-right'><img src='" +
212            window.my_wp_data.stylesheet_directory_uri +
213            "/img/arrow-chevron.svg' alt=''></button>",
214          fade: false,
215          slidesToShow: +$(this).attr("data-items-xl"),
216          slidesToScroll: +$(this).attr("data-scroll-xl"),
217
218          responsive: [
219            {
220              breakpoint: 1200,
221              settings: {
222                slidesToShow: +$(this).attr("data-items-xl"),
223                slidesToScroll: +$(this).attr("data-scroll-xl"),
224              },
225            },
226            {
227              breakpoint: 1200,
228              settings: {
229                slidesToShow: +$(this).attr("data-items-lg"),
230                slidesToScroll: +$(this).attr("data-scroll-lg"),
231              },
232            },
233            {
234              breakpoint: 992,
235              settings: {
236                slidesToShow: +$(this).attr("data-items-md"),
237                slidesToScroll: +$(this).attr("data-scroll-md"),
238                centerMode: false,
239                infinite: true,
240              },
241            },
242            {
243              breakpoint: 768,
244              settings: {
245                slidesToShow: +$(this).attr("data-items-sm"),
246                slidesToScroll: +$(this).attr("data-scroll-sm"),
247                variableWidth: false,
248                centerMode: false,
249                infinite: true,
250              },
251            },
252          ],
253        });
254
255        function setSlideCount() {
256          var $el = slickInduvidual.closest(".section").find(".to");
257          $el.text(slideCount > 9 ? slideCount : "0" + +slideCount);
258        }
259
260        function setCurrentSlideNumber(currentSlide) {
261          var $el = slickInduvidual.closest(".section").find(".from");
262          $el.text(
263            currentSlide > 8 ? currentSlide + 1 : "0" + +(currentSlide + 1),
264          );
265        }
266
267        $("button.prev").click(function () {
268          $(this).closest(".section").find(".carousel").slick("slickPrev");
269        });
270        $("button.next").click(function () {
271          $(this).closest(".section").find(".carousel").slick("slickNext");
272        });
273      });
274  }
275  initSlickSlider($(".carousel"));
276});
277
278var cursor = $(".cursor"),
279  follower = $(".cursor-follower");
280
281var posX = 0,
282  posY = 0,
283  mouseX = 0,
284  mouseY = 0;
285
286if (typeof TweenMax == "function") {
287  TweenMax.to({}, 0.016, {
288    repeat: -1,
289    onRepeat: function () {
290      posX += (mouseX - posX) / 9;
291      posY += (mouseY - posY) / 9;
292
293      TweenMax.set(follower, {
294        css: {
295          left: posX - 20,
296          top: posY - 20,
297        },
298      });
299
300      TweenMax.set(cursor, {
301        css: {
302          left: mouseX,
303          top: mouseY,
304        },
305      });
306    },
307  });
308}
309
310$(".slider-item__body").on("mousemove", function (e) {
311  mouseX = e.pageX;
312  mouseY = e.pageY;
313});
314
315$(".slider-item__body").on("mouseenter", function () {
316  cursor.addClass("active");
317  follower.addClass("active");
318});
319
320$(
321  ".slider-item__body .more, .slider-item .slider-item__body .slider-info .title",
322).on("mouseenter", function () {
323  cursor.removeClass("active");
324  follower.removeClass("active");
325});
326
327$(
328  ".slider-item__body .more, .slider-item .slider-item__body .slider-info .title",
329).on("mouseleave", function () {
330  cursor.addClass("active");
331  follower.addClass("active");
332});
333
334$(".slider-item__body").on("mouseleave", function () {
335  cursor.removeClass("active");
336  follower.removeClass("active");
337});
338
339const appHeight = () => {
340  const doc = document.documentElement;
341  doc.style.setProperty("--app-height", `${window.innerHeight}px`);
342};
343window.addEventListener("resize", appHeight);
344appHeight();
345
346//magnetic btn
347/*
348var magnets = document.querySelectorAll(".magnetic");
349var strength = 15;
350
351magnets.forEach((magnet) => {
352  magnet.addEventListener("mousemove", moveMagnet);
353  magnet.addEventListener("mouseout", function (event) {
354    TweenMax.to(event.currentTarget, 1, { x: 0, y: 0, ease: Power4.easeOut });
355  });
356});
357
358
359function moveMagnet(event) {
360  var magnetButton = event.currentTarget;
361  var bounding = magnetButton.getBoundingClientRect();
362
363  //console.log(magnetButton, bounding)
364
365  TweenMax.to(magnetButton, 1, {
366    x:
367      ((event.clientX - bounding.left) / magnetButton.offsetWidth - 0.1) *
368      strength,
369    y:
370      ((event.clientY - bounding.top) / magnetButton.offsetHeight - 0.1) *
371      strength,
372    ease: Power4.easeOut,
373  });
374}
375*/
376
377window.onscroll = function () {
378  myFunction();
379};
380var header = document.getElementById("header");
381var sticky = header.offsetTop;
382
383function myFunction() {
384  if (window.pageYOffset > sticky) {
385    header.classList.add("sticky");
386  } else {
387    header.classList.remove("sticky");
388  }
389}
390
391function setCookie(name, value, days) {
392  var expires = "";
393  if (days) {
394    var date = new Date();
395    date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
396    expires = "; expires=" + date.toUTCString();
397  }
398  document.cookie =
399    name + "=" + (value || "") + expires + "; path=/; domain=salesdoubler.pro";
400  // document.cookie = name + "=" + (value || "") + expires + "; path=/; domain=salesdoubler.net";
401}
402
403function getCookie(name) {
404  var nameEQ = name + "=";
405  var ca = document.cookie.split(";");
406  for (var i = 0; i < ca.length; i++) {
407    var c = ca[i];
408    while (c.charAt(0) == " ") c = c.substring(1, c.length);
409    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
410  }
411  return null;
412}
413
414function deleteCookie(name) {
415  document.cookie = name + "=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
416}
417
418function themeToggleMob() {
419  let theme = localStorage.getItem("theme") || "dark";
420
421  if (theme && theme === "light") {
422    localStorage.setItem("theme", "dark");
423    setCookie("themeState", "night", "365");
424    document.body.classList.remove("light");
425  } else {
426    localStorage.setItem("theme", "light");
427    setCookie("themeState", "day", "365");
428    document.body.classList.add("light");
429  }
430}
431
432// work function
433function themeToggle() {
434  let theme = localStorage.getItem("theme") || "dark";
435
436  if (theme && theme == "light") {
437    localStorage.setItem("theme", "dark");
438    setCookie("themeState", "night", "365");
439    document.body.classList.add("night");
440    document.body.classList.remove("light");
441  }
442
443  if (theme && theme == "dark") {
444    localStorage.setItem("theme", "light");
445    setCookie("themeState", "day", "365");
446    document.body.classList.add("light");
447    document.body.classList.remove("night");
448  }
449}
450
451(function () {
452  let theme = localStorage.getItem("theme") || "dark";
453
454  if (theme == "light") {
455    localStorage.setItem("theme", "light");
456    setCookie("themeState", "day", "365");
457    document.body.classList.add("light");
458    document.body.classList.remove("night");
459  } else {
460    localStorage.setItem("theme", "dark");
461    setCookie("themeState", "night", "365");
462    document.body.classList.add("light");
463    document.body.classList.remove("light");
464  }
465})();
466
467// phone mask
468if ($(".mask").length) {
469  $(".mask").inputmask("999 999 99 99", { placeholder: "___ ___ __ __" });
470}
471
472$(".mask").keypress(function (evt) {
473  var charCode = evt.charCode || evt.keyCode;
474  if (charCode == 32) {
475    return false;
476  }
477});
478
479/* from my.js */
480
481$("li.menu-item-has-children").addClass("submenu");
482$("li.menu-item-has-children.submenu > a").append(
483  '<span><img src="' +
484    window.my_wp_data.stylesheet_directory_uri +
485    '/img/chevron-down.svg" alt=""></span>',
486);
487
488$("li.menu-item-has-children.submenu")
489  .find("ul")
490  .wrap('<div class="submenu-wrapper"></div>');
491
492$("#mobile_menu li a").prepend(
493  '<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M34.0626 29.501L33.9998 2.00104L6.87901 2.06298" stroke="white" stroke-width="2"></path><path d="M33.997 2.00009L1.07541 35.0754" stroke="white" stroke-width="2"></path></svg>',
494);
495$("#mobile_menu li.menu-item-has-children ul a svg").remove();
496
497// Скролы для всех ссылок и блоков
498$('a[href^="#"]').on("click", function (e) {
499  id = $(this).attr("href");
500  if (id == "#") return true; //OFF empty links
501  if (id == "#resumeModal") return true; //OFF Modal
502  if ($(this).attr("role") === "tab") return true; //OFF tabs
503  if ($(this).attr("data-toggle") === "tab") return true; //OFF tabs
504
505  $block = $(id);
506  if ($block.length) {
507    e.preventDefault();
508    $("html, body").animate(
509      {
510        scrollTop: $block.offset().top - (id == "#s1" ? 120 : 80),
511      },
512      1000,
513    );
514  }
515});
516
517// Телефоны
518// $('form.wpcf7-form input[name="phone"]').inputmask("+380 99 999 99 99");
519
520// Fix mob Menu
521$(document).on("click", ".menu-column .title", function () {
522  $(this).toggleClass("active");
523  $(".menu-column ul").slideUp();
524  $(this).closest(".menu-column").find("ul").slideDown();
525});
526
527$(".vertical-radio span.checkmark").on("click", function () {
528  $(this).siblings("input").prop("checked", true);
529});
530
531// Fix blog class
532$("#top_menu li a").each(function () {
533  let href = $(this).attr("href");
534  if (href == location.href) {
535    $(this).parent("li").addClass("current-menu-item");
536  }
537});

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.