1(function ($) { 2 "use strict"; 3 4 var WidgetDefaultHandler = function ($scope) { 5 // if ($scope.find(".wow").length) { 6 // var wow = new WOW({ 7 // boxClass: "wow", // animated element css class (default is wow) 8 // animateClass: "animated", // animation css class (default is animated) 9 // mobile: true, // trigger animations on mobile devices (default is true) 10 // live: true // act on asynchronously loaded content (default is true) 11 // }); 12 // wow.init(); 13 // } 14 15 let mainSliderTwoImage = $scope.find(".main-slider-two__img"); 16 if (mainSliderTwoImage.length) { 17 mainSliderTwoImage.tilt({ 18 maxTilt: 5, 19 scale: 1, 20 perspective: 700, 21 speed: 1000 22 }); 23 } 24 25 let tabsBox = $scope.find(".tabs-box"); 26 if (tabsBox.length) { 27 tabsBox.find(".tab-buttons .tab-btn").on("click", function (e) { 28 e.preventDefault(); 29 var target = $($(this).attr("data-tab")); 30 31 if ($(target).is(":visible")) { 32 return false; 33 } else { 34 target 35 .parents(".tabs-box") 36 .find(".tab-buttons") 37 .find(".tab-btn") 38 .removeClass("active-btn"); 39 $(this).addClass("active-btn"); 40 target 41 .parents(".tabs-box") 42 .find(".tabs-content") 43 .find(".tab") 44 .fadeOut(0); 45 target 46 .parents(".tabs-box") 47 .find(".tabs-content") 48 .find(".tab") 49 .removeClass("active-tab"); 50 $(target).fadeIn(300); 51 $(target).addClass("active-tab"); 52 } 53 }); 54 } 55 56 let thmSwiperSliders = $scope.find(".thm-swiper__slider"); 57 if (thmSwiperSliders.length) { 58 thmSwiperSliders.each(function () { 59 let elm = $(this); 60 let options = elm.data("swiper-options"); 61 let thmSwiperSlider = new Swiper( 62 elm, 63 "object" === typeof options ? options : JSON.parse(options) 64 ); 65 }); 66 } 67 68 let thmOwlCarousels = $scope.find(".thm-owl__carousel"); 69 if (thmOwlCarousels.length) { 70 thmOwlCarousels.each(function () { 71 let elm = $(this); 72 let options = elm.data("owl-options"); 73 let thmOwlCarousel = elm.owlCarousel( 74 "object" === typeof options ? options : JSON.parse(options) 75 ); 76 }); 77 } 78 79 let thmOwlNavCarousels = $scope.find(".thm-owl__carousel--custom-nav"); 80 if (thmOwlNavCarousels.length) { 81 thmOwlNavCarousels.each(function () { 82 let elm = $(this); 83 let owlNavPrev = elm.data("owl-nav-prev"); 84 let owlNavNext = elm.data("owl-nav-next"); 85 $(owlNavPrev).on("click", function (e) { 86 elm.trigger("prev.owl.carousel"); 87 e.preventDefault(); 88 }); 89 90 $(owlNavNext).on("click", function (e) { 91 elm.trigger("next.owl.carousel"); 92 e.preventDefault(); 93 }); 94 }); 95 } 96 97 //Single Item Carousel 98 let singleItemCarousel = $scope.find(".single-item-carousel"); 99 if (singleItemCarousel.length) { 100 singleItemCarousel.owlCarousel({ 101 loop: true, 102 margin: 30, 103 nav: true, 104 smartSpeed: 500, 105 autoplay: 5000, 106 autoplayHoverPause: true, 107 autoplayTimeout: 5000, 108 navText: [ 109 '<span class="icon fa fa-angle-left"></span>', 110 '<span class="icon fa fa-angle-right"></span>' 111 ], 112 responsive: { 113 0: { 114 items: 1 115 }, 116 600: { 117 items: 1 118 }, 119 800: { 120 items: 1 121 }, 122 1024: { 123 items: 1 124 } 125 } 126 }); 127 } 128 129 let circleProgress = $scope.find(".circle-progress"); 130 if (circleProgress.length) { 131 circleProgress.appear(function () { 132 let circleProgressItem = $(".circle-progress"); 133 circleProgressItem.each(function () { 134 let progress = $(this); 135 let progressOptions = progress.data("options"); 136 progress.circleProgress(progressOptions); 137 }); 138 }); 139 } 140 141 // News Two Carousel 142 var blogCarousel = $(".blog-two__carousel"); 143 144 if (blogCarousel.length) { 145 var nextBtn = $(".blog-two__carousel__custom-nav .left-btn"); 146 var prevBtn = $(".blog-two__carousel__custom-nav .right-btn"); 147 blogCarousel.owlCarousel({ 148 loop: true, 149 margin: 30, 150 nav: true, 151 smartSpeed: 500, 152 autoHeight: false, 153 autoplay: true, 154 dots: false, 155 autoplayTimeout: 10000, 156 navText: [ 157 '<span class="icon-left-arrow"></span>', 158 '<span class="icon-right-arrow"></span>' 159 ], 160 responsive: { 161 0: { 162 items: 1 163 }, 164 600: { 165 items: 1 166 }, 167 992: { 168 items: 3 169 }, 170 1024: { 171 items: 3 172 }, 173 1200: { 174 items: 3 175 } 176 } 177 }); 178 nextBtn.on("click", function (e) { 179 e.preventDefault(); 180 blogCarousel.trigger("next.owl.carousel", [500]); 181 }); 182 prevBtn.on("click", function (e) { 183 e.preventDefault(); 184 blogCarousel.trigger("prev.owl.carousel", [500]); 185 }); 186 } 187 188 let videoPopup = $scope.find(".video-popup"); 189 if (videoPopup.length) { 190 videoPopup.magnificPopup({ 191 type: "iframe", 192 mainClass: "mfp-fade", 193 removalDelay: 160, 194 preloader: true,
195 fixedContentPos: false 196 }); 197 } 198 199 let imgPopup = $scope.find(".img-popup"); 200 if (imgPopup.length) { 201 var groups = {}; 202 imgPopup.each(function () { 203 var id = parseInt($(this).attr("data-group"), 10); 204 205 if (!groups[id]) { 206 groups[id] = []; 207 } 208 209 groups[id].push(this); 210 }); 211 212 $.each(groups, function () { 213 $(this).magnificPopup({ 214 type: "image", 215 closeOnContentClick: true, 216 closeBtnInside: false, 217 gallery: { 218 enabled: true 219 } 220 }); 221 }); 222 } 223 224 // Popular Causes Progress Bar 225 let countBar = $scope.find(".count-bar"); 226 if (countBar.length) { 227 countBar.appear( 228 function () { 229 var el = $(this); 230 var percent = el.data("percent"); 231 $(el).css("width", percent).addClass("counted"); 232 }, { 233 accY: -50 234 } 235 ); 236 } 237 238 //Fact Counter + Text Count 239 let countBox = $scope.find(".count-box"); 240 if (countBox.length) { 241 countBox.appear( 242 function () { 243 var $t = $(this), 244 n = $t.find(".count-text").attr("data-stop"), 245 r = parseInt($t.find(".count-text").attr("data-speed"), 10); 246 247 if (!$t.hasClass("counted")) { 248 $t.addClass("counted"); 249 $({ 250 countNum: $t.find(".count-text").text() 251 }).animate({ 252 countNum: n 253 }, { 254 duration: r, 255 easing: "linear", 256 step: function () { 257 $t.find(".count-text").text(Math.floor(this.countNum)); 258 }, 259 complete: function () { 260 $t.find(".count-text").text(this.countNum); 261 } 262 }); 263 } 264 }, { 265 accY: 0 266 } 267 ); 268 } 269 270 //Jquery Knob animation 271 let dial = $scope.find(".dial"); 272 if (dial.length) { 273 dial.appear( 274 function () { 275 var elm = $(this); 276 var color = elm.attr("data-fgColor"); 277 var perc = elm.attr("value"); 278 var thickness = elm.attr("data-thickness"); 279 280 elm.knob({ 281 value: 0, 282 min: 0, 283 max: 100, 284 skin: "tron", 285 readOnly: true, 286 thickness: thickness, 287 dynamicDraw: true, 288 displayInput: false 289 }); 290 291 $({ 292 value: 0 293 }).animate({ 294 value: perc 295 }, { 296 duration: 2000, 297 easing: "swing", 298 progress: function () { 299 elm.val(Math.ceil(this.value)).trigger("change"); 300 } 301 }); 302 }, { 303 accY: 0 304 } 305 ); 306 } 307 308 var odo = $scope.find(".odometer"); 309 if (odo.length) { 310 odo.each(function () { 311 $(this).appear(function () { 312 var countNumber = $(this).attr("data-count"); 313 $(this).html(countNumber); 314 }); 315 }); 316 } 317 318 var odoB = $scope.find(".odometer-brackers"); 319 if (odoB.length) { 320 odoB.each(function () { 321 $(this).appear(function () { 322 var countNumber = $(this).attr("data-count"); 323 $(this).html(countNumber); 324 }); 325 }); 326 } 327 328 //Progress Bar / Levels 329 var ProgessBar = $scope.find(".progress-levels .progress-box .bar-fill"); 330 if (ProgessBar.length) { 331 $(".progress-box .bar-fill").each( 332 function () { 333 $(".progress-box .bar-fill").appear(function () { 334 var progressWidth = $(this).attr("data-percent"); 335 $(this).css("width", progressWidth + "%"); 336 }); 337 }, { 338 accY: 0 339 } 340 ); 341 } 342 343 var PostFilter = $scope.find(".post-filter"); 344 if (PostFilter.length) { 345 var postFilterList = $(".post-filter li"); 346 // for first init 347 $(".filter-layout").isotope({ 348 filter: ".filter-item", 349 animationOptions: { 350 duration: 500, 351 easing: "linear", 352 queue: false 353 } 354 }); 355 // on click filter links 356 postFilterList.on("click", function () { 357 var Self = $(this); 358 var selector = Self.attr("data-filter"); 359 postFilterList.removeClass("active"); 360 Self.addClass("active"); 361 362 $(".filter-layout").isotope({ 363 filter: selector, 364 animationOptions: { 365 duration: 500, 366 easing: "linear", 367 queue: false 368 } 369 }); 370 return false; 371 }); 372 } 373 374 }; 375 376 var WidgetTestimonialHandler = function ($scope) { 377 if ($("#testimonials-one__thumb").length) { 378 let testimonialsThumb = new Swiper("#testimonials-one__thumb", { 379 slidesPerView: 4, 380 spaceBetween: 0, 381 speed: 1400, 382 watchSlidesVisibility: true, 383 watchSlidesProgress: true, 384 loop: true, 385 autoplay: { 386 delay: 5000 387 } 388 }); 389
390 let testimonialsCarousel = new Swiper("#testimonials-one__carousel", { 391 observer: true, 392 observeParents: true, 393 speed: 1400, 394 mousewheel: false, 395 slidesPerView: 1, 396 autoplay: { 397 delay: 5000 398 }, 399 thumbs: { 400 swiper: testimonialsThumb 401 }, 402 pagination: { 403 el: '#testimonials-one__carousel-pagination', 404 type: 'bullets', 405 clickable: true 406 }, 407 }); 408 } 409 410 411 }; 412 413 var WidgetFaqHandler = function ($scope) { 414 // Accrodion 415 if ($scope.find(".accrodion-grp").length) { 416 var accrodionGrp = $scope.find(".accrodion-grp"); 417 accrodionGrp.each(function () { 418 var accrodionName = $(this).data("grp-name"); 419 var Self = $(this); 420 var accordion = Self.find(".accrodion"); 421 Self.addClass(accrodionName); 422 Self.find(".accrodion .accrodion-content").hide(); 423 Self.find(".accrodion.active").find(".accrodion-content").show(); 424 accordion.each(function () { 425 $(this) 426 .find(".accrodion-title") 427 .on("click", function () { 428 if ($(this).parent().hasClass("active") === false) { 429 $(".accrodion-grp." + accrodionName) 430 .find(".accrodion") 431 .removeClass("active"); 432 $(".accrodion-grp." + accrodionName) 433 .find(".accrodion") 434 .find(".accrodion-content") 435 .slideUp(); 436 $(this).parent().addClass("active"); 437 $(this).parent().find(".accrodion-content").slideDown(); 438 } 439 }); 440 }); 441 }); 442 } 443 }; 444 445 var WidgetPortfolioHandler = function ($scope) { 446 if ($scope.find(".post-filter").length) { 447 var postFilterList = $(".post-filter li"); 448 // for first init 449 $(".filter-layout").isotope({ 450 filter: ".filter-item", 451 animationOptions: { 452 duration: 500, 453 easing: "linear", 454 queue: false 455 } 456 }); 457 // on click filter links 458 postFilterList.on("click", function () { 459 var Self = $(this); 460 var selector = Self.attr("data-filter"); 461 postFilterList.removeClass("active"); 462 Self.addClass("active"); 463 464 $(".filter-layout").isotope({ 465 filter: selector, 466 animationOptions: { 467 duration: 500, 468 easing: "linear", 469 queue: false 470 } 471 }); 472 return false; 473 }); 474 } 475 476 if ($(".post-filter.has-dynamic-filter-counter").length) { 477 var activeFilterItem = $(".post-filter.has-dynamic-filter-counter").find( 478 "li" 479 ); 480 481 activeFilterItem.each(function () { 482 var filterElement = $(this).data("filter"); 483 var count = $(".filter-layout").find(filterElement).length; 484 $(this).append("<sup>[" + count + "]</sup>"); 485 }); 486 } 487 }; 488 489 var WidgetFooterSubscribeHandler = function ($scope) { 490 // mailchimp form 491 if ($scope.find(".mc-form").length) { 492 $(".mc-form").each(function () { 493 var Self = $(this); 494 var mcURL = Self.data("url"); 495 var mcResp = Self.parent().find(".mc-form__response"); 496 497 Self.ajaxChimp({ 498 url: mcURL, 499 callback: function (resp) { 500 // appending response 501 mcResp.append(function () { 502 return '<p class="mc-message">' + resp.msg + "</p>"; 503 }); 504 // making things based on response 505 if (resp.result === "success") { 506 // Do stuff 507 Self.removeClass("errored").addClass("successed"); 508 mcResp.removeClass("errored").addClass("successed"); 509 Self.find("input").val(""); 510 511 mcResp.find("p").fadeOut(10000); 512 } 513 if (resp.result === "error") { 514 Self.removeClass("successed").addClass("errored"); 515 mcResp.removeClass("successed").addClass("errored"); 516 Self.find("input").val(""); 517 518 mcResp.find("p").fadeOut(10000); 519 } 520 } 521 }); 522 }); 523 } 524 }; 525 526 //elementor front start 527 $(window).on("elementor/frontend/init", function () { 528 elementorFrontend.hooks.addAction( 529 "frontend/element_ready/widget", 530 WidgetDefaultHandler 531 ); 532 533 elementorFrontend.hooks.addAction( 534 "frontend/element_ready/airslv-testimonials.default", 535 WidgetTestimonialHandler 536 ); 537 538 elementorFrontend.hooks.addAction( 539 "frontend/element_ready/airslv-faq.default", 540 WidgetFaqHandler 541 ); 542 543 elementorFrontend.hooks.addAction( 544 "frontend/element_ready/airslv-portfolio.default", 545 WidgetPortfolioHandler 546 ); 547 548 elementorFrontend.hooks.addAction( 549 "frontend/element_ready/footer-subscribe.default", 550 WidgetFooterSubscribeHandler 551 ); 552 });
553})(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.