1(function ($) { 2 "use strict"; 3 var GaviasElements = { 4 init: function(){ 5 GaviasElements.initDebouncedresize(); 6 elementorFrontend.hooks.addAction('frontend/element_ready/gva-heading-block.default', GaviasElements.elementHeadingBlock); 7 elementorFrontend.hooks.addAction('frontend/element_ready/gva-testimonials.default', GaviasElements.elementTestimonial); 8 elementorFrontend.hooks.addAction('frontend/element_ready/gva-testimonials-carousel.default', GaviasElements.elementTestimonial); 9 elementorFrontend.hooks.addAction('frontend/element_ready/gva-posts.default', GaviasElements.elementPosts); 10 elementorFrontend.hooks.addAction('frontend/element_ready/gva-portfolio.default', GaviasElements.elementPortfolio); 11 elementorFrontend.hooks.addAction('frontend/element_ready/gva-gallery.default', GaviasElements.elementGallery); 12 elementorFrontend.hooks.addAction('frontend/element_ready/gva-events.default', GaviasElements.elementEvents); 13 elementorFrontend.hooks.addAction('frontend/element_ready/gva-brand.default', GaviasElements.elementBrand); 14 elementorFrontend.hooks.addAction('frontend/element_ready/gva-counter.default', GaviasElements.elementCounter); 15 elementorFrontend.hooks.addAction('frontend/element_ready/gva-services-group.default', GaviasElements.elementServices); 16 elementorFrontend.hooks.addAction('frontend/element_ready/gva-countdown.default', GaviasElements.elementCountDown); 17 elementorFrontend.hooks.addAction('frontend/element_ready/gva-video-carousel.default', GaviasElements.elementVideoCarousel); 18 elementorFrontend.hooks.addAction('frontend/element_ready/gva-user.default', GaviasElements.elementUser); 19 elementorFrontend.hooks.addAction('frontend/element_ready/gva-circle-progress.default', GaviasElements.elementCircleProgress); 20 21 elementorFrontend.hooks.addAction('frontend/element_ready/gva_icon_box_group.default', GaviasElements.elementInitCarousel); 22 elementorFrontend.hooks.addAction('frontend/element_ready/gva-content-carousel.default', GaviasElements.elementInitCarousel); 23 elementorFrontend.hooks.addAction('frontend/element_ready/gva-team.default', GaviasElements.elementInitCarousel); 24 25 elementorFrontend.hooks.addAction('frontend/element_ready/gva-product.default', GaviasElements.elementInitCarousel); 26 27 elementorFrontend.hooks.addAction('frontend/element_ready/gva-listings.default', GaviasElements.elementInitCarousel); 28 elementorFrontend.hooks.addAction('frontend/element_ready/gva-listings-banner-group.default', GaviasElements.elementInitCarousel); 29 elementorFrontend.hooks.addAction('frontend/element_ready/gva-all-listing.default', GaviasElements.elementAllListing); 30 elementorFrontend.hooks.addAction('frontend/element_ready/gva-archive-listing.default', GaviasElements.elementArchiveListing); 31 elementorFrontend.hooks.addAction('frontend/element_ready/gva-slider-property.default', GaviasElements.elementPropertySlider); 32 elementorFrontend.hooks.addAction('frontend/element_ready/gva-location-image.default', GaviasElements.elementLocationImage); 33 elementorFrontend.hooks.addAction('frontend/element_ready/gva-gallery-property.default', GaviasElements.elementInitCarousel); 34 elementorFrontend.hooks.addAction('frontend/element_ready/gva-search-listing.default', GaviasElements.elementSearchListing); 35 36 elementorFrontend.hooks.addAction('frontend/element_ready/gva-image-accordion.default', GaviasElements.elementImageAccordion); 37 38 elementorFrontend.hooks.addAction('frontend/element_ready/column', GaviasElements.elementColumn); 39 40 }, 41 backend: function(){ 42 elementor.settings.page.addChangeCallback( 'homirx_post_preview', GaviasElements.handlePostPreview); 43 }, 44 handlePostPreview: function(doc_preview_post_id){ 45 elementor.saver.update({ 46 onSuccess: function onSuccess() { 47 window.location.reload(); 48 } 49 }); 50 window.location.reload(); 51 }, 52 53 initDebouncedresize: function(){ 54 var $event = $.event, 55 $special, resizeTimeout; 56 $special = $event.special.debouncedresize = { 57 setup: function () { 58 $(this).on("resize", $special.handler); 59 }, 60 teardown: function () { 61 $(this).off("resize", $special.handler); 62 }, 63 handler: function (event, execAsap) { 64 var context = this, 65 args = arguments, 66 dispatch = function () { 67 event.type = "debouncedresize";
68 $event.dispatch.apply(context, args); 69 }; 70 71 if (resizeTimeout) { 72 clearTimeout(resizeTimeout); 73 } 74 75 execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold); 76 }, 77 threshold: 150 78 }; 79 }, 80 81 elementColumn: function($scope){ 82 83 if(($scope).hasClass('gv-sidebar-offcanvas')){ 84 var html = '<div class="control-mobile">'; 85 html += '<a class="control-mobile-link" href="#"><i class="fa-solid fa-bars"></i>Show Sidebar<a>'; 86 html += '</div>'; 87 $scope.append(html); 88 89 html = '<span class="filter-top"><a href="#" class="btn-close-filter"><i class="fas fa-times"></i></a></span>'; 90 $scope.children('.elementor-column-wrap, .elementor-widget-wrap').children('.elementor-widget-wrap').prepend(html); 91 } 92 93 var _body = $('body'); 94 var _sidebar = $scope; 95 96 $($scope).find('.control-mobile, .btn-close-filter').on('click', function(e){ 97 e.preventDefault(); 98 if(_body.hasClass('open-el-sidebar-offcanvas')){ 99 _sidebar.removeClass('open'); 100 setTimeout(function(){ 101 _body.removeClass('open-el-sidebar-offcanvas'); 102 }, 200); 103 }else{ 104 _sidebar.addClass('open'); 105 _body.addClass('open-el-sidebar-offcanvas'); 106 } 107 }); 108 }, 109 110 elementPostArchive: function($scope){ 111 112 var $container = $scope.find('.post-masonry-style'); 113 $container.imagesLoaded( function(){ 114 $container.masonry({ 115 itemSelector : '.item-masory', 116 gutterWidth: 0, 117 columnWidth: 1, 118 }); 119 }); 120 }, 121 122 elementTestimonial: function($scope){ 123 var $carousel = $scope.find('.init-carousel-swiper'); 124 GaviasElements.initCarousel($carousel); 125 }, 126 127 elementPosts: function($scope){ 128 var $carousel = $scope.find('.init-carousel-swiper'); 129 GaviasElements.initCarousel($carousel); 130 }, 131 132 elementServices: function($scope){ 133 var $carousel = $scope.find('.init-carousel-swiper'); 134 GaviasElements.initCarousel($carousel); 135 }, 136 137 elementPortfolio: function($scope){ 138 var $carousel = $scope.find('.init-carousel-swiper'); 139 GaviasElements.initCarousel($carousel); 140 if( $.fn.isotope ){ 141 if($('.isotope-items').length){ 142 $( '.isotope-items' ).each(function() { 143 var $el = $( this ), 144 $filter = $( '.portfolio-filter a'), 145 $loop = $( this ); 146 147 $loop.isotope(); 148 149 $(window).load(function() { 150 $loop.isotope( 'layout' ); 151 }); 152 153 if ( $filter.length > 0 ) { 154 $filter.on( 'click', function( e ) { 155 e.preventDefault(); 156 var $a = $(this); 157 $filter.removeClass( 'active' ); 158 $a.addClass( 'active' ); 159 $loop.isotope({ filter: $a.data( 'filter' ) }); 160 }); 161 }; 162 }); 163 } 164 }; 165 166 }, 167 168 elementGallery: function($scope){ 169 var $carousel = $scope.find('.init-carousel-swiper'); 170 GaviasElements.initCarousel($carousel); 171 }, 172 173 elementEvents: function($scope){ 174 var $carousel = $scope.find('.init-carousel-swiper'); 175 GaviasElements.initCarousel($carousel); 176 }, 177 178 elementBrand: function($scope){ 179 var $carousel = $scope.find('.init-carousel-swiper'); 180 GaviasElements.initCarousel($carousel); 181 }, 182 183 elementCounter: function($scope){ 184 var $block = $scope.find('.milestone-block'); 185 $block.appear(function() { 186 var $endNum = parseInt(jQuery(this).find('.milestone-number').text()); 187 jQuery(this).find('.milestone-number').countTo({ 188 from: 0, 189 to: $endNum, 190 speed: 4000, 191 refreshInterval: 60, 192 formatter: function (value, options) { 193 value = value.toFixed(options.decimals); 194 value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ','); 195 return value; 196 } 197 }); 198 },{accX: 0, accY: 0}); 199 }, 200 201 elementCountDown: function($scope){ 202 $('[data-countdown="countdown"]').each(function(index, el) { 203 var $this = $(this); 204 var $date = $this.data('date').split("-"); 205 $this.gvaCountDown({ 206 TargetDate:$date[0]+"/"+$date[1]+"/"+$date[2]+" "+$date[3]+":"+$date[4]+":"+$date[5], 207 DisplayFormat:"<div class=\"countdown-times\"><div class=\"day\">%%D%% <span class=\"label\">Days</span> </div><div class=\"hours\">%%H%% <span class=\"label\">Hours</span> </div><div class=\"minutes\">%%M%% <span class=\"label\">Minutes</span> </div><div class=\"seconds\">%%S%% <span class=\"label\">Seconds</span></div></div>", 208 FinishMessage: "Expired" 209 });
210 }); 211 }, 212 213 elementVideoCarousel: function($scope){ 214 var $carousel = $scope.find('.init-carousel-swiper'); 215 GaviasElements.initCarousel($carousel); 216 }, 217 218 elementHeadingBlock: function($scope){ 219 if ($scope.find('.typed-effect').length) { 220 var _this = $scope.find('.typed-effect').first(); 221 var typedStrings = _this.data('strings'); 222 var typedTag = _this.attr('id'); 223 var typed = new Typed('#' + typedTag, { 224 typeSpeed: 100, 225 backSpeed: 100, 226 fadeOut: true, 227 loop: true, 228 strings: typedStrings.split(',') 229 }); 230 } 231 }, 232 233 getURLParameter: function(url, name) { 234 var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); 235 var results = regex.exec(url); 236 if (!results || !results[2]) { 237 return ''; 238 } 239 return decodeURIComponent(results[2]); 240 }, 241 242 elementAllListing: function($scope){ 243 var data_carousel = $scope.find('.directorist-main-items').data('carousel'); 244 var $carousel = GaviasElements.initCarousel($scope.find('.init-carousel-swiper'), data_carousel); 245 246 $('body').on("click", ".all-listing .directorist-type-nav__link", function (e) { 247 e.preventDefault(); 248 var _this = $(this); 249 var type_href = $(this).attr('href'); 250 var type = type_href.match(/directory_type=.+/); 251 //let directory_type = ( type && type.length ) ? type[0].replace( /directory_type=/, '' ) : ''; 252 var directory_type = GaviasElements.getURLParameter(type_href, 'directory_type'); 253 var data_atts = $(this).closest('.directorist-main-items').attr('data-atts'); 254 $(this).parents('.directorist-main-items').find('.swiper-slider-wrapper').addClass('ajaxloading'); 255 var form_data = { 256 action: 'directorist_type_tab', 257 _nonce: directorist.ajax_nonce, 258 current_page_id: directorist.current_page_id, 259 directory_type: directory_type, 260 data_atts: JSON.parse(data_atts) 261 }; 262 //update_instant_search_url(form_data); 263 $.ajax({
264 url: directorist.ajaxurl, 265 type: "POST", 266 data: form_data, 267 beforeSend: function beforeSend() { 268 $(_this).closest('.directorist-instant-search').addClass('atbdp-form-fade'); 269 }, 270 success: function success(html) { 271 if (html.search_result) { 272 //$carousel.removeAllSlides(); 273 //$carousel.appendSlide(html.search_result); 274 //$(_this).parents('.directorist-main-items').find('.directorist-items').replaceWith(html.search_result); 275 $(_this).parents('.directorist-main-items').find('.directorist-items').html(html.search_result); 276 setTimeout(function() { 277 var $carousel = GaviasElements.initCarousel($scope.find('.init-carousel-swiper'), data_carousel); 278 }, 200); 279 } 280 $(_this).parents('.directorist-type-nav__list').find('li').removeClass('current'); 281 $(_this).parents('li').addClass('current'); 282 } 283 }); 284 }); 285 }, 286 elementSearchListing: function($scope){ 287 $scope.delegate('a.search_listing_types', 'click', function(e){ 288 e.preventDefault(); 289 $(this).parents('.directorist-search-form').find('.directorist-search-form__box').addClass('ajaxloading'); 290 }); 291 }, 292 293 elementArchiveListing: function($scope){ 294 $scope.delegate('.searchform__advanced-button', 'click', function(e){ 295 e.preventDefault(); 296 var wrap = $(this).parents('.listing-search-top__wrapper'); 297 if(wrap.hasClass('advanced-open')){ 298 wrap.removeClass('advanced-open'); 299 }else{ 300 wrap.addClass('advanced-open'); 301 } 302 }); 303 // $scope.find('.searchform__advanced-button').on('click', function(e){ 304 // e.preventDefault(); 305 // var wrap = $(this).parents('.listing-search-top__wrapper'); 306 // if(wrap.hasClass('advanced-open')){ 307 // wrap.removeClass('advanced-open'); 308 // }else{ 309 // wrap.addClass('advanced-open'); 310 // } 311 // }) 312 }, 313 314 elementImageAccordion: function($scope){ 315 $scope.find('.image-accordion-item').each(function(e){ 316 var item = $(this); 317 item.hover(function(){ 318 $(this).parents('.images-accordion-wrap').find('.image-accordion-item').removeClass('active'); 319 }); 320 item.mouseleave(function(){ 321 $(this).parents('.images-accordion-wrap').find('.image-accordion-item.default-active').addClass('active'); 322 }); 323 item.find('.accordion-one__mobile-control').on('click', function(e){ 324 e.preventDefault(); 325 $(this).parents('.images-accordion-wrap').find('.image-accordion-item').removeClass('active').removeClass('active-mobile'); 326 $(this).parents('.image-accordion-item').addClass('active-mobile'); 327 }); 328 }) 329 }, 330 331 sliderAnimationsStart: function(slide) { 332 slide.each(function () { 333 var layer = $(this); 334 var delay = layer.data('delay'); 335 var duration = layer.data('duration'); 336 var type = 's-animation s__' + layer.data('animation'); 337 layer.css({ 338 'animation-delay': delay, 339 '-webkit-animation-delay': delay, 340 'animation-duration': duration 341 }); 342 layer.addClass(type).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 343 layer.removeClass(type); 344 }); 345 }); 346 }, 347 348 elementPropertySlider: function($scope){ 349 var $target = $scope.find('.init-slider-property'); 350 var _default = { 351 items: 1, 352 items_lg: 1, 353 items_md: 1, 354 items_sm: 1, 355 items_xs: 1, 356 items_xx: 1, 357 space_between: 30, 358 effect: 'slide', 359 loop: 1, 360 speed: 600, 361 autoplay: 1, 362 autoplay_delay: 6000, 363 autoplay_hover: 0, 364 navigation: 1, 365 pagination: 1, 366 pagination_type: 'bullets', 367 dynamic_bullets: 0 368 }; 369 var settings = $target.data('carousel'); 370 settings = $.extend(!0, _default, settings); 371 372 //-- Autoplay 373 var _autoplay = false; 374 if(settings.autoplay){ 375 _autoplay = { 376 delay: settings.autoplay_delay, 377 disableOnInteraction: false, 378 pauseOnMouseEnter: settings.autoplay_hover, 379 } 380 } 381 //-- Pagination 382 var _pagination = false; 383 if(settings.pagination){ 384 _pagination = { 385 el: $target.parents('.swiper-slider-property').find('.swiper-pagination')[0], 386 type: settings.pagination_type, 387 clickable: true, 388 dynamicBullets: settings.dynamic_bullets 389 } 390 } 391 //-- Navigation 392 var _navigation = false; 393 if(settings.navigation){ 394 _navigation = { 395 nextEl: $target.parents('.swiper-slider-property').find('.swiper-nav-next')[0], 396 prevEl: $target.parents('.swiper-slider-property').find('.swiper-nav-prev')[0], 397 hiddenClass: 'hidden' 398 } 399 } 400 401 const swiper = new Swiper($target[0], { 402 loop: settings.loop, 403 spaceBetween: 0, 404 autoplay: _autoplay, 405 speed: settings.speed, 406 grabCursor: true, 407 centeredSlides: true,
408 centeredSlidesBounds: true, 409 effect: settings.effect, 410 slidesPerView: 1, 411 pagination: _pagination, 412 navigation: _navigation, 413 observeParents: true, 414 slideVisibleClass: 'item-active', 415 watchSlidesVisibility: true, 416 mousewheel: false, 417 initialSlider: 0, 418 parallax: true, 419 on: { 420 slideChangeTransitionStart: function () { 421 var swiper = this; 422 setTimeout(function() { 423 var animate = $(swiper.slides[swiper.activeIndex]).find('[data-animation]'); 424 GaviasElements.sliderAnimationsStart(animate); 425 }, 100); 426 }, 427 init: function(){ 428 var swiper = this; 429 swiper.slides.each(function(index){ 430 $(swiper.slides[index]).find('.slider-image img').attr('data-swiper-parallax', swiper.width - 200); 431 }); 432 }, 433 resize: function () { 434 var swiper = this; 435 swiper.slides.each(function(index){ 436 $(swiper.slides[index]).find('.slider-image img').attr('data-swiper-parallax', swiper.width - 200); 437 }); 438 swiper.update(); 439 } 440 } 441 }); 442 443 if(settings.autoplay_hover && settings.autoplay){ 444 $target.hover(function() { 445 swiper.autoplay.stop(); 446 }, function() { 447 swiper.autoplay.start(); 448 }); 449 } 450 }, 451 452 elementLocationImage: function($scope){ 453 $scope.find('.location-one__location .location-one__marker').on('click', function(e){ 454 e.preventDefault(); 455 $(this).parents('.location-one__main-content').find('.location-one__location').removeClass('active'); 456 $(this).parents('.location-one__location').addClass('active'); 457 }) 458 }, 459 elementInitCarousel: function($scope){ 460 var $carousel = $scope.find('.init-carousel-swiper'); 461 GaviasElements.initCarousel($carousel); 462 }, 463 464 465 initCarousel: function($target, $data = false){ 466 var _default = { 467 items: 3, 468 items_lg: 3, 469 items_md: 2, 470 items_sm: 2, 471 items_xs: 1, 472 items_xx: 1, 473 space_between: 30, 474 effect: 'slide', 475 loop: 1, 476 speed: 600, 477 autoplay: 1, 478 autoplay_delay: 6000, 479 autoplay_hover: 0, 480 navigation: 1, 481 pagination: 1, 482 pagination_type: 'bullets', 483 dynamic_bullets: 0 484 }; 485 if($data){ 486 var settings = $data; 487 }else{ 488 var settings = $target.data('carousel'); 489 } 490 491 settings = $.extend(!0, _default, settings); 492 //-- Autoplay 493 var _autoplay = false; 494 if(settings.autoplay){ 495 _autoplay = { 496 delay: settings.autoplay_delay, 497 disableOnInteraction: false, 498 pauseOnMouseEnter: settings.autoplay_hover, 499 } 500 } 501 //-- Pagination 502 var _pagination = false; 503 if(settings.pagination){ 504 _pagination = { 505 el: $target.parents('.swiper-slider-wrapper').find('.swiper-pagination')[0], 506 type: settings.pagination_type, 507 clickable: true, 508 dynamicBullets: settings.dynamic_bullets 509 } 510 } 511 //-- Navigation 512 var _navigation = false; 513 if(settings.navigation){ 514 _navigation = { 515 nextEl: $target.parents('.swiper-slider-wrapper').find('.swiper-nav-next')[0], 516 prevEl: $target.parents('.swiper-slider-wrapper').find('.swiper-nav-prev')[0], 517 hiddenClass: 'hidden' 518 } 519 } 520 521 const swiper = new Swiper($target[0], { 522 loop: settings.loop, 523 spaceBetween: settings.space_between, 524 autoplay: _autoplay, 525 speed: settings.speed, 526 grabCursor: false, 527 centeredSlides: false, 528 centeredSlidesBounds: true, 529 effect: settings.effect, 530 breakpoints: { 531 0: { 532 slidesPerView: 1 533 }, 534 560: { 535 slidesPerView: settings.items_xx 536 }, 537 640: { 538 slidesPerView: settings.items_xs 539 }, 540 768: { 541 slidesPerView: settings.items_sm 542 }, 543 1024: { 544 slidesPerView: settings.items_md 545 }, 546 1200: { // when window width is >= 1200px 547 slidesPerView: settings.items_lg, 548 549 }, 550 1400: { // when window width is >= 1200px 551 slidesPerView: settings.items 552 } 553 }, 554 pagination: _pagination, 555 navigation: _navigation, 556 observer: true, 557 observeParents: true, 558 watchSlidesVisibility: true, 559 watchSlidesProgress: true, 560 slideVisibleClass: 'item-active', 561 slideNextClass: 'swiper-slide-next', 562 slidePrevClass: 'swiper-slide-prev', 563 slideActiveClass: 'swiper-slide-active', 564 on: { 565 progress: function(){ 566 //var total = settings.items; 567 var total = $target.find('.item-active').length; 568 $target.find('.swiper-slide').removeClass('first'); 569 $target.find('.swiper-slide').removeClass('last'); 570 $target.find('.swiper-slide').removeClass('center'); 571 572 var start = 0; 573 if(total == 5){start = 1;} 574 if(total == 1){start = -1;} 575 576 $target.find('.swiper-slide.item-active').each(function(index){ 577 if(index === start) { 578 $(this).addClass('first') 579 } 580 if(index === start + 1){ 581 $(this).addClass('center') 582 } 583 if( index === total - (start + 1) && total > (start + 1) ) { 584 $(this).addClass('last') 585 } 586 }) 587 }, 588 } 589 }); 590 591 if(settings.autoplay_hover && settings.autoplay){ 592 $target.hover(function() { 593 swiper.autoplay.stop(); 594 }, function() { 595 swiper.autoplay.start(); 596 }); 597 } 598 599 return swiper; 600 }, 601 602 elementCircleProgress: function($scope){ 603 $scope.find(".circle-progress").appear(function () { 604 $scope.find(".circle-progress").each(function () { 605 let progress = $(this); 606 let progressOptions = progress.data("options"); 607 progress.circleProgress({ 608 startAngle: -Math.PI / 2 609 }).on('circle-animation-progress', function(event, progress, stepValue) { 610 $(this).find('strong').html(Math.round(stepValue.toFixed(2).substr(1) * 100) + '<i>%</i>'); 611 }); 612 }); 613 });
614 }, 615 616}; 617 618$(window).on('elementor/frontend/init', GaviasElements.init); 619 620}(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.