PageSourceSearch

https://svgssd.org/tenants/themes/black-lightning/assets/js/main.js?ver=1791593595

js svgssd.org collected 2026-10-10 00:53:31 UTC 7,097 bytes, 220 lines download raw bytes

1(function($) {
2  "use strict";
3
4  var varWindow = $(window);
5
6  // Css Function Js
7    const bgSelector = $("[data-bg-img]");
8    bgSelector.each(function (index, elem) {
9      let element = $(elem),
10        bgSource = element.data('bg-img');
11      element.css('background-image', 'url(' + bgSource + ')');
12    });
13
14  // Offcanvas Nav Js
15    var $offCanvasNav = $('.mobile-menu-items'),
16    $offCanvasNavSubMenu = $offCanvasNav.find('.sub-menu');
17    /*Add Toggle Button With Off Canvas Sub Menu*/
18    $offCanvasNavSubMenu.parent().prepend('<span class="mobile-menu-expand"></span>');
19    /*Close Off Canvas Sub Menu*/
20    $offCanvasNavSubMenu.slideUp();
21    /*Category Sub Menu Toggle*/
22    $offCanvasNav.on('click', 'li a, li .mobile-menu-expand, li .menu-title', function(e) {
23      var $this = $(this);
24      if($this.parent().attr('class')){
25          if (($this.parent().attr('class').match(/\b(menu-item-has-children|has-children|has-sub-menu)\b/)) && ($this.attr('href') === '#' || $this.hasClass('mobile-menu-expand'))) {
26            e.preventDefault();
27            if ($this.siblings('ul:visible').length) {
28              $this.parent('li').removeClass('active-expand');
29              $this.siblings('ul').slideUp();
30            } else {
31              $this.parent('li').addClass('active-expand');
32              $this.closest('li').siblings('li').find('ul:visible').slideUp();
33              $this.closest('li').siblings('li').removeClass('active-expand');
34              $this.siblings('ul').slideDown();
35            }
36          }
37        }
38      });
39
40      $( ".sub-menu" ).parent( "li" ).addClass( "menu-item-has-children" );
41
42  // Menu Activeion Js
43    var cururl = window.location.pathname;
44    var curpage = cururl.substr(cururl.lastIndexOf('/') + 1);
45    var hash = window.location.hash.substr(1);
46    if((curpage === "" || curpage === "/" || curpage === "admin") && hash === "")
47      {
48      } else {
49        $(".header-navigation li").each(function()
50      {
51        $(this).removeClass("active");
52      });
53      if(hash != "")
54        $(".header-navigation li a[href='"+hash+"']").parents("li").addClass("active");
55      else
56      $(".header-navigation li a[href='"+curpage+"']").parents("li").addClass("active");
57    }
58
59
60
61  // Testimonial Slider Js
62    var TestimonialSlider = new Swiper('.testimonial-slider-container', {
63      autoplay: false,
64      slidesPerView : 2,
65      slidesPerGroup: 1,
66      spaceBetween: 4,
67      speed: 500,
68      pagination: {
69        el: '.testimonial-swiper-pagination',
70        clickable: true,
71      },
72      breakpoints: {
73        1200: {
74          slidesPerView : 2,
75        },
76        768: {
77          slidesPerView : 2,
78        },
79        576: {
80          slidesPerView : 1,
81        },
82        480: {
83          slidesPerView : 1,
84        },
85        0: {
86          slidesPerView : 1,
87        },
88      }
89    });
90
91  // Post Slider Js
92    var swiper = new Swiper('.related-post-slider-container', {
93      slidesPerGroup: 1,
94      slidesPerView : 3,
95      speed: 500,
96      // loop: true,
97      spaceBetween: 60,
98      navigation: {
99        nextEl: '.related-post-swiper-btn-next',
100        prevEl: '.related-post-swiper-btn-prev',
101      },
102      breakpoints: {
103        1200: {
104          slidesPerView : 3,
105        },
106        992: {
107          slidesPerView : 3,
108          spaceBetween: 30,
109        },
110        576: {
111          slidesPerView : 2,
112          spaceBetween: 30,
113        },
114        480: {
115          slidesPerView : 1,
116          spaceBetween: 30,
117        },
118        0: {
119          slidesPerView : 1,
120          spaceBetween: 30,
121        },
122      }
123    });
124
125  /* Feature BG Shape */
126    function feature () {
127      const bgValue = 'M67.5,0A67.5,67.5,0,1,1,0,67.5,67.5,67.5,0,0,1,67.5,0Z',
128        bgViewBox = '0 0 135 135',
129      bgHoverValue = 'M66.446,1.63C85.636-1.952,102.739.177,114.92,9.941c12.2,9.423,19.483,26.48,19.505,44.854-.064,18.452-9.378,31.183-21.7,43.107-12.572,11.353-28.155,21.9-46.449,22.791C29.557,121.613.345,96.354,0,59.188-.2,23.056,28.053,11.414,66.446,1.63',
130      bgHoverViewBox = '0 0 134 120',
131      features = document.querySelectorAll('.feature-item')
132      features.forEach(function(feature){
133        const bgSvg = feature.querySelector('.bg')
134        feature.addEventListener('mouseover', function() {
135          bgSvg.firstElementChild.setAttribute('d', bgHoverValue)
136          bgSvg.setAttribute('viewBox', bgHoverViewBox)
137        })
138        feature.addEventListener('mouseout', function() {
139          bgSvg.firstElementChild.setAttribute('d', bgValue)
140          bgSvg.setAttribute('viewBox', bgViewBox)
141        })
142      })
143    }
144    feature()
145
146  // Svg Inject Js
147    SVGInject(document.querySelectorAll(".svg-inject"));
148
149  // Ajax Contact Form JS
150    var form = $('#contact-form');
151    var formMessages = $('.form-message');
152    $(form).submit(function(e) {
153      e.preventDefault();
154      var formData = form.serialize();
155      $.ajax({
156        type: 'POST',
157        url: form.attr('action'),
158        data: formData
159      }).done(function(response) {
160        // Make sure that the formMessages div has the 'success' class.
161        $(formMessages).removeClass('alert alert-danger');
162        $(formMessages).addClass('alert alert-success fade show');
163
164        // Set the message text.
165        formMessages.html("<button type='button' class='btn-close' data-bs-dismiss='alert'>&times;</button>");
166        formMessages.append(response);
167
168        // Clear the form.
169        $('#contact-form input,#contact-form textarea').val('');
170      }).fail(function(data) {
171        // Make sure that the formMessages div has the 'error' class.
172        $(formMessages).removeClass('alert alert-success');
173        $(formMessages).addClass('alert alert-danger fade show');
174
175        // Set the message text.
176        if (data.responseText === '') {
177          formMessages.html("<button type='button' class='btn-close' data-bs-dismiss='alert'>&times;</button>");
178          formMessages.append(data.responseText);
179        } else {
180          $(formMessages).text('Oops! An error occurred and your message could not be sent.');
181        }
182      });
183    });
184
185  // scrollToTop Js
186    function scrollToTop() {
187    var $scrollUp = $('#scroll-to-top'),
188      $lastScrollTop = 0,
189      $window = $(window);
190      $window.on('scroll', function () {
191      var st = $(this).scrollTop();
192        if (st > $lastScrollTop) {
193            $scrollUp.removeClass('show');
194        } else {
195          if ($window.scrollTop() > 250) {
196            $scrollUp.addClass('show');
197          } else {
198            $scrollUp.removeClass('show');
199          }
200        }
201        $lastScrollTop = st;
202    });
203    $scrollUp.on('click', function (evt) {
204      $('html, body').animate({scrollTop: 0}, 50);
205      evt.preventDefault();
206    });
207  }
208  scrollToTop();
209  varWindow.on('scroll', function(){
210    if($('.sticky-header').length){
211      var windowpos = $(this).scrollTop();
212      if (windowpos >= 50) {
213        $('.sticky-header').addClass('sticky');
214      } else {
215        $('.sticky-header').removeClass('sticky');
216      }
217    }
218  });
219
220})(window.jQuery);

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.