PageSourceSearch

https://www.zionfoods.in/assets/js/ogenix.js

js zionfoods.in collected 2026-09-30 23:04:14 UTC 29,629 bytes, 1,057 lines download raw bytes

1(function ($) {
2  "use strict";
3
4
5
6  function thmSwiperInit() {
7    // swiper slider
8    if ($(".thm-swiper__slider").length) {
9      $(".thm-swiper__slider").each(function () {
10        let elm = $(this);
11        let options = elm.data('swiper-options');
12        let thmSwiperSlider = new Swiper(elm, options);
13      });
14    }
15
16  }
17
18
19
20  function thmOwlInit() {
21    // owl slider
22
23    if ($(".thm-owl__carousel").length) {
24      $(".thm-owl__carousel").each(function () {
25        let elm = $(this);
26        let options = elm.data('owl-options');
27        let thmOwlCarousel = elm.owlCarousel(options);
28      });
29    }
30
31    if ($(".thm-owl__carousel--custom-nav").length) {
32      $(".thm-owl__carousel--custom-nav").each(function () {
33        let elm = $(this);
34        let owlNavPrev = elm.data('owl-nav-prev');
35        let owlNavNext = elm.data('owl-nav-next');
36        $(owlNavPrev).on("click", function (e) {
37          elm.trigger('prev.owl.carousel');
38          e.preventDefault();
39        })
40
41        $(owlNavNext).on("click", function (e) {
42          elm.trigger('next.owl.carousel');
43          e.preventDefault();
44        })
45      });
46    }
47
48
49  }
50
51
52  // Price Filter
53  function priceFilter() {
54    if ($(".price-ranger").length) {
55      $(".price-ranger #slider-range").slider({
56        range: true,
57        min: 50,
58        max: 500,
59        values: [11, 300],
60        slide: function (event, ui) {
61          $(".price-ranger .ranger-min-max-block .min").val(
62            "$" + ui.values[0]
63          );
64          $(".price-ranger .ranger-min-max-block .max").val(
65            "$" + ui.values[1]
66          );
67        },
68      });
69      $(".price-ranger .ranger-min-max-block .min").val(
70        "$" + $(".price-ranger #slider-range").slider("values", 0)
71      );
72      $(".price-ranger .ranger-min-max-block .max").val(
73        "$" + $(".price-ranger #slider-range").slider("values", 1)
74      );
75    }
76  }
77
78
79
80  //=== CountDownTimer===
81  if ($('.time-countdown').length) {
82    $('.time-countdown').each(function () {
83      var Self = $(this);
84      var countDate = Self.data('countdown-time'); // getting date
85
86      Self.countdown(countDate, function (event) {
87        $(this).html('<h2>' + event.strftime('%D : %H : %M : %S') + '</h2>');
88      });
89    });
90  };
91  if ($('.time-countdown-two').length) {
92    $('.time-countdown-two').each(function () {
93      var Self = $(this);
94      var countDate = Self.data('countdown-time'); // getting date
95
96      Self.countdown(countDate, function (event) {
97        $(this).html('<li> <div class="box"> <span class="days">' + event.strftime('%D') + '</span> <span class="timeRef">days</span> </div> </li> <li> <div class="box"> <span class="hours">' + event.strftime('%H') + '</span> <span class="timeRef clr-1">hours</span> </div> </li> <li> <div class="box"> <span class="minutes">' + event.strftime('%M') + '</span> <span class="timeRef clr-2">minutes</span> </div> </li> <li> <div class="box"> <span class="seconds">' + event.strftime('%S') + '</span> <span class="timeRef clr-3">seconds</span> </div> </li>');
98      });
99    });
100  };
101
102
103  // Cart Touch Spin
104  if ($(".quantity-spinner").length) {
105    $("input.quantity-spinner").TouchSpin({
106      verticalbuttons: true,
107    });
108  }
109
110
111  // custom coursor
112  if ($(".custom-cursor").length) {
113
114    var cursor = document.querySelector('.custom-cursor__cursor');
115    var cursorinner = document.querySelector('.custom-cursor__cursor-two');
116    var a = document.querySelectorAll('a');
117
118    document.addEventListener('mousemove', function (e) {
119      var x = e.clientX;
120      var y = e.clientY;
121      cursor.style.transform = `translate3d(calc(${e.clientX}px - 50%), calc(${e.clientY}px - 50%), 0)`
122    });
123
124    document.addEventListener('mousemove', function (e) {
125      var x = e.clientX;
126      var y = e.clientY;
127      cursorinner.style.left = x + 'px';
128      cursorinner.style.top = y + 'px';
129    });
130
131    document.addEventListener('mousedown', function () {
132      cursor.classList.add('click');
133      cursorinner.classList.add('custom-cursor__innerhover')
134    });
135
136    document.addEventListener('mouseup', function () {
137      cursor.classList.remove('click')
138      cursorinner.classList.remove('custom-cursor__innerhover')
139    });
140
141    a.forEach(item => {
142      item.addEventListener('mouseover', () => {
143        cursor.classList.add('custom-cursor__hover');
144      });
145      item.addEventListener('mouseleave', () => {
146        cursor.classList.remove('custom-cursor__hover');
147      });
148    })
149  }
150
151
152  if ($(".listing-details__contact-info-phone").length) {
153    $(".listing-details__contact-info-phone").on("click", function (e) {
154      e.preventDefault();
155      var textElement = $(this).find(".text h5");
156      var mainText = textElement.data("number");
157      var toggleText = textElement.data("toggle-number");
158      if (textElement.text() == mainText) {
159        textElement.text(toggleText);
160      } else {
161        textElement.text(mainText);
162      }
163    });
164  }
165
166
167
168  if ($(".listing-top__map-show-hide").length) {
169    $(".listing-top__map-show-hide").on("click", function () {
170      $(this).toggleClass("hidden");
171      var textElement = $(this).find(".listing-top__map-show-hide-text span");
172      if (textElement.text() == textElement.data("text")) {
173        textElement.text(textElement.data("toggle-text"));
174      } else {
175        textElement.text(textElement.data("text"));
176      }
177      $(".listing__map").toggleClass("hidden");
178      $(".listing__content").toggleClass("hidden");
179    });
180  }
181
182
183
184
185  if ($("#datepicker").length) {
186    $("#datepicker").datepicker();
187  }
188
189  if ($("#datepicker2").length) {
190    $("#datepicker2").datepicker();
191  }
192
193  if ($("#datepicker-inline").length) {
194    $("#datepicker-inline").datepicker();
195  }
196
197  $('input[name="time"]').ptTimeSelect();
198
199  if ($(".banner-bg-slide").length) {
200    $(".banner-bg-slide").each(function () {
201      var Self = $(this);
202      var bgSlideOptions = Self.data("options");
203      var bannerTwoSlides = Self.vegas(bgSlideOptions);
204    });
205  }
206
207  //Pricing Tabs
208  if ($(".pricing-tabs").length) {
209    $(".pricing-tabs .tab-btns .tab-btn").on("click", function (e) {
210      e.preventDefault();
211      var target = $($(this).attr("data-tab"));
212
213      if ($(target).hasClass("actve-tab")) {
214        return false;
215      } else {
216        $(".pricing-tabs .tab-btns .tab-btn").removeClass("active-btn");
217        $(this).addClass("active-btn");
218        $(".pricing-tabs .pr-content .pr-tab").removeClass("active-tab");
219        $(target).addClass("active-tab");
220      }
221    });
222  }
223
224  // Type Effect
225  if ($(".typed-effect").length) {
226    $(".typed-effect").each(function () {
227      var typedStrings = $(this).data("strings");
228      var typedTag = $(this).attr("id");
229      var typed = new Typed("#" + typedTag, {
230        typeSpeed: 100,
231        backSpeed: 100,
232        fadeOut: true,
233        loop: true,
234        strings: typedStrings.split(",")
235      });
236    });
237  }
238
239  // Popular Causes Progress Bar
240  if ($(".count-bar").length) {
241    $(".count-bar").appear(
242      function () {
243        var el = $(this);
244        var percent = el.data("percent");
245        $(el).css("width", percent).addClass("counted");
246      }, {
247        accY: -50
248      }
249    );
250  }
251
252  //Progress Bar / Levels
253  if ($(".progress-levels .progress-box .bar-fill").length) {
254    $(".progress-box .bar-fill").each(
255      function () {
256        $(".progress-box .bar-fill").appear(function () {
257          var progressWidth = $(this).attr("data-percent");
258          $(this).css("width", progressWidth + "%");
259        });
260      }, {
261        accY: 0
262      }
263    );
264  }
265
266  //Fact Counter + Text Count
267  if ($(".count-box").length) {
268    $(".count-box").appear(
269      function () {
270        var $t = $(this),
271          n = $t.find(".count-text").attr("data-stop"),
272          r = parseInt($t.find(".count-text").attr("data-speed"), 10);
273
274        if (!$t.hasClass("counted")) {
275          $t.addClass("counted");
276          $({
277            countNum: $t.find(".count-text").text()
278          }).animate({
279            countNum: n
280          }, {
281            duration: r,
282            easing: "linear",
283            step: function () {
284              $t.find(".count-text").text(Math.floor(this.countNum));
285            },
286            complete: function () {
287              $t.find(".count-text").text(this.countNum);
288            }
289          });
290        }
291      }, {
292        accY: 0
293      }
294    );
295  }
296
297  // Accrodion
298  if ($(".accrodion-grp").length) {
299    var accrodionGrp = $(".accrodion-grp");
300    accrodionGrp.each(function () {
301      var accrodionName = $(this).data("grp-name");
302      var Self = $(this);
303      var accordion = Self.find(".accrodion");
304      Self.addClass(accrodionName);
305      Self.find(".accrodion .accrodion-content").hide();
306      Self.find(".accrodion.active").find(".accrodion-content").show();
307      accordion.each(function () {
308        $(this)
309          .find(".accrodion-title")
310          .on("click", function () {
311            if ($(this).parent().hasClass("active") === false) {
312              $(".accrodion-grp." + accrodionName)
313                .find(".accrodion")
314                .removeClass("active");
315              $(".accrodion-grp." + accrodionName)
316                .find(".accrodion")
317                .find(".accrodion-content")
318                .slideUp();
319              $(this).parent().addClass("active");
320              $(this).parent().find(".accrodion-content").slideDown();
321            }
322          });
323      });
324    });
325  }
326
327
328  if ($(".scroll-to-target").length) {
329    $(".scroll-to-target").on("click", function () {
330      var target = $(this).attr("data-target");
331      // animate
332      $("html, body").animate({
333          scrollTop: $(target).offset().top
334        },
335        1000
336      );
337
338      return false;
339    });
340  }
341
342
343  if ($(".contact-form-validated").length) {
344    $(".contact-form-validated").validate({
345      // initialize the plugin
346      rules: {
347        name: {
348          required: true
349        },
350        email: {
351          required: true,
352          email: true
353        },
354        message: {
355          required: true
356        },
357        subject: {
358          required: true
359        }
360      },
361      submitHandler: function (form) {
362        // sending value with ajax request
363        $.post(
364          $(form).attr("action"),
365          $(form).serialize(),
366          function (response) {
367            $(form).parent().find(".result").append(response);
368            $(form).find('input[type="text"]').val("");
369            $(form).find('input[type="email"]').val("");
370            $(form).find("textarea").val("");
371          }
372        );
373        return false;
374      }
375    });
376  }
377
378  // mailchimp form
379  if ($(".mc-form").length) {
380    $(".mc-form").each(function () {
381      var Self = $(this);
382      var mcURL = Self.data("url");
383      var mcResp = Self.parent().find(".mc-form__response");
384
385      Self.ajaxChimp({
386        url: mcURL,
387        callback: function (resp) {
388          // appending response
389          mcResp.append(function () {
390            return '<p class="mc-message">' + resp.msg + "</p>";
391          });
392          // making things based on response
393          if (resp.result === "success") {
394            // Do stuff
395            Self.removeClass("errored").addClass("successed");
396            mcResp.removeClass("errored").addClass("successed");
397            Self.find("input").val("");
398
399            mcResp.find("p").fadeOut(10000);
400          }
401          if (resp.result === "error") {
402            Self.removeClass("successed").addClass("errored");
403            mcResp.removeClass("successed").addClass("errored");
404            Self.find("input").val("");
405
406            mcResp.find("p").fadeOut(10000);
407          }
408        }
409      });
410    });
411  }
412
413  if ($(".video-popup").length) {
414    $(".video-popup").magnificPopup({
415      type: "iframe",
416      mainClass: "mfp-fade",
417      removalDelay: 160,
418      preloader: true,
419
420      fixedContentPos: false
421    });
422  }
423
424  if ($(".img-popup").length) {
425    var groups = {};
426    $(".img-popup").each(function () {
427      var id = parseInt($(this).attr("data-group"), 10);
428
429      if (!groups[id]) {
430        groups[id] = [];
431      }
432
433      groups[id].push(this);
434    });
435
436    $.each(groups, function () {
437      $(this).magnificPopup({
438        type: "image",
439        closeOnContentClick: true,
440        closeBtnInside: false,
441        gallery: {
442          enabled: true
443        }
444      });
445    });
446  }
447
448  function dynamicCurrentMenuClass(selector) {
449    let FileName = window.location.href.split("/").reverse()[0];
450
451    selector.find("li").each(function () {
452      let anchor = $(this).find("a");
453      if ($(anchor).attr("href") == FileName) {
454        $(this).addClass("current");
455      }
456    });
457    // if any li has .current elmnt add class
458    selector.children("li").each(function () {
459      if ($(this).find(".current").length) {
460        $(this).addClass("current");
461      }
462    });
463    // if no file name return
464    if ("" == FileName) {
465      selector.find("li").eq(0).addClass("current");
466    }
467  }
468
469  if ($(".main-menu__list").length) {
470    // dynamic current class
471    let mainNavUL = $(".main-menu__list");
472    dynamicCurrentMenuClass(mainNavUL);
473  }
474  if ($(".service-details__sidebar-service-list").length) {
475    // dynamic current class
476    let mainNavUL = $(".service-details__sidebar-service-list");
477    dynamicCurrentMenuClass(mainNavUL);
478  }
479
480  if ($(".main-menu__list").length && $(".mobile-nav__container").length) {
481    let navContent = document.querySelector(".main-menu__list").outerHTML;
482    let mobileNavContainer = document.querySelector(".mobile-nav__container");
483    mobileNavContainer.innerHTML = navContent;
484  }
485  if ($(".sticky-header__content").length) {
486    let navContent = document.querySelector(".main-menu").innerHTML;
487    let mobileNavContainer = document.querySelector(".sticky-header__content");
488    mobileNavContainer.innerHTML = navContent;
489  }
490
491  if ($(".mobile-nav__container .main-menu__list").length) {
492    let dropdownAnchor = $(
493      ".mobile-nav__container .main-menu__list .dropdown > a"
494    );
495    dropdownAnchor.each(function () {
496      let self = $(this);
497      let toggleBtn = document.createElement("BUTTON");
498      toggleBtn.setAttribute("aria-label", "dropdown toggler");
499      toggleBtn.innerHTML = "<i class='fa fa-angle-down'></i>";
500      self.append(function () {
501        return toggleBtn;
502      });
503      self.find("button").on("click", function (e) {
504        e.preventDefault();
505        let self = $(this);
506        self.toggleClass("expanded");
507        self.parent().toggleClass("expanded");
508        self.parent().parent().children("ul").slideToggle();
509      });
510    });
511  }
512
513  if ($(".mobile-nav__toggler").length) {
514    $(".mobile-nav__toggler").on("click", function (e) {
515      e.preventDefault();
516      $(".mobile-nav__wrapper").toggleClass("expanded");
517      $("body").toggleClass("locked");
518    });
519  }
520
521  if ($(".search-toggler").length) {
522    $(".search-toggler").on("click", function (e) {
523      e.preventDefault();
524      $(".search-popup").toggleClass("active");
525      $(".mobile-nav__wrapper").removeClass("expanded");
526      $("body").toggleClass("locked");
527    });
528  }
529
530  if ($(".odometer").length) {
531    var odo = $(".odometer");
532    odo.each(function () {
533      $(this).appear(function () {
534        var countNumber = $(this).attr("data-count");
535        $(this).html(countNumber);
536      });
537    });
538  }
539
540  if ($(".dynamic-year").length) {
541    let date = new Date();
542    $(".dynamic-year").html(date.getFullYear());
543  }
544
545  if ($(".wow").length) {
546    var wow = new WOW({
547      boxClass: "wow", // animated element css class (default is wow)
548      animateClass: "animated", // animation css class (default is animated)
549      mobile: true, // trigger animations on mobile devices (default is true)
550      live: true // act on asynchronously loaded content (default is true)
551    });
552    wow.init();
553  }
554
555  if ($("#donate-amount__predefined").length) {
556    let donateInput = $("#donate-amount");
557    $("#donate-amount__predefined")
558      .find("li")
559      .on("click", function (e) {
560        e.preventDefault();
561        let amount = $(this).find("a").text();
562        donateInput.val(amount);
563        $("#donate-amount__predefined").find("li").removeClass("active");
564        $(this).addClass("active");
565      });
566  }
567
568  if ($(".thm-accordion").length) {
569    let accordionWrapper = $(".thm-accordion");
570    accordionWrapper.each(function () {
571      let $this = $(this);
572      let accordionID = $this.attr("id");
573      let accordionTitle = $this.find(".thm-accordion__title");
574      $this.addClass(accordionID);
575      // default hide
576      let mainAccordionContent = $this.find(".thm-accordion__content").hide();
577      $this.find(".active-item .thm-accordion__content").show();
578      // on title click
579      accordionTitle.on("click", function (e) {
580        e.preventDefault();
581        let $this = $(this);
582        let accordionItem = $(this).parent();
583        if (false === accordionItem.hasClass("active-item")) {
584          $("#" + accordionID)
585            .find(".thm-accordion__item")
586            .removeClass("active-item");
587          accordionItem.addClass("active-item");
588          mainAccordionContent.slideUp();
589          accordionItem.find(".thm-accordion__content").slideDown();
590        }
591      });
592    });
593  }
594
595  $(".add").on("click", function () {
596    if ($(this).prev().val() < 999) {
597      $(this)
598        .prev()
599        .val(+$(this).prev().val() + 1);
600    }
601  });
602  $(".sub").on("click", function () {
603    if ($(this).next().val() > 1) {
604      if ($(this).next().val() > 1)
605        $(this)
606        .next()
607        .val(+$(this).next().val() - 1);
608    }
609  });
610
611  if ($(".tabs-box").length) {
612    $(".tabs-box .tab-buttons .tab-btn").on("click", function (e) {
613      e.preventDefault();
614      var target = $($(this).attr("data-tab"));
615
616      if ($(target).is(":visible")) {
617        return false;
618      } else {
619        target
620          .parents(".tabs-box")
621          .find(".tab-buttons")
622          .find(".tab-btn")
623          .removeClass("active-btn");
624        $(this).addClass("active-btn");
625        target
626          .parents(".tabs-box")
627          .find(".tabs-content")
628          .find(".tab")
629          .fadeOut(0);
630        target
631          .parents(".tabs-box")
632          .find(".tabs-content")
633          .find(".tab")
634          .removeClass("active-tab");
635        $(target).fadeIn(300);
636        $(target).addClass("active-tab");
637      }
638    });
639  }
640
641  if ($(".range-slider-price").length) {
642    var priceRange = document.getElementById("range-slider-price");
643
644    noUiSlider.create(priceRange, {
645      start: [30, 150],
646      limit: 200,
647      behaviour: "drag",
648      connect: true,
649      range: {
650        min: 10,
651        max: 200
652      }
653    });
654
655    var limitFieldMin = document.getElementById("min-value-rangeslider");
656    var limitFieldMax = document.getElementById("max-value-rangeslider");
657
658    priceRange.noUiSlider.on("update", function (values, handle) {
659      (handle ? $(limitFieldMax) : $(limitFieldMin)).text(values[handle]);
660    });
661  }
662
663
664
665
666
667
668
669
670
671
672
673  function thmTinyInit() {
674    // tiny slider
675    const tinyElm = document.querySelectorAll(".thm-tiny__slider");
676    tinyElm.forEach(function (tinyElm) {
677      const tinyOptions = JSON.parse(tinyElm.dataset.tinyOptions);
678      let thmTinySlider = tns(tinyOptions);
679    });
680  }
681
682
683
684
685
686  if ($("#project-one__thumb").length) {
687    let testimonialsThumb = new Swiper("#project-one__thumb", {
688      slidesPerView: 4,
689      spaceBetween: 16,
690      speed: 1400,
691      watchSlidesVisibility: true,
692      watchSlidesProgress: true,
693      loop: true,
694      autoplay: {
695        delay: 5000
696      }
697    });
698
699    let testimonialsCarousel = new Swiper("#project-one__carousel", {
700      observer: true,
701      observeParents: true,
702      loop: true,
703      speed: 1400,
704      mousewheel: true,
705      slidesPerView: 1,
706      spaceBetween: 72,
707      autoplay: {
708        delay: 5000
709      },
710      thumbs: {
711        swiper: testimonialsThumb
712      },
713      pagination: {
714        el: '#testimonials-one__carousel-pagination',
715        type: 'bullets',
716        clickable: true
717      },
718
719      "navigation": {
720        "nextEl": "#project-one__swiper-button-next",
721        "prevEl": "#project-one__swiper-button-prev"
722      },
723
724    });
725  }
726
727  // ===Portfolio===
728  function projectMasonaryLayout() {
729    if ($(".masonary-layout").length) {
730      $(".masonary-layout").isotope({
731        layoutMode: "masonry"
732      });
733    }
734    if ($(".post-filter").length) {
735      $(".post-filter li")
736        .children(".filter-text")
737        .on("click", function () {
738          var Self = $(this);
739          var selector = Self.parent().attr("data-filter");
740          $(".post-filter li").removeClass("active");
741          Self.parent().addClass("active");
742          $(".filter-layout").isotope({
743            filter: selector,
744            animationOptions: {
745              duration: 500,
746              easing: "linear",
747              queue: false
748            }
749          });
750          return false;
751        });
752    }
753
754    if ($(".post-filter.has-dynamic-filters-counter").length) {
755      // var allItem = $('.single-filter-item').length;
756      var activeFilterItem = $(".post-filter.has-dynamic-filters-counter").find(
757        "li"
758      );
759      activeFilterItem.each(function () {
760        var filterElement = $(this).data("filter");
761        var count = $(".filter-layout").find(filterElement).length;
762        $(this)
763          .children(".filter-text")
764          .append('<span class="count">' + count + "</span>");
765      });
766    }
767  }
768
769
770  // ===Checkout Payment===
771  if ($(".checkout__payment__title").length) {
772
773    $(".checkout__payment__item").find('.checkout__payment__content').hide();
774    $(".checkout__payment__item--active").find('.checkout__payment__content').show();
775
776    $(".checkout__payment__title").on("click", function (e) {
777      e.preventDefault();
778
779
780      $(this).parents('.checkout__payment').find('.checkout__payment__item').removeClass("checkout__payment__item--active");
781      $(this).parents(".checkout__payment").find(".checkout__payment__content").slideUp();
782
783      $(this).parent().addClass("checkout__payment__item--active");
784      $(this).parent().find(".checkout__payment__content").slideDown();
785
786    })
787  }
788
789  //Single Vertical Carousel
790  if ($('.single-vertical-carousel').length) {
791    $('.single-vertical-carousel').slick({
792      dots: true,
793      autoplay: false,
794      loop: true,
795      autoplaySpeed: 5000,
796      infinite: true,
797      responsive: true,
798      slidesToShow: 2,
799      vertical: true,
800      slidesToScroll: 1,
801      prevArrow: "<div class='prev-btn'><span class='fa fa-angle-up'></span></div>",
802      nextArrow: "<div class='next-btn'><span class='fa fa-angle-down'></span></div>"
803    });
804  }
805
806
807
808
809  if ($(".circle-progress").length) {
810    $(".circle-progress").appear(function () {
811      let circleProgress = $(".circle-progress");
812      circleProgress.each(function () {
813        let progress = $(this);
814        let progressOptions = progress.data("options");
815        progress.circleProgress(progressOptions);
816      });
817    });
818  }
819
820  function SmoothMenuScroll() {
821    var anchor = $(".scrollToLink");
822    if (anchor.length) {
823      anchor.children("a").bind("click", function (event) {
824        if ($(window).scrollTop() > 10) {
825          var headerH = "90";
826        } else {
827          var headerH = "90";
828        }
829        var target = $(this);
830        $("html, body")
831          .stop()
832          .animate({
833              scrollTop: $(target.attr("href")).offset().top - headerH + "px"
834            },
835            1200,
836            "easeInOutExpo"
837          );
838        anchor.removeClass("current");
839        anchor.removeClass("current-menu-ancestor");
840        anchor.removeClass("current_page_item");
841        anchor.removeClass("current-menu-parent");
842        target.parent().addClass("current");
843        event.preventDefault();
844      });
845    }
846  }
847  SmoothMenuScroll();
848
849  function OnePageMenuScroll() {
850    var windscroll = $(window).scrollTop();
851    if (windscroll >= 117) {
852      var menuAnchor = $(".one-page-scroll-menu .scrollToLink").children("a");
853      menuAnchor.each(function () {
854        var sections = $(this).attr("href");
855        $(sections).each(function () {
856          if ($(this).offset().top <= windscroll + 100) {
857            var Sectionid = $(sections).attr("id");
858            $(".one-page-scroll-menu").find("li").removeClass("current");
859            $(".one-page-scroll-menu").find("li").removeClass("current-menu-ancestor");
860            $(".one-page-scroll-menu").find("li").removeClass("current_page_item");
861            $(".one-page-scroll-menu").find("li").removeClass("current-menu-parent");
862            $(".one-page-scroll-menu")
863              .find("a[href*=\\#" + Sectionid + "]")
864              .parent()
865              .addClass("current");
866          }
867        });
868      });
869    } else {
870      $(".one-page-scroll-menu li.current").removeClass("current");
871      $(".one-page-scroll-menu li:first").addClass("current");
872    }
873  }
874
875
876  // window load event
877
878  $(window).on("load", function () {
879    if ($(".preloader").length) {
880      $(".preloader").fadeOut();
881    }
882    thmSwiperInit();
883    thmOwlInit();
884    projectMasonaryLayout();
885    priceFilter()
886
887
888    if ($(".curved-circle--item").length) {
889      $(".curved-circle--item").circleType();
890    }
891
892    //Jquery Spinner / Quantity Spinner
893    if ($('.quantity-spinner').length) {
894      $("input.quantity-spinner").TouchSpin({
895        verticalbuttons: true
896      });
897    }
898
899
900
901    if ($(".post-filter").length) {
902      var postFilterList = $(".post-filter li");
903      // for first init
904      $(".filter-layout").isotope({
905        filter: ".filter-item",
906        animationOptions: {
907          duration: 500,
908          easing: "linear",
909          queue: false
910        }
911      });
912      // on click filter links
913      postFilterList.on("click", function () {
914        var Self = $(this);
915        var selector = Self.attr("data-filter");
916        postFilterList.removeClass("active");
917        Self.addClass("active");
918
919        $(".filter-layout").isotope({
920          filter: selector,
921          animationOptions: {
922            duration: 500,
923            easing: "linear",
924            queue: false
925          }
926        });
927        return false;
928      });
929    }
930
931    if ($(".post-filter.has-dynamic-filter-counter").length) {
932      // var allItem = $('.single-filter-item').length;
933
934      var activeFilterItem = $(".post-filter.has-dynamic-filter-counter").find(
935        "li"
936      );
937
938      activeFilterItem.each(function () {
939        var filterElement = $(this).data("filter");
940        var count = $(".filter-layout").find(filterElement).length;
941        $(this).append("<sup>[" + count + "]</sup>");
942      });
943    }
944
945    //Testimonials Two
946    if ($(".listing-details__gallery .bxslider").length) {
947      $(".listing-details__gallery .bxslider").bxSlider({
948        nextSelector: ".listing-details__gallery #slider-next",
949        prevSelector: ".listing-details__gallery #slider-prev",
950        nextText: '<i class="icon-right-arrow1"></i>',
951        prevText: '<i class="icon-right-arrow1 icon-prev"></i>',
952        mode: "horizontal",
953        auto: "true",
954        speed: "1000",
955        pagerCustom: ".listing-details__gallery .slider-pager .listing-details__thumb-box"
956      });
957    }
958
959
960
961    if ($("#testimonials-one__thumb").length) {
962      let testimonialsThumb = new Swiper("#testimonials-one__thumb", {
963        slidesPerView: 4,
964        spaceBetween: 0,
965        speed: 1400,
966        watchSlidesVisibility: true,
967        watchSlidesProgress: true,
968        loop: true,
969        autoplay: {
970          delay: 5000
971        }
972      });
973
974      let testimonialsCarousel = new Swiper("#testimonials-one__carousel", {
975        observer: true,
976        observeParents: true,
977        speed: 1400,
978        mousewheel: true,
979        slidesPerView: 1,
980        autoplay: {
981          delay: 5000
982        },
983        thumbs: {
984          swiper: testimonialsThumb
985        },
986        pagination: {
987          el: '#testimonials-one__carousel-pagination',
988          type: 'bullets',
989          clickable: true
990        },
991      });
992    }
993
994
995
996
997
998
999
1000
1001
1002
1003
1004  });
1005
1006  // window scroll event
1007
1008  $(window).on("scroll", function () {
1009    if ($(".stricked-menu").length) {
1010      var headerScrollPos = 130;
1011      var stricky = $(".stricked-menu");
1012      if ($(window).scrollTop() > headerScrollPos) {
1013        stricky.addClass("stricky-fixed");
1014      } else if ($(this).scrollTop() <= headerScrollPos) {
1015        stricky.removeClass("stricky-fixed");
1016      }
1017    }
1018    if ($(".scroll-to-top").length) {
1019      var strickyScrollPos = 100;
1020      if ($(window).scrollTop() > strickyScrollPos) {
1021        $(".scroll-to-top").fadeIn(500);
1022      } else if ($(this).scrollTop() <= strickyScrollPos) {
1023        $(".scroll-to-top").fadeOut(500);
1024      }
1025    }
1026
1027    OnePageMenuScroll();
1028
1029  });
1030
1031  if ($(".before-after-twentytwenty").length) {
1032    $(".before-after-twentytwenty").each(function () {
1033      var Self = $(this);
1034      var objName = Self.attr("id");
1035      $("#" + objName).twentytwenty();
1036
1037      // hack for bs tab
1038      $(document).on("shown.bs.tab", 'a[data-toggle="tab"]', function (e) {
1039        var paneTarget = $(e.target).attr("data-target");
1040        var $thePane = $(".tab-pane" + paneTarget);
1041        var twentyTwentyContainer = "#" + objName;
1042        var twentyTwentyHeight = $thePane.find(twentyTwentyContainer).height();
1043        if (0 === twentyTwentyHeight) {
1044          $thePane.find(twentyTwentyContainer).trigger("resize");
1045        }
1046      });
1047    });
1048  }
1049
1050  $('select:not(.ignore)').niceSelect();
1051
1052})(jQuery);
1053
1054
1055
1056
1057

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.