1"use strict"; 2// Toggle/Accordion 3function wglAccordionInit() { 4 var item = jQuery('.wgl-accordion'); 5 6 item.each( function() { 7 var header = jQuery(this).find('.wgl-accordion_header'); 8 var content = jQuery(this).find('.wgl-accordion_content'); 9 var acc_type = jQuery(this).data('type'); 10 var speed = 400; 11 header.off("click"); 12 13 header.each( function() { 14 if (jQuery(this).data('default') == 'yes') { 15 jQuery(this).addClass('active'); 16 jQuery(this).next().slideDown(speed); 17 } 18 }) 19 20 header.on('click', function(e) { 21 e.preventDefault(); 22 var $this = jQuery(this); 23 24 if ( acc_type == 'accordion' ) { 25 $this.toggleClass('active'); 26 $this.next().slideToggle(speed); 27 } else if ( acc_type == 'toggle' ) { 28 $this.toggleClass('active'); 29 $this.next().slideToggle(speed); 30 content.not($this.next()).slideUp(speed); 31 header.not($this).removeClass('active'); 32 } 33 }) 34 }) 35} 36 37// Accordion Services 38function wglServicesAccordionInit() { 39 var widgetList = jQuery('.wgl-accordion-services'); 40 41 widgetList.each(function () { 42 var itemClass = '.service__item'; 43 44 jQuery(this).find(itemClass + ':first-child').addClass('active'); 45 46 var item = jQuery(this).find(itemClass); 47 item.on('mouseover', function () { 48 jQuery(this).addClass('active').siblings().removeClass('active'); 49 }); 50 }); 51} 52 53(function($) { 54 jQuery(document).ready(function() { 55 wglAjaxLoad(); 56 }); 57 58 function wglAjaxLoad() { 59 var i, section; 60 var sections = document.getElementsByClassName('wgl_cpt_section'); 61 for (i = 0; i < sections.length; i++) { 62 section = sections[i]; 63 var infinity_item = section.getElementsByClassName('infinity_item'); 64 var load_more = section.getElementsByClassName('load_more_item'); 65 if (infinity_item.length || load_more.length) { 66 wglAjaxInit(section); 67 } 68 } 69 } 70 71 var wait_load = false; 72 var offset_items = 0; 73 var infinity_item; 74 var js_offset; 75 76 function wglAjaxQuery(grid, section, request_data) { 77 if (wait_load) return; 78 wait_load = true; 79 request_data['offset_items'] = request_data.js_offset 80 ? request_data.js_offset 81 : offset_items; 82 83 request_data['remainings_loading_btn_items_amount'] = request_data.remainings_loading_btn_items_amount; 84 85 request_data['js_offset'] = request_data.js_offset 86 ? request_data.js_offset 87 : offset_items; 88 89 // For the mode_security enabled, removed sql request 90 if (request_data.query && request_data.query.request) { 91 delete request_data.query.request; 92 } 93 94 $.post( 95 wgl_core.ajaxurl, 96 { 97 action: 'wgl_ajax', 98 data: request_data 99 }, 100 function(response, status) { 101 var resp, new_items, load_more_hidden, count_products; 102 resp = document.createElement('div'); 103 resp.innerHTML = response; 104 new_items = $('.item', resp); 105 count_products = $('.woocommerce-result-count', resp); 106 107 load_more_hidden = $('.hidden_load_more', resp); 108 109 if (load_more_hidden.length) { 110 jQuery(section) 111 .find('.load_more_wrapper') 112 .fadeOut(300, function() { 113 $(this).remove(); 114 }); 115 } else { 116 jQuery(section) 117 .find('.load_more_wrapper .load_more_item') 118 .removeClass('loading'); 119 } 120 121 jQuery(section) 122 .find('.woocommerce-result-count') 123 .html(jQuery(count_products).html()); 124 125 if ($(grid).hasClass('carousel')) { 126 $(grid) 127 .find('.swiper-wrapper') 128 .append(new_items); 129 $(grid) 130 .find('.swiper-pagination') 131 .remove(); 132 $(grid) 133 .find('.wgl-carousel_swiper')
134 .update(); 135 } else if ($(grid).hasClass('grid')) { 136 new_items = new_items.hide(); 137 $(grid).append(new_items); 138 new_items.fadeIn('slow'); 139 } else { 140 var items = jQuery(new_items); 141 jQuery(grid) 142 .imagesLoaded() 143 .always(function() { 144 jQuery(grid) 145 .append(items) 146 .isotope('appended', items) 147 .isotope('reloadItems'); 148 149 setTimeout(function() { 150 wglScrollAnimation(); 151 jQuery(grid).isotope('layout'); 152 updateFilter(grid); 153 updateCarousel(grid); 154 wglCursorInit(); 155 }, 500); 156 }); 157 } 158 159 // Call video background settings 160 if (typeof jarallax === 'function') { 161 wglParallaxVideo(); 162 } else { 163 jQuery(grid) 164 .find('.parallax-video') 165 .each(function() { 166 jQuery(this).jarallax({ 167 loop: true, 168 speed: 1, 169 videoSrc: jQuery(this).data('video'), 170 videoStartTime: jQuery(this).data('start'), 171 videoEndTime: jQuery(this).data('end') 172 }); 173 }); 174 } 175 176 // Call swiper settings 177 updateCarousel(grid); 178 179 wglScrollAnimation(); 180 // Update Items 181 182 var offset_data = $('.js_offset_items', resp); 183 request_data.js_offset = parseInt(offset_data.data('offset')); 184 185 wait_load = false; 186 } 187 ); 188 } 189 190 function updateCarousel(grid) { 191 if ( jQuery(grid).find('.wgl-carousel_swiper').size() > 0 ) { 192 jQuery(grid) 193 .find('.wgl-carousel_swiper') 194 .each(function() { 195 swiperCarousel(jQuery(this)); 196 if (jQuery(grid).hasClass('blog_masonry')) { 197 jQuery(grid).isotope('layout'); 198 } 199 }); 200 } 201 } 202 203 function wglAjaxInit(section) { 204 offset_items = 0; 205 var grid, form, data_field, data, request_data, load_more; 206 207 if (section == undefined) { 208 return; 209 } 210 211 // Get grid CPT 212 grid = section.getElementsByClassName('container-grid'); 213 if (!grid.length) { return; } 214 grid = grid[0]; 215 216 // Get form CPT 217 form = section.getElementsByClassName('posts_grid_ajax'); 218 if (!form.length) { return; } 219 form = form[0]; 220 221 // Get field form ajax 222 data_field = form.getElementsByClassName('ajax_data'); 223 if (!data_field.length) { return; } 224 data_field = data_field[0]; 225 226 data = data_field.value; 227 data = JSON.parse(data); 228 request_data = data; 229 230 // Add pagination 231 offset_items += request_data.post_count; 232 233 infinity_item = section.getElementsByClassName('infinity_item'); 234 235 if (infinity_item.length) { 236 infinity_item = infinity_item[0]; 237 if (jQuery(infinity_item).wglIsVisible()) { 238 wglAjaxQuery(grid, section, request_data); 239 } 240 var lastScrollTop = 0; 241 242 jQuery(window).on('resize scroll', function() { 243 if (jQuery(infinity_item).wglIsVisible()) { 244 var st = jQuery(this).scrollTop(); 245 if (st > lastScrollTop) { 246 wglAjaxQuery(grid, section, request_data); 247 } 248 lastScrollTop = st; 249 } 250 }); 251 } 252 253 load_more = section.getElementsByClassName('load_more_item'); 254 if (load_more.length) { 255 load_more = load_more[0]; 256 load_more.addEventListener( 257 'click', 258 function(e) { 259 e.preventDefault(); 260 jQuery(this).addClass('loading'); 261 wglAjaxQuery(grid, section, request_data); 262 }, 263 false 264 ); 265 } 266 } 267 268 function swiperCarousel(grid) { 269 var wglSwiper = {}, 270 config = { 271 effect: "fade", 272 speed: 900, 273 }; 274 275 if ('undefined' === typeof Swiper) { 276 const asyncSwiper = window.elementorFrontend.utils.swiper; 277 new asyncSwiper(grid, config).then((newSwiperInstance) => { 278 var wglSwiper = newSwiperInstance;
279 wglSwiper.update(); 280 }); 281 } else { 282 var wglSwiper = new Swiper(grid, config); 283 wglSwiper.update(); 284 } 285 } 286 287 function updateFilter(grid) { 288 jQuery(grid).isotope({ sortBy : 'original-order' }); 289 jQuery('.isotope-filter a').each(function() { 290 var $this = jQuery(this); 291 var data_filter = this.getAttribute('data-filter'); 292 var num; 293 294 if ($this.parent().parent().parent().hasClass('product__filter')) { 295 num = $this 296 .closest('.wgl-products-grid') 297 .find('.product') 298 .filter(data_filter).length; 299 $this 300 .find('.filter_counter') 301 .text(num); 302 } else { 303 num = $this 304 .closest('.wgl-portfolio') 305 .find('.portfolio__item') 306 .filter(data_filter).length; 307 $this 308 .find('.filter_counter') 309 .text(num); 310 } 311 312 if ( 313 num !== 0 314 && $this.hasClass('empty') 315 ) { 316 $this.removeClass('empty').addClass('swiper-slide'); 317 } 318 }); 319 } 320})(jQuery); 321 322function wglScrollAnimation(){ 323 var portfolio = jQuery('.wgl-portfolio_container'); 324 var shop = jQuery('.wgl-products.appear-animation'); 325 var gallery = jQuery('.wgl-gallery_items.appear-animation'); 326 327 //Scroll Animation 328 (function($) { 329 330 var docElem = window.document.documentElement; 331 332 function getViewportH() { 333 var client = docElem['clientHeight'], 334 inner = window['innerHeight']; 335 336 if( client < inner ) 337 return inner; 338 else 339 return client; 340 } 341 342 function scrollY() { 343 return window.pageYOffset || docElem.scrollTop; 344 } 345 346 // http://stackoverflow.com/a/5598797/989439 347 function getOffset( el ) { 348 var offsetTop = 0, offsetLeft = 0; 349 do { 350 if ( !isNaN( el.offsetTop ) ) { 351 offsetTop += el.offsetTop; 352 } 353 if ( !isNaN( el.offsetLeft ) ) { 354 offsetLeft += el.offsetLeft; 355 } 356 } while( el = el.offsetParent ) 357 358 return { 359 top : offsetTop, 360 left : offsetLeft 361 } 362 } 363 364 function inViewport( el, h ) { 365 var elH = el.offsetHeight, 366 scrolled = scrollY(), 367 viewed = scrolled + getViewportH(), 368 elTop = getOffset(el).top, 369 elBottom = elTop + elH, 370 h = h || 0; 371 372 return (elTop + elH * h) <= viewed && (elBottom - elH * h) >= scrolled; 373 } 374 375 function extend( a, b ) { 376 for( var key in b ) { 377 if( b.hasOwnProperty( key ) ) { 378 a[key] = b[key]; 379 } 380 } 381 return a; 382 } 383 384 function AnimOnScroll( el, options ) { 385 this.el = el; 386 this.options = extend( this.defaults, options ); 387 if(this.el.length){ 388 this._init(); 389 } 390 } 391 392 AnimOnScroll.prototype = { 393 defaults : { 394 viewportFactor : 0 395 }, 396 _init : function() { 397 this.items = Array.prototype.slice.call( jQuery(this.el ).children() ); 398 this.itemsCount = this.items.length; 399 this.itemsRenderedCount = 0; 400 this.didScroll = false; 401 this.delay = 100; 402 403 404 var self = this; 405 406 if(typeof imagesLoaded === 'function'){ 407 imagesLoaded( this.el, this._imgLoaded(self)); 408 }else{ 409 this._imgLoaded(self); 410 } 411 412 }, 413 _imgLoaded : function(self) { 414 415 var interval; 416 417 // the items already shown... 418 self.items.forEach( function( el, i ) { 419 if( inViewport( el ) ) { 420 421 self._checkTotalRendered(); 422 if(!jQuery(el).hasClass('show') && !jQuery(el).hasClass('animate') && inViewport( el, self.options.viewportFactor )){ 423 self._itemClass(jQuery(el), self.delay, interval ); 424 self.delay += 200; 425 setTimeout( function() { 426 self.delay = 100; 427 }, 200 ); 428 } 429 } 430 } ); 431 432 // animate on scroll the items inside the viewport 433 window.addEventListener( 'scroll', function() { 434 self._onScrollFn(); 435 }, false ); 436 window.addEventListener( 'resize', function() { 437 self._resizeHandler(); 438 }, false ); 439 }, 440 441 _onScrollFn : function() { 442 var self = this; 443 if( !this.didScroll ) { 444 this.didScroll = true; 445 setTimeout( function() { self._scrollPage(); }, 60 ); 446 } 447 }, 448 _itemClass : function(item_array, delay, interval) { 449 450 interval = setTimeout(function(){ 451 if ( item_array.length) { 452 jQuery(item_array).addClass( 'animate' ); 453 } else { 454 clearTimeout( interval ); 455 } 456 }, delay); 457 458 }, 459 460 _scrollPage : function() { 461 var self = this; 462 var interval; 463
464 this.items.forEach( function( el, i ) { 465 if( !jQuery(el).hasClass('show') && !jQuery(el).hasClass('animate') && inViewport( el, self.options.viewportFactor ) ) { 466 setTimeout( function() { 467 var perspY = scrollY() + getViewportH() / 2; 468 469 self._checkTotalRendered(); 470 self._itemClass(jQuery(el), self.delay, interval); 471 self.delay += 200; 472 setTimeout( function() { 473 self.delay = 100; 474 }, 200 ); 475 476 }, 25 ); 477 } 478 }); 479 this.didScroll = false; 480 }, 481 _resizeHandler : function() { 482 var self = this; 483 function delayed() { 484 self._scrollPage(); 485 self.resizeTimeout = null; 486 } 487 if ( this.resizeTimeout ) { 488 clearTimeout( this.resizeTimeout ); 489 } 490 this.resizeTimeout = setTimeout( delayed, 1000 ); 491 }, 492 _checkTotalRendered : function() { 493 ++this.itemsRenderedCount; 494 if( this.itemsRenderedCount === this.itemsCount ) { 495 window.removeEventListener( 'scroll', this._onScrollFn ); 496 } 497 } 498 } 499 500 // add to global namespace 501 window.AnimOnScroll = AnimOnScroll; 502 503 })(jQuery); 504 505 new AnimOnScroll( portfolio, {} ); 506 new AnimOnScroll( shop, {} ); 507 new AnimOnScroll( gallery, {} ); 508 509} 510// Scroll Up button 511function wglScrollUp() { 512 (function($) { 513 $.fn.goBack = function(options) { 514 var defaults = { 515 scrollTop: jQuery(window).height(), 516 scrollSpeed: 600, 517 fadeInSpeed: 1000, 518 fadeOutSpeed: 500 519 }; 520 var options = $.extend(defaults, options); 521 var $this = $(this); 522 $(window).on('scroll', function() { 523 if ($(window).scrollTop() > options.scrollTop) { 524 $this.addClass('active'); 525 } else { 526 $this.removeClass('active'); 527 } 528 }); 529 $this.on('click', function() { 530 $('html,body').animate( 531 { 532 scrollTop: 0 533 }, 534 options.scrollSpeed 535 ); 536 }); 537 }; 538 })(jQuery); 539 540 jQuery('#scroll_up').goBack(); 541} 542 543function wglBlogMasonryInit() { 544 var blog = jQuery('.blog-posts > .masonry'); 545 if (blog.length) { 546 var blog_dom = blog.get(0); 547 var $grid = imagesLoaded(blog_dom, function () { 548 // initialize masonry 549 //* Wrapped in a short timeout function because $grid.imagesLoaded doesn't reliably lay out correctly 550 setTimeout(function(){ 551 blog.isotope({ 552 layoutMode: 'masonry', 553 masonry: { 554 columnWidth: '.item', 555 }, 556 itemSelector: '.item', 557 percentPosition: true 558 }); 559 jQuery(window).trigger('resize'); 560 }, 250); 561 }); 562 } 563} 564// WGL Carousel 565function wglCarouselSwiper() { 566 var carousel_2D = jQuery('.wgl-carousel_swiper[data-item-carousel]') 567 var carousel_3D = jQuery('.wgl-carousel.animation-style-3d') 568 569 if (carousel_2D.length) { 570 carousel_2D.each(function (item, value) { 571 var swiperContainer = jQuery(this); 572 var itemID = jQuery(this).data('item-carousel') ? '[data-carousel="' + jQuery(this).data('item-carousel') + '"]' : ''; 573 var effect = jQuery(this).hasClass('fade_swiper') ? 'fade' : 'slide'; 574 575 var configData = jQuery(this).data('swiper') ? jQuery(this).data('swiper') : {}; 576 var speed = configData.speed ? configData.speed / 10 : 300; 577 var autoplay = configData.autoplaySpeed ? configData.autoplaySpeed : 3000; 578 var autoplayEnable = configData.autoplay ? configData.autoplay : false; 579 var loop = configData.infinite ? configData.infinite : false; 580 var adaptiveHeight = configData.adaptiveHeight ? configData.adaptiveHeight : false;
581 var pause_on_hover = configData.pauseOnHover ? configData.pauseOnHover : true; 582 var centeredSlides = configData.centerMode ? configData.centerMode : false; 583 584 var pagination = swiperContainer.data('pagination') !== undefined ? swiperContainer.data('pagination') : '.swiper-pagination' + itemID; 585 var arrow_next = swiperContainer.data('arrow-next') !== undefined ? swiperContainer.data('arrow-next') : '.elementor-swiper-button-next' + itemID; 586 var arrow_prev = swiperContainer.data('arrow-prev') !== undefined ? swiperContainer.data('arrow-prev') : '.elementor-swiper-button-prev' + itemID; 587 var pagination_type = swiperContainer.hasClass('pagination_fraction') ? 'fraction' : 'bullets'; 588 589 var config = { 590 direction: 'horizontal', 591 loop: loop, 592 speed: speed, 593 effect: effect, 594 slidesPerView: 1, 595 slidesPerGroup: 1, 596 watchOverflow: true, 597 autoHeight: adaptiveHeight, 598 grabCursor: false, 599 paginationClickable: true, 600 centeredSlides: centeredSlides, 601 autoplay: { 602 delay: autoplay 603 }, 604 pagination: { 605 el: pagination, 606 clickable: true, 607 type: pagination_type, 608 formatFractionCurrent: (index) => index > 9 ? '' + index: '0' + index, 609 formatFractionTotal: (index) => index > 9 ? '' + index: '0' + index, 610 renderBullet: (index, className) => '<li class="' + className + '" role="presentation"><button type="button" role="tab" tabindex="-1">' + (index + 1) + '</button></li>', 611 }, 612 navigation: { 613 nextEl: arrow_next, 614 prevEl: arrow_prev 615 }, 616 breakpoints: {}, 617 autoplayEnable: autoplayEnable, 618 pause_on_hover: pause_on_hover, 619 }; 620 621 if (jQuery(this).hasClass('fade_swiper')) { 622 config.fadeEffect = { 623 crossFade: true 624 }; 625 } 626 627 if (configData.responsive) { 628 var obj = {}; 629 configData.responsive.forEach(function (item) { 630 if (item.breakpoint) { 631 obj[item.breakpoint] = { 632 slidesPerView: item.slidesToShow, 633 slidesPerGroup: item.slidesToScroll 634 ? item.slidesToScroll 635 : 1, 636 }; 637 638 if (item.gap) { 639 obj[item.breakpoint].spaceBetween = item.gap; 640 } 641 } 642 }); 643 644 config.breakpoints = obj; 645 } 646 647 if (window.elementorFrontend) { 648 if (window.elementorFrontend.isEditMode()) { 649 wglInitSwiper(swiperContainer, config); 650 } else { 651 elementorFrontend.on('components:init', () => { 652 wglInitSwiper(swiperContainer, config, elementorFrontend); 653 }); 654 } 655 } else { 656 wglInitSwiper(swiperContainer, config); 657 } 658 }); 659 } 660 661 /* @see https://3dtransforms.desandro.com/carousel */ 662 if (carousel_3D.length) { 663 carousel_3D.each(function () { 664 var container = jQuery(this), 665 carousel_wrapper = container.find('.wgl-carousel_wrap'), 666 cells = carousel_wrapper.find('.testimonials__wrapper'), 667 direction = container.hasClass('animation-direction-vertical') ? 'rotateX' : 'rotateY'; 668 669 var cell, 670 cellCount = cells.length, 671 cellHeight = carousel_wrapper.outerHeight(), 672 angle, 673 cellAngle, 674 currentCell, 675 selectedIndex = 0, 676 radius, 677 theta; 678 679 function initHeightCarousel() { 680 if ('rotateY' === direction) { 681 var maxHeight = 0; 682 cells.each(function () { 683 var thisH = jQuery(this).outerHeight(); 684 if (thisH > maxHeight) { 685 maxHeight = thisH; 686 } 687 }); 688 container.css({'height': maxHeight}); 689 } 690 } 691 initHeightCarousel(); 692 693 function rotateCarousel() { 694 angle = theta * selectedIndex * -1; 695 carousel_wrapper.css({ 'transform': 'translateZ(' + -radius + 'px) ' + direction + '(' + angle + 'deg)' }); 696 } 697 698 container.find('.motion-prev').on('click', function () {
699 throttleFunction(changeCarousel_prev, 200) 700 }); 701 container.find('.motion-next').on('click', function () { 702 throttleFunction(changeCarousel_next, 200) 703 }); 704 705 function changeCarousel_prev() { 706 selectedIndex--; 707 changeCarousel(selectedIndex); 708 } 709 function changeCarousel_next() { 710 selectedIndex++; 711 changeCarousel(selectedIndex); 712 } 713 714 if (container.hasClass('animated-by-mouse-wheel')) { 715 container.on('wheel', function (e) { 716 if (e.originalEvent.deltaY < 0) throttleFunction(changeCarousel_next, 400); 717 else throttleFunction(changeCarousel_prev, 400); 718 e.preventDefault ? e.preventDefault() : (e.returnValue = false); 719 }); 720 } 721 722 function changeCarousel() { 723 cells.removeClass('active current next prev'); 724 theta = 360 / cellCount; 725 726 if ('rotateX' === direction) { 727 radius = Math.round( 728 (cellHeight / cellCount) * 0.7 * Math.sqrt(cellCount / 1.5) 729 ); 730 } else { 731 if (jQuery('#main').width() <= 992) { 732 radius = Math.round( 733 (cellHeight / cellCount) * 0.5 * Math.sqrt(cellCount / 1.2) 734 ); 735 } else { 736 radius = Math.round( 737 (cellHeight / cellCount) * 1.3 * Math.sqrt(cellCount / 1.2) 738 ); 739 } 740 } 741 742 cells.each(function (i) { 743 cell = jQuery(this); 744 cellAngle = theta * i; 745 angle = (theta * selectedIndex * -1) + cellAngle; 746 cell.css({ 'transform': direction + '(' + cellAngle + 'deg) translateZ(' + radius + 'px)' + direction + '(' + (angle * -1) + 'deg) ' }); 747 748 if (selectedIndex < 0) { 749 currentCell = cellCount - (Math.abs(selectedIndex + 1) % cellCount) - 1; 750 } else { 751 currentCell = selectedIndex % cellCount; 752 } 753 754 if (currentCell === i) { 755 cell.addClass('active current'); 756 if (currentCell === 0) cells.last().addClass('active prev'); 757 if (currentCell === cellCount - 1) cells.first().addClass('active next'); 758 } else if (i === (currentCell - 1)) { 759 cell.addClass('active prev') 760 } else if (i === (currentCell + 1)) { 761 cell.addClass('active next') 762 } 763 }); 764 765 rotateCarousel(); 766 767 cells.children().off(); 768 container.find('.prev').children().on('click', changeCarousel_prev); 769 container.find('.next').children().on('click', changeCarousel_next); 770 } 771 772 function throttleFunction(func, interval) { 773 if (!func.lastRunTime || func.lastRunTime < Date.now() - interval) { 774 func.lastRunTime = Date.now(); 775 776 return func.apply(arguments); 777 } 778 } 779 780 // set initials 781 changeCarousel(); 782 jQuery(window).resize(function () { 783 initHeightCarousel(); 784 changeCarousel(); 785 }); 786 }); 787 } 788} 789 790function wglInitSwiper(swiperContainer, config) { 791 if ( 792 window.elementorFrontend 793 && window.elementorFrontend.utils 794 && window.elementorFrontend.utils.swiper 795 ) { 796 const asyncSwiper = window.elementorFrontend.utils.swiper; 797 new asyncSwiper(swiperContainer, config).then((newSwiperInstance) => { 798 var wglSwiper = newSwiperInstance; 799 wglSwiperControl(wglSwiper, swiperContainer, config); 800 }); 801 } else if ('undefined' !== typeof Swiper) { 802 var wglSwiper = new Swiper(swiperContainer, config); 803 wglSwiperControl(wglSwiper, swiperContainer, config); 804 } 805} 806 807function wglSwiperControl(element, swiperContainer, config){
808 if (!config.autoplayEnable) { 809 element.autoplay.stop(); 810 } 811 812 if (config.pause_on_hover && config.autoplayEnable) { 813 swiperContainer.on('mouseenter', function () { 814 element.autoplay.stop(); 815 }); 816 swiperContainer.on('mouseleave', function () { 817 element.autoplay.start(); 818 }); 819 } 820 821 swiperContainer.closest('.wgl_cpt_section').find('.carousel-filter a').on('click', function(e){ 822 let $item = swiperContainer.find('.item'); 823 $item.addClass('invisible'); 824 setTimeout(function(){ 825 element.update(); 826 $item.removeClass('invisible'); 827 },200); 828 }); 829} 830 831function wglCircuitService() { 832 if (jQuery('.wgl-circuit-service').length) { 833 jQuery('.wgl-circuit-service').each(function(){ 834 var $circle = jQuery(this).find('.wgl-services_icon-wrap'); 835 836 var agle = 360 / $circle.length; 837 var agleCounter = -1; 838 839 $circle.each(function() { 840 var $this = jQuery(this); 841 842 jQuery(this).parents('.wgl-services_item:first-child').addClass('active'); 843 $this.on('mouseover', function(){ 844 jQuery(this).parents('.wgl-services_item').addClass('active').siblings().removeClass('active'); 845 }) 846 847 var percentWidth = (100 * parseFloat($this.css('width')) / parseFloat($this.parent().css('width'))); 848 var curAgle = agleCounter * agle; 849 var radAgle = curAgle * Math.PI / 180; 850 var x = (50 + ((50 - (percentWidth / 2)) * Math.cos(radAgle))) - (percentWidth / 2); 851 var y = (50 + ((50 - (percentWidth / 2)) * Math.sin(radAgle))) - (percentWidth / 2); 852 853 $this.css({ 854 left: x + '%', 855 top: y + '%' 856 }); 857 858 agleCounter++; 859 }); 860 861 }); 862 } 863} 864// wgl Countdown function init 865function wglCountdownInit () { 866 var countdown = jQuery('.wgl-countdown'); 867 if (countdown.length !== 0 ) { 868 countdown.each(function () { 869 var data_atts = jQuery(this).data('atts'); 870 var time = new Date(+data_atts.year, +data_atts.month-1, +data_atts.day, +data_atts.hours, +data_atts.minutes); 871 jQuery(this).countdown({ 872 until: time, 873 padZeroes: true, 874 digits: [ 875 '<span>0</span>', 876 '<span>1</span>', 877 '<span>2</span>', 878 '<span>3</span>', 879 '<span>4</span>', 880 '<span>5</span>', 881 '<span>6</span>', 882 '<span>7</span>', 883 '<span>8</span>', 884 '<span>9</span>', 885 ], 886 format: data_atts.format ? data_atts.format : 'yowdHMS', 887 labels: [data_atts.labels[0],data_atts.labels[1],data_atts.labels[2],data_atts.labels[3],data_atts.labels[4],data_atts.labels[5], data_atts.labels[6], data_atts.labels[7]], 888 labels1: [data_atts.labels[0],data_atts.labels[1],data_atts.labels[2], data_atts.labels[3], data_atts.labels[4], data_atts.labels[5], data_atts.labels[6], data_atts.labels[7]] 889 }); 890 }); 891 } 892} 893// WGL Counter 894function wglCounterInit() {
895 let counters = jQuery('.wgl-counter__value'); 896 if (counters.length) { 897 counters.appear(function() { 898 let from = jQuery(this).data('start-value'), 899 max = jQuery(this).data('end-value'), 900 speed = jQuery(this).data('speed'), 901 sep = jQuery(this).data('sep'); 902 903 jQuery(this).countTo({ 904 from: from, 905 to: max, 906 speed: speed, 907 refreshInterval: 10, 908 separator: sep 909 }); 910 }); 911 } 912} 913// WGL Cursor Message 914jQuery(window).on('elementor/frontend/init', function() { 915 wglSectionCursor(); 916}); 917 918function wglCursorInit() { 919 var $device_mode = jQuery('body').attr('data-elementor-device-mode'); 920 if ($device_mode !== 'desktop' && $device_mode !== 'laptop' && $device_mode !== 'widescreen') { 921 return; 922 } 923 924 var cursorPointerWrap = jQuery('#wgl-cursor'); 925 var cursorPointer = jQuery('#wgl-cursor-pointer'); 926 var cursorText = jQuery('.wgl-cursor-text'); 927 928 jQuery(document).on('mousemove', function(e) { 929 cursorPointerWrap.css("transform", `translate3d(calc(${e.clientX}px - 50%), calc(${e.clientY}px - 50%), 0)`); 930 }) 931 932 if (cursorText.length) { 933 cursorText.each(function() { 934 var $this = jQuery(this), 935 append = wglCursorAppend($this), 936 cursorColorBg = $this.attr('data-cursor-color-bg'); 937 938 if ( $this.hasClass('additional-cursor') ) { 939 $this = $this.parent() 940 } 941 942 const appendElement = 'undefined' !== jQuery.type(append) && '' !== jQuery.type(append); 943 let timerId; 944 945 $this.on('mouseenter', function () { 946 if (appendElement) { 947 cursorPointer 948 .empty() 949 .append(jQuery(append)) 950 timerId = setTimeout(() => { 951 cursorPointer.addClass('visible') 952 }, 20); 953 }else{ 954 cursorPointer.css('color',cursorColorBg) 955 } 956 }).on('mouseleave', function(e) { 957 if (appendElement) { 958 clearTimeout(clearTimeout(timerId)); 959 cursorPointer.removeClass('visible') 960 }else{ 961 if ( e.relatedTarget ) { 962 var newTarget = jQuery(e.relatedTarget); 963 if (!newTarget.hasClass('wgl-cursor-text')) { 964 newTarget = newTarget.parents('[data-cursor-color-bg]').eq(0); 965 } 966 if (newTarget.length > 0 && newTarget.hasClass('wgl-cursor-text')) { 967 setTimeout( function() { 968 newTarget.trigger('mouseenter'); 969 }, 0 ); 970 } else { 971 cursorPointer.css('color','var(--canabik-cursor-point-color)') 972 } 973 } 974 } 975 }) 976 }) 977 } 978} 979 980var wglCursorAppend = $this => { 981 982 var text = $this.attr('data-cursor-text'), 983 image = $this.attr('data-cursor-image'), 984 color = $this.attr('data-cursor-text-color'), 985 colorBg = $this.attr('data-cursor-text-color-bg'), 986 colorBgChildren = $this.attr('data-cursor-text-color-bg-children'), 987 size = $this.attr('data-cursor-text-size'), 988 newAppend = []; 989 990 if ( 'undefined' !== jQuery.type(image) ) { 991 newAppend = jQuery('<div class="cursor-content cursor-content-image">' + image + '</div>') 992 newAppend.css('background-color', colorBg) 993 } else if ( 'undefined' !== jQuery.type(text) ) { 994 newAppend = jQuery('<div class="cursor-content cursor-content-text">' + text + '</div>') 995 newAppend.css('color', color) 996 newAppend.css('font-size', size + 'px') 997 newAppend.css('background-color', colorBg) 998 newAppend.children().children().css('background-color', colorBgChildren) 999 } 1000 1001 return newAppend[0]; 1002 1003} 1004 1005function wglSectionCursor(){ 1006 window.elementorFrontend.hooks.addAction( 'frontend/element_ready/section', 1007 function( $scope ){ 1008 return $scope.each(function () { 1009 var self = jQuery(this), 1010 itemId = jQuery(this).data('id'); 1011 1012 var settings = {}, 1013 hasProperty = false, 1014 arr = []; 1015 1016 var init = function(){ 1017 if (!window.elementorFrontend.isEditMode()) { 1018 if('undefined' === typeof wgl_cursor_settings){ 1019 return; 1020 } 1021 settings = wgl_cursor_settings[0][itemId]; 1022 1023 hasProperty = checkEnabledCursor(settings); 1024 1025 settings = wgl_cursor_settings[0]; 1026 1027 } else { 1028 if (!window.elementor.elements && 1029 !window.elementor.elements.models 1030 ) { 1031 return; 1032 } 1033
1034 window.elementor.elements.models.forEach(function (value) { 1035 if (itemId === value.id) { 1036 settings = value.attributes.settings.attributes; 1037 arr[value.id] = value.attributes.settings.attributes; 1038 } 1039 }); 1040 1041 hasProperty = checkEnabledCursor(settings); 1042 settings = arr; 1043 } 1044 1045 settings = settings[jQuery(self).data('id')] 1046 1047 if (hasProperty) { 1048 1049 var $self = jQuery(self); 1050 $self.addClass('wgl-cursor-text'); 1051 if ('text' === settings['cursor_tooltip_type']) { 1052 settings['tooltip_text'].length ? $self.attr('data-cursor-text', settings['tooltip_text']) : ''; 1053 $self.removeAttr('data-cursor-image data-cursor-color-bg'); 1054 } else if ('image' === settings['cursor_tooltip_type']) { 1055 settings['cursor_thumbnail']['url'].length ? $self.attr('data-cursor-image', '<img src=\'' + settings['cursor_thumbnail']['url'] + '\' alt=\'' + settings['cursor_thumbnail']['alt'] + '\'>') : ''; 1056 $self.removeAttr('data-cursor-text data-cursor-color-bg'); 1057 } else if ('simple' === settings['cursor_tooltip_type']) { 1058 settings['cursor_color_bg'].length ? $self.attr('data-cursor-color-bg', settings['cursor_color_bg']) : ''; 1059 $self.removeAttr('data-cursor-image data-cursor-text'); 1060 } 1061 (settings['tooltip_color_bg'] && '' !== settings['tooltip_color_bg']) ? $self.attr('data-cursor-text-color-bg', settings['tooltip_color_bg']) : ''; 1062 (settings['tooltip_color'] && '' !== settings['tooltip_color']) ? $self.attr('data-cursor-text-color', settings['tooltip_color']) : ''; 1063 (settings['tooltip_size'] && '' !== settings['tooltip_size']['size']) ? $self.attr('data-cursor-text-size', settings['tooltip_size']['size']) : ''; 1064 1065 } else { 1066 1067 self.off().removeClass('wgl-cursor-text').removeAttr('data-cursor-text data-cursor-image data-cursor-text-color-bg data-cursor-text-color data-cursor-text-size data-cursor-color-bg') 1068 jQuery('#wgl-cursor-pointer').empty() 1069 1070 } 1071 } 1072 1073 var checkEnabledCursor = function (settings) { 1074 return !!(settings 1075 && settings.hasOwnProperty('cursor_tooltip') 1076 && '' !== settings.cursor_tooltip); 1077 } 1078 1079 /*Init*/ 1080 init(); 1081 }); 1082 } 1083 ); 1084} 1085 1086function wglDynamicStyles() { 1087 var style = jQuery('#canabik-footer-inline-css'); 1088 1089 (function ($) { 1090 $.fn.wglAddDynamicStyles = function () { 1091 if (this.length === 0) { 1092 return this; 1093 } 1094 1095 return this.each(function () { 1096 var $style = '', 1097 self = jQuery(this); 1098 1099 var init = function () { 1100 $style += self.text(); 1101 self.remove(); 1102 appendStyle(); 1103 }, 1104 appendStyle = function () { 1105 jQuery('head').append('<style>' + $style + '</style>'); 1106 }; 1107 1108 // Init 1109 init(); 1110 }); 1111 }; 1112 })(jQuery); 1113 1114 style.wglAddDynamicStyles(); 1115} 1116 1117// wgl Filter Swiper 1118function wglFilterSwiper() { 1119 var filter_swiper = jQuery('.wgl-filter_swiper_wrapper, .wgl-tabs_swiper-wrapper .wgl-tabs_headings-wrap'); 1120 if (filter_swiper.length) { 1121 filter_swiper.each(function() { 1122 if (window.elementorFrontend) { 1123 if (window.elementorFrontend.isEditMode()) { 1124 wglFilterSwiperInit(jQuery(this)); 1125 }else{ 1126 elementorFrontend.on('components:init', () => {wglFilterSwiperInit(jQuery(this))}); 1127 } 1128 } 1129 }); 1130 } 1131} 1132 1133function wglFilterSwiperInit(self) { 1134 if ('undefined' === typeof Swiper) { 1135 const asyncSwiper = window.elementorFrontend.utils.swiper; 1136 new asyncSwiper(self, { 1137 slidesPerView: 'auto', 1138 slideActiveClass: 'slide-active', 1139 }).then((newSwiperInstance) => { 1140 var wglSwiper = newSwiperInstance; 1141 }); 1142 } else { 1143 var wglSwiper = new Swiper(self, { 1144 slidesPerView: 'auto', 1145 slideActiveClass: 'slide-active', 1146 }); 1147 } 1148} 1149//https://gist.github.com/chriswrightdesign/7955464 1150function mobilecheck() { 1151 var check = false;
1152 (function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera); 1153 return check; 1154} 1155 1156//Add Click event for the mobile device 1157var click = mobilecheck() ? ('ontouchstart' in document.documentElement ? 'touchstart' : 'click') : 'click'; 1158 1159function initClickEvent(){ 1160 click = mobilecheck() ? ('ontouchstart' in document.documentElement ? 'touchstart' : 'click') : 'click'; 1161} 1162jQuery(window).on('resize', initClickEvent); 1163 1164/* 1165 ** Plugin for counter shortcode 1166 */ 1167(function($) { 1168 "use strict"; 1169 1170 $.fn.countTo = function(options) { 1171 // merge the default plugin settings with the custom options 1172 options = $.extend({}, $.fn.countTo.defaults, options || {}); 1173 1174 // how many times to update the value, and how much to increment the value on each update 1175 var loops = Math.ceil(options.speed / options.refreshInterval), 1176 increment = (options.to - options.from) / loops; 1177 1178 return $(this).each(function() { 1179 var _this = this, 1180 loopCount = 0, 1181 value = options.from, 1182 interval = setInterval(updateTimer, options.refreshInterval), 1183 separator = options.separator; 1184 1185 function updateTimer() { 1186 value += increment; 1187 loopCount++; 1188 $(_this).html(value.toFixed(options.decimals).toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator)); 1189 1190 if (typeof(options.onUpdate) === 'function') { 1191 options.onUpdate.call(_this, value); 1192 } 1193 1194 if (loopCount >= loops) { 1195 clearInterval(interval); 1196 value = options.to; 1197 1198 if (typeof(options.onComplete) === 'function') { 1199 options.onComplete.call(_this, value); 1200 } 1201 } 1202 } 1203 }); 1204 }; 1205 1206 $.fn.countTo.defaults = { 1207 from: 0, // the number the element should start at 1208 to: 100, // the number the element should end at 1209 speed: 1000, // how long it should take to count between the target numbers 1210 refreshInterval: 100, // how often the element should be updated
1211 decimals: 0, // the number of decimal places to show 1212 onUpdate: null, // callback method for every time the element is updated, 1213 onComplete: null, // callback method for when the element finishes updating 1214 separator: '' // thousand separator 1215 }; 1216})(jQuery); 1217 1218/* 1219 ** Plugin IF visible element 1220 */ 1221function wglIsVisibleInit (){ 1222 jQuery.fn.wglIsVisible = function (){ 1223 var elementTop = jQuery(this).offset().top; 1224 var elementBottom = elementTop + jQuery(this).outerHeight(); 1225 var viewportTop = jQuery(window).scrollTop(); 1226 var viewportBottom = viewportTop + jQuery(window).height(); 1227 return elementBottom > viewportTop && elementTop < viewportBottom; 1228 } 1229} 1230 1231/* 1232 ** Preloader 1233 */ 1234jQuery(window).load(function(){ 1235 jQuery('#preloader-wrapper').fadeOut(); 1236}); 1237// wgl image comparison 1238function wglImageComparison() { 1239 var item = jQuery('.wgl-image_comparison.cocoen'); 1240 if (item.length !== 0) { 1241 item.each(function() { 1242 jQuery(this).cocoen(); 1243 }); 1244 } 1245} 1246 1247// Image Layers 1248function wglImgLayers() { 1249 jQuery('.wgl-image-layers').each(function() { 1250 var container = jQuery(this); 1251 var initImageLayers = function() { 1252 container.appear( 1253 function() { 1254 container.addClass('img-layer_animate'); 1255 }, 1256 { done: true } 1257 ); 1258 }; 1259 initImageLayers(); 1260 }); 1261} 1262 1263// Images Gallery 1264function wglImagesGallery() { 1265 var item = '.wgl-gallery_item-wrapper', 1266 gallery_masonry = '.gallery-masonry', 1267 gallery_justified = '.gallery-justified'; 1268 1269 if (jQuery(gallery_masonry).length) { 1270 var dom = jQuery(gallery_masonry).get(0); 1271 var iso = jQuery(gallery_masonry).isotope({ 1272 layoutMode: 'masonry', 1273 percentPosition: true, 1274 itemSelector: item 1275 }); 1276 1277 imagesLoaded(dom, function () { 1278 iso.isotope('layout'); 1279 }); 1280 1281 jQuery(window).on('resize', function () { 1282 iso.isotope(); 1283 }); 1284 } 1285 1286 if (jQuery(gallery_justified).length) { 1287 var dom = jQuery(gallery_justified).get(0); 1288 var jus = jQuery(gallery_justified).justifiedGallery({ 1289 rowHeight: deviceData('height'), 1290 margins: deviceData('gap'), 1291 lastRow: 'nojustify', 1292 captions: false, 1293 }); 1294 1295 imagesLoaded(dom, function () { 1296 jus.justifiedGallery(); 1297 }); 1298 1299 jQuery(window).on('resize', function () { 1300 jus.justifiedGallery({ 1301 rowHeight: deviceData('height'), 1302 margins: deviceData('gap'), 1303 }); 1304 }); 1305 } 1306 1307 function deviceData(option) { 1308 var data = jQuery(gallery_justified).data(option); 1309 if (jQuery('#main').width() <= 767) { 1310 data = jQuery(gallery_justified).data('mobile-' + option); 1311 } else if (jQuery('#main').width() <= 1024) { 1312 data = jQuery(gallery_justified).data('tablet-' + option); 1313 } 1314 return data; 1315 } 1316} 1317 1318function wglIsotope() { 1319 jQuery('.isotope').each(function () { 1320 var $isotope = jQuery(this); 1321 var properties = { 1322 layoutMode: $isotope.hasClass('fit_rows') ? 'fitRows' : 'masonry', 1323 percentPosition: true, 1324 itemSelector: '.portfolio__item, .item, .product', 1325 masonry: { 1326 columnWidth: '.pf_item_size, .portfolio__item, .item, .product', 1327 }, 1328 transitionDuration: $isotope.hasClass('carousel-with-filter') ? 0 : '0.4s', 1329 }; 1330 1331 $isotope.imagesLoaded().isotope(properties); 1332 wglIsotopeFilterHandler(this); 1333 }); 1334} 1335 1336function wglIsotopeFilterHandler(self) { 1337 var filterNode = jQuery(self).closest('.elementor-widget-container').find('.isotope-filter a'); 1338 1339 filterNode.each(function () { 1340 var $this = jQuery(this), 1341 num, 1342 dataFilter = this.dataset.filter; 1343 1344 if ($this.parent().parent().parent().hasClass('product__filter')) { 1345 num = $this 1346 .closest('.wgl-products-grid') 1347 .find('.product') 1348 .filter(dataFilter).length; 1349 } else { 1350 num = $this 1351 .closest('.wgl-portfolio') 1352 .find('.portfolio__item') 1353 .filter(dataFilter).length; 1354 } 1355 $this.find('.filter_counter').text(num); 1356 1357 if (0 === num) { 1358 // mark empty categories 1359 $this.addClass('empty').removeClass('swiper-slide'); 1360 } 1361 }); 1362 1363 filterNode.on('click', function (e) { 1364 e.preventDefault(); 1365 var $this = jQuery(this); 1366 $this.addClass('active').siblings().removeClass('active'); 1367 1368 var dataFilter = $this.attr('data-filter'), 1369 isotopeNode = $this.closest('.elementor-widget-container').find('.isotope'); 1370 1371 isotopeNode.isotope({ filter: dataFilter }); 1372 1373 if (isotopeNode.hasClass('appear-animation')) { 1374 isotopeNode.find('.portfolio__item').addClass('animate'); 1375 } 1376 }); 1377} 1378 1379function wglMenuLavalamp() { 1380 let lavalamp = jQuery( 1381 // menu 1382 '.menu_line_enable > ul' 1383 ); 1384 lavalamp.each(function () { 1385 jQuery(this).lavalamp(); 1386 }); 1387 1388 setTimeout(function(){ 1389 jQuery('.wgl-tabs.has-lavalamp .wgl-tabs_headings').lavalamp(); 1390 },600); 1391} 1392 1393(function($, window) { 1394 let Lavalamp = function(element, options) { 1395 this.element = $(element).data('lavalamp', this); 1396 this.options = $.extend({}, this.options, options); 1397 1398 this.init(); 1399 }; 1400 1401 Lavalamp.prototype = { 1402 options: { 1403 current: 1404 '.current-menu-ancestor,.current-menu-item,.current-category-ancestor,.current-page-ancestor,.current_page_parent' // menu 1405 + ',.wgl-tabs_header.active', // wgl-tabs 1406 items: 1407 'li' // menu 1408 + ',.wgl-tabs_header', // wgl-tabs 1409 bubble: '<div class="lavalamp-object"></div>', 1410 animation: false, 1411 blur: $.noop, 1412 focus: $.noop, 1413 easing: 'easeInOutCubic', // transition timing function 1414 duration: '0.6s' // animation duration 1415 }, 1416 element: null, 1417 current: null, 1418 bubble: null, 1419 _focus: null, 1420 init: function() { 1421 let resizeTimer, 1422 self = this, 1423 child = self.element.children( 1424 'li' // menu 1425 + ',.wgl-tabs_header' // wgl-tabs 1426 ); 1427 1428 this.onWindowResize = function() { 1429 if (resizeTimer) { 1430 clearTimeout(resizeTimer); 1431 } 1432 1433 resizeTimer = setTimeout(function() { 1434 self.reload(); 1435 }, 100); 1436 }; 1437 1438 $(window).bind('resize.lavalamp', this.onWindowResize); 1439 1440 $(child).addClass('lavalamp-item'); 1441 1442 if ( this.element.hasClass('wgl-tabs_headings') 1443 || this.element.parent().hasClass('wgl-tabs_headings')) { 1444 // ↓ Tabs widget 1445 this.element.on('click.lavalamp', '.lavalamp-item', function() { 1446 self._move($(this)); 1447 }); 1448 } else { 1449 // ↓ Menu 1450 this.element 1451 .on('mouseenter.lavalamp', '.lavalamp-item', function() { 1452 self.current.each(function() { 1453 self.options.blur.call(this, self); 1454 }); 1455 1456 self._move($(this)); 1457 }) 1458 .on('mouseleave.lavalamp', function() { 1459 if (self.current.index(self._focus) < 0) { 1460 self._focus = null; 1461 1462 self.current.each(function() { 1463 self.options.focus.call(this, self); 1464 }); 1465 1466 self._move(self.current); 1467 } 1468 }); 1469 } 1470 1471 this.bubble = $.isFunction(this.options.bubble) 1472 ? this.options.bubble.call(this, this.element) 1473 : $(this.options.bubble).prependTo(this.element); 1474 1475 self.element.addClass('lavalamp'); 1476 self.element.find('.lavalamp-object').addClass(self.options.easing); 1477 1478 this.reload(); 1479 1480 self.element.addClass("lavalamp_animate") 1481 }, 1482 reload: function() { 1483 this.current = this.element.children(this.options.current); 1484 1485 if (this.current.size() === 0) { 1486 this.current = this.element 1487 .children() 1488 .not('.lavalamp-object') 1489 .eq(0); 1490 } 1491 1492 this._move(this.current, false); 1493 }, 1494 destroy: function() { 1495 if (this.bubble) { 1496 this.bubble.remove(); 1497 } 1498 1499 this.element.unbind('.lavalamp'); 1500 $(window).unbind('resize.lavalamp', this.onWindowResize); 1501 }, 1502 _move: function(el, animate) { 1503 let pos = el.position(), 1504 cssProperties; 1505 if (el.hasClass('wgl-tabs_header')) { 1506 // ↓ Tabs widget 1507 pos.left = Math.round(pos.left); 1508 1509 cssProperties = { 1510 WebkitTransitionDuration: this.options.duration, 1511 MozTransitionDuration: this.options.duration, 1512 transitionDuration: this.options.duration, 1513 transform: 'translate('+pos.left+'px)', 1514 opacity: 1, 1515 width: Math.round(el.outerWidth()), 1516 left: '0px', 1517 }; 1518 1519 }else{ 1520 // ↓ Menu 1521 let child_width = el.children('a').children('span').width() - 2; 1522 1523 pos.left = pos.left + parseInt(el.children('a').css('paddingLeft')) + 1; 1524 1525 cssProperties = { 1526 WebkitTransitionDuration: this.options.duration, 1527 MozTransitionDuration: this.options.duration, 1528 transitionDuration: this.options.duration, 1529 transform: 'translate(' + pos.left + 'px)', 1530 width: 'calc(' + el.children().width() + 'px)', 1531 marginTop: 'calc(' + el.children().children().outerHeight(false) + 'px - 22px)', 1532 }; 1533 } 1534 1535 this._focus = el; 1536 // Animate bubble 1537 this.bubble.css(cssProperties); 1538 1539 } 1540 }; 1541 1542 $.fn.lavalamp = function(options) { 1543 if (typeof options === 'string') { 1544 let instance = $(this).data('lavalamp'); 1545 return instance[options].apply( 1546 instance, 1547 Array.prototype.slice.call(arguments, 1) 1548 ); 1549 } else { 1550 return this.each(function() { 1551 let instance = $(this).data('lavalamp'); 1552 1553 if (instance) { 1554 $.extend(instance.options, options || {}); 1555 instance.reload(); 1556 } else { 1557 new Lavalamp(this, options); 1558 } 1559 }); 1560 } 1561 }; 1562})(jQuery, window); 1563(function( $ ) { 1564 1565 $(document).on('click', '.sl-button', function() { 1566 var button = $(this), 1567 post_id = button.attr('data-post-id'), 1568 security = button.attr('data-nonce'), 1569 iscomment = button.attr('data-iscomment'), 1570 allbuttons; 1571 1572 if (iscomment === '1') { /* Comments can have same id */ 1573 allbuttons = $('.sl-comment-button-'+post_id); 1574 } else { 1575 allbuttons = $('.sl-button-'+post_id); 1576 } 1577 var loader = allbuttons.next('#sl-loader'); 1578 if (post_id !== '') { 1579 $.ajax({ 1580 type: 'POST', 1581 url: wgl_core.ajaxurl, 1582 data : { 1583 action : 'wgl_theme_like', 1584 post_id : post_id, 1585 nonce : security, 1586 is_comment : iscomment, 1587 }, 1588 beforeSend: function() { 1589 loader.html(' <div class="loader">Loading...</div>'); 1590 }, 1591 success: function(response) { 1592 var icon = response.icon; 1593 var count = response.count; 1594 allbuttons.html(icon+count); 1595 if (response.status === 'unliked') { 1596 allbuttons.prop('title', button.data('title-like')); 1597 allbuttons.removeClass('liked'); 1598 } else { 1599 allbuttons.prop('title', button.data('title-unlike')); 1600 allbuttons.addClass('liked'); 1601 } 1602 loader.empty(); 1603 } 1604 }); 1605 1606 } 1607 return false;
1608 }); 1609 1610})( jQuery ); 1611// Select Wrapper 1612function wglLinkOverlay() { 1613 jQuery('.wgl-link-overlay').each(function() { 1614 let $this = jQuery(this); 1615 let wrapper = $this.closest('.elementor-widget'); 1616 let zIndexItem = 'auto' !== wrapper.css('z-index') ? wrapper.css('z-index') : false; 1617 let position = $this.data('link-position'); 1618 let $link = false; 1619 1620 if (!zIndexItem) { 1621 $this.css('z-index', zIndexItem); 1622 } 1623 1624 switch (position) { 1625 case "1st": 1626 $link = wrapper.parent(); 1627 break; 1628 case "2nd": 1629 $link = wrapper.parent().parent(); 1630 break; 1631 case "3rd": 1632 $link = wrapper.parent().parent().parent(); 1633 break; 1634 case "column": 1635 $link = wrapper.closest(".elementor-column"); 1636 break; 1637 default: 1638 $link = wrapper.closest(".elementor-section"); 1639 } 1640 1641 if ($link) { 1642 $this.prependTo($link); 1643 wrapper.remove(); 1644 } 1645 }); 1646} 1647function wglLinkScroll() { 1648 jQuery('a.smooth-scroll, .smooth-scroll').on('click', function(event) { 1649 var href; 1650 if (this.tagName == 'A') { 1651 href = jQuery.attr(this, 'href'); 1652 } else { 1653 var that = jQuery(this).find('a'); 1654 href = jQuery(that).attr('href'); 1655 } 1656 jQuery('html, body').animate( 1657 { 1658 scrollTop: jQuery(href).offset().top 1659 }, 1660 500 1661 ); 1662 event.preventDefault(); 1663 }); 1664} 1665 1666function wglMessageAnimInit() { 1667 jQuery('body').on('click', '.message_close_button', function (e) { 1668 jQuery(this).parents('.closable').slideUp(350); 1669 }); 1670} 1671 1672function wglMobileHeader() { 1673 var menu = jQuery('.wgl-mobile-header .mobile_nav_wrapper .wgl-menu-outer_content > .primary-nav > ul'); 1674 1675 // Create Mobile Menu plugin 1676 (function ($) { 1677 $.fn.wglMobileMenu = function (options) { 1678 var defaults = { 1679 toggleBtn: '.wgl-mobile-header .hamburger-box', 1680 switcher: '.button_switcher', 1681 back: '.back', 1682 overlay: '.wgl-menu_overlay', 1683 anchor: '.menu-item > a[href*=\\#]', 1684 }; 1685 1686 if (this.length === 0) return this; 1687 1688 return this.each(function () { 1689 var wglMenu = {}, 1690 ds = $(this), 1691 sub_menu = jQuery('.mobile_nav_wrapper .primary-nav > ul ul, .mobile_nav_wrapper .primary-nav > ul .wgl-e-container'), 1692 m_width = jQuery('.mobile_nav_wrapper').data('mobileWidth'), 1693 m_toggle = jQuery('.hamburger-box'), 1694 body = jQuery('body'), 1695 stickyMobile = jQuery('.wgl-mobile-header.wgl-sticky-element'); 1696 1697 // Helper Menu 1698 var open = 'is-active', 1699 openSubMenu = 'show_sub_menu', 1700 mobile_on = 'mobile_switch_on', 1701 mobile_off = 'mobile_switch_off', 1702 mobile_switcher = 'button_switcher'; 1703 1704 var init = function () { 1705 wglMenu.settings = $.extend({}, defaults, options); 1706 createButton(); 1707 showMenu(); 1708 }; 1709 var showMenu = function () { 1710 if (jQuery(window).width() <= m_width) { 1711 if (!m_toggle.hasClass(open)) { 1712 createNavMobileMenu(); 1713 } 1714 } else { 1715 resetNavMobileMenu(); 1716 } 1717 }; 1718 var createNavMobileMenu = function () { 1719 sub_menu.removeClass(openSubMenu); 1720 ds.hide().addClass(mobile_on); 1721 body.removeClass(mobile_on); 1722 }; 1723 var resetNavMobileMenu = function () { 1724 sub_menu.removeClass(openSubMenu); 1725 body.removeClass(mobile_on); 1726 ds.show().removeClass(mobile_on); 1727 m_toggle.removeClass(open); 1728 jQuery('.' + mobile_switcher).removeClass('is-active'); 1729 }; 1730 var createButton = function () { 1731 ds.find('.menu-item-has-children').each(function () { 1732 jQuery(this) 1733 .find('> a') 1734 .append('<span class="' + mobile_switcher + '"></span>'); 1735 }); 1736 }; 1737 var toggleMobileMenu = function (e) { 1738 ds.toggleClass(openSubMenu); 1739 body.toggleClass(mobile_on); 1740 1741 if (body.hasClass(mobile_on)){ 1742 body.removeClass(mobile_off); 1743 wglDisableBodyScroll(true, '.wgl-menu-outer_content'); 1744 }else{ 1745 body.addClass(mobile_off); 1746 wglDisableBodyScroll(false, '.wgl-menu-outer_content'); 1747 } 1748 }; 1749 var hideSubMenu = function (e) { 1750 if (!jQuery('.button_switcher').is(e.target)) { 1751 jQuery('.mobile_nav_wrapper .menu-item-has-children') 1752 .find('.sub-menu, div.wgl-e-container') 1753 .stop(true) 1754 .slideUp(450) 1755 .removeClass(openSubMenu); 1756 1757 jQuery('.mobile_nav_wrapper .menu-item-has-children') 1758 .find('.button_switcher') 1759 .removeClass(open); 1760 1761 if (jQuery(e.target).closest('.wgl-mobile-header').length) { 1762 toggleMobileMenu(); 1763 } 1764 } 1765 }; 1766 var showSubMenu = function (e) { 1767 e.preventDefault(); 1768 var item = jQuery(this).parents('li'); 1769 1770 if (!jQuery(this).hasClass(open)) { 1771 jQuery('.mobile_nav_wrapper .menu-item-has-children') 1772 .not(item) 1773 .find('.sub-menu, div.wgl-e-container') 1774 .stop(true) 1775 .slideUp(450) 1776 .removeClass(openSubMenu); 1777 jQuery('.mobile_nav_wrapper .menu-item-has-children') 1778 .not(item) 1779 .find('.button_switcher') 1780 .removeClass(open); 1781 jQuery('.mobile_nav_wrapper .menu-item-has-children') 1782 .not(item) 1783 .find('a[href*=\\#]') 1784 .removeClass(open); 1785 1786 jQuery(this) 1787 .parent() 1788 .prevAll('.sub-menu, div.wgl-e-container') 1789 .stop(true) 1790 .slideDown(450) 1791 .addClass(openSubMenu); 1792 jQuery(this) 1793 .parent() 1794 .nextAll('.sub-menu, div.wgl-e-container') 1795 .stop(true) 1796 .slideDown(450) 1797 .addClass(openSubMenu); 1798 } else { 1799 jQuery(this) 1800 .parent() 1801 .prevAll('.sub-menu, div.wgl-e-container') 1802 .stop(true) 1803 .slideUp(450) 1804 .removeClass(openSubMenu); 1805 jQuery(this) 1806 .parent() 1807 .nextAll('.sub-menu, div.wgl-e-container') 1808 .stop(true) 1809 .slideUp(450) 1810 .removeClass(openSubMenu); 1811 } 1812 1813 jQuery(this).toggleClass(open); 1814 }; 1815 var eventClose = function (e) { 1816 var container = $('.wgl-menu_outer'); 1817 1818 if ( 1819 !container.is(e.target) && 1820 container.has(e.target).length === 0 && 1821 $('body').hasClass(mobile_on) 1822 ) { 1823 toggleMobileMenu(); 1824 } 1825 }; 1826 var goBack = function (e) { 1827 e.preventDefault(); 1828 jQuery(this).closest('.sub-menu').removeClass(openSubMenu); 1829 jQuery(this).closest('.sub-menu').prev('a').removeClass(open); 1830 jQuery(this) 1831 .closest('.sub-menu') 1832 .prev('a') 1833 .find('.' + mobile_switcher) 1834 .removeClass(open); 1835 }; 1836 var mobileSticky = function(){ 1837 var top = jQuery(stickyMobile).height(); 1838 var y = jQuery(window).scrollTop(); 1839 if ( y >= top ) { 1840 jQuery(stickyMobile).addClass( 'sticky_mobile' ); 1841 } else { 1842 jQuery(stickyMobile).removeClass('sticky_mobile'); 1843 } 1844 }; 1845 1846 // Init 1847 init(); 1848 1849 jQuery(wglMenu.settings.toggleBtn).on(click, toggleMobileMenu); 1850 jQuery(wglMenu.settings.overlay).on(click, eventClose); 1851 1852 // Switcher menu 1853 jQuery(wglMenu.settings.switcher).on(click, showSubMenu); 1854 jQuery(wglMenu.settings.anchor).on(click, hideSubMenu); 1855 1856 // Go back menu 1857 jQuery(wglMenu.settings.back).on(click, goBack); 1858 1859 jQuery(window).resize(function () { 1860 showMenu(); 1861 }); 1862 1863 if ( stickyMobile.length !== 0 && body.hasClass('admin-bar') ) { 1864 mobileSticky(); 1865 1866 jQuery( window ).scroll( 1867 function() { 1868 if (jQuery(window).width() <= stickyMobile.find('.mobile_nav_wrapper').data('mobileWidth')) { 1869 mobileSticky(); 1870 } 1871 } 1872 ); 1873 jQuery( window ).resize( 1874 function() { 1875 if (jQuery(window).width() <= stickyMobile.find('.mobile_nav_wrapper').data('mobileWidth')) { 1876 mobileSticky(); 1877 } 1878 } 1879 ); 1880 } 1881 }); 1882 }; 1883 })(jQuery); 1884 1885 menu.wglMobileMenu(); 1886} 1887 1888var wglDisableBodyScroll = (function () { 1889 1890 var _selector = false, 1891 _element = false, 1892 _clientY; 1893 1894 if (!Element.prototype.matches) 1895 Element.prototype.matches = Element.prototype.msMatchesSelector || 1896 Element.prototype.webkitMatchesSelector; 1897 1898 if (!Element.prototype.closest) 1899 Element.prototype.closest = function (s) { 1900 var ancestor = this; 1901 if (!document.documentElement.contains(el)) return null; 1902 do { 1903 if (ancestor.matches(s)) return ancestor; 1904 ancestor = ancestor.parentElement; 1905 } while (ancestor !== null); 1906 return el; 1907 }; 1908 1909 var preventBodyScroll = function (event) { 1910 if (false === _element || !event.target.closest(_selector)) { 1911 event.preventDefault(); 1912 } 1913 }; 1914 1915 var captureClientY = function (event) { 1916 if (event.targetTouches.length === 1) { 1917 _clientY = event.targetTouches[0].clientY; 1918 } 1919 }; 1920 1921 var preventOverscroll = function (event) { 1922 if (event.targetTouches.length !== 1) { 1923 return; 1924 } 1925 1926 var clientY = event.targetTouches[0].clientY - _clientY; 1927 1928 if (_element.scrollTop === 0 && clientY > 0) { 1929 event.preventDefault(); 1930 } 1931 1932 if ((_element.scrollHeight - _element.scrollTop <= _element.clientHeight) && clientY < 0) { 1933 event.preventDefault(); 1934 } 1935 }; 1936 1937 return function (allow, selector) { 1938 if (typeof selector !== "undefined") { 1939 _selector = selector; 1940 _element = document.querySelector(selector); 1941 } 1942 1943 if (true === allow) { 1944 if (false !== _element) { 1945 _element.addEventListener('touchstart', captureClientY, false); 1946 _element.addEventListener('touchmove', preventOverscroll, false); 1947 } 1948 document.body.addEventListener("touchmove", preventBodyScroll, false); 1949 } else { 1950 if (false !== _element) { 1951 _element.removeEventListener('touchstart', captureClientY, false); 1952 _element.removeEventListener('touchmove', preventOverscroll, false); 1953 } 1954 document.body.removeEventListener("touchmove", preventBodyScroll, false); 1955 } 1956 }; 1957}()); 1958// wgl Page Title Parallax 1959function wglPageTitleParallax() { 1960 var page_title = jQuery('.page-header.page_title_parallax') 1961 if (page_title.length !== 0) {
1962 if ( !/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent || navigator.vendor || window.opera) ) { 1963 page_title.paroller(); 1964 } 1965 } 1966} 1967 1968// wgl Extended Parallax 1969function wglExtendedParallax() { 1970 var item = jQuery('.extended-parallax') 1971 if (item.length !== 0) { 1972 if ( !/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent || navigator.vendor || window.opera) ) { 1973 item.each(function () { 1974 jQuery(this).paroller(); 1975 }) 1976 } 1977 } 1978} 1979// wgl Portfolio Single Parallax 1980function wglPortfolioParallax() { 1981 var portfolio = jQuery('.wgl-portfolio-item_bg.portfolio_parallax') 1982 if (portfolio.length !== 0 ) { 1983 portfolio.paroller(); 1984 } 1985} 1986 1987function wglParallaxVideo() { 1988 jQuery('.parallax-video').each(function() { 1989 jQuery(this).jarallax({ 1990 loop: true, 1991 speed: 1, 1992 videoSrc: jQuery(this).data('video'), 1993 videoStartTime: jQuery(this).data('start'), 1994 videoEndTime: jQuery(this).data('end') 1995 }); 1996 }); 1997} 1998 1999function wglParticlesCustom() { 2000 jQuery('.wgl-particles-js').each(function() { 2001 var id = jQuery(this).attr('id'); 2002 var type = jQuery(this).data('particles-type'); 2003 var color_type = jQuery(this).data('particles-colors-type'); 2004 var color = jQuery(this).data('particles-color'); 2005 var color_line = jQuery(this).data('particles-color'); 2006 var number = jQuery(this).data('particles-number'); 2007 var lines = jQuery(this).data('particles-line'); 2008 var size = jQuery(this).data('particles-size'); 2009 var speed = jQuery(this).data('particles-speed'); 2010 var hover = jQuery(this).data('particles-hover'); 2011 var hover_mode = jQuery(this).data('particles-hover-mode'); 2012 switch (type) { 2013 case 'particles': 2014 default: 2015 type = 'circle'; 2016 break; 2017 case 'hexagons': 2018 type = 'polygon'; 2019 break; 2020 } 2021 if (color_type == 'random_colors') { 2022 color = color.split(','); 2023 color_line = color[0]; 2024 } 2025 2026 tsParticles.load(id, { 2027 particles: { 2028 number: { 2029 value: number, 2030 density: { 2031 enable: true, 2032 value_area: 800 2033 } 2034 }, 2035 color: { 2036 value: color 2037 }, 2038 shape: { 2039 type: type, 2040 polygon: { 2041 nb_sides: 6 2042 } 2043 }, 2044 opacity: { 2045 value: 1, 2046 random: true, 2047 anim: { 2048 enable: false, 2049 speed: 1, 2050 opacity_min: 0.1, 2051 sync: false 2052 } 2053 }, 2054 size: { 2055 value: size, 2056 random: true, 2057 anim: { 2058 enable: false, 2059 speed: 30, 2060 size_min: 1, 2061 sync: false 2062 } 2063 }, 2064 line_linked: { 2065 enable: lines, 2066 distance: 150, 2067 color: color_line, 2068 opacity: 0.4, 2069 width: 1 2070 }, 2071 move: { 2072 enable: true, 2073 speed: speed, 2074 direction: 'none', 2075 random: false, 2076 straight: false, 2077 out_mode: 'out', 2078 bounce: false, 2079 attract: { 2080 enable: false, 2081 rotateX: 600, 2082 rotateY: 1200 2083 } 2084 } 2085 }, 2086 interactivity: { 2087 detect_on: 'canvas', 2088 events: { 2089 onhover: { 2090 enable: hover, 2091 mode: hover_mode 2092 }, 2093 onclick: { 2094 enable: true, 2095 mode: 'push' 2096 }, 2097 resize: true 2098 }, 2099 modes: { 2100 grab: { 2101 distance: 150, 2102 line_linked: { 2103 opacity: 1 2104 } 2105 }, 2106 bubble: { 2107 distance: 200, 2108 size: size * 1.6, 2109 duration: 20, 2110 opacity: 1, 2111 speed: 30 2112 }, 2113 repulse: { 2114 distance: 80, 2115 duration: 0.4 2116 }, 2117 push: { particles_nb: 4 }, 2118 remove: { particles_nb: 2 } 2119 } 2120 }, 2121 retina_detect: true 2122 }); 2123 var update; 2124 update = function() { 2125 requestAnimationFrame(update); 2126 }; 2127 requestAnimationFrame(update); 2128 }); 2129} 2130 2131function wglParticlesImageCustom() { 2132 2133 jQuery('.wgl-particles-img-js').each(function () { 2134 var id = jQuery(this).attr('id'); 2135 var color = jQuery(this).data('particles-color') || "#000000"; 2136 2137 var number = jQuery(this).data('particles-number'); 2138 var lines = jQuery(this).data('particles-line'); 2139 var size = jQuery(this).data('particles-size'); 2140 var speed = jQuery(this).data('particles-speed'); 2141 var hover = jQuery(this).data('particles-hover'); 2142 var hover_mode = jQuery(this).data('particles-hover-mode'); 2143 var rotate = jQuery(this).data('particles-rotate'); 2144 rotate = rotate === 'yes' ? true : false;
2145 var rotate_speed = jQuery(this).data('particles-rotate-animation') || 0; 2146 2147 var img_src = jQuery(this).data('image').split(","); 2148 2149 var imageElement = []; 2150 2151 img_src.forEach(function (item, i, arr) { 2152 var url = new URL(item); 2153 var element = {}; 2154 element.height = url.searchParams.get('height'); 2155 element.replaceColor = true; 2156 element.src = item.split('?')[0]; 2157 element.width = url.searchParams.get('width'); 2158 element.fill = true; 2159 element.close = true; 2160 imageElement.push(element); 2161 }); 2162 2163 tsParticles.load(id, { 2164 "detectRetina": true, 2165 "fpsLimit": 60, 2166 "particles": { 2167 "number": { 2168 "value": number, 2169 "density": { 2170 "enable": true, 2171 "area": 800 2172 }, 2173 "limit": 0, 2174 }, 2175 "color": { 2176 "value": color 2177 }, 2178 "shape": { 2179 "image": imageElement, 2180 "polygon": { 2181 "close": true, 2182 "fill": true, 2183 "sides": 5 2184 }, 2185 "type": "image", 2186 "custom": {} 2187 }, 2188 "opacity": { 2189 "animation": { 2190 "enable": false, 2191 "minimumValue": 0.1, 2192 "speed": 1, 2193 "sync": false 2194 }, 2195 "random": { 2196 "enable": false, 2197 "minimumValue": 1 2198 }, 2199 "value": 1 2200 }, 2201 "size": { 2202 "animation": { 2203 "enable": false, 2204 "minimumValue": 1, 2205 "speed": 40, 2206 "sync": false 2207 }, 2208 "random": { 2209 "enable": false, 2210 "minimumValue": 1 2211 }, 2212 "value": size 2213 }, 2214 2215 "lineLinked": { 2216 "blink": false, 2217 "color": { 2218 "value": color 2219 }, 2220 "consent": false, 2221 "distance": 150, 2222 "enable": lines, 2223 "opacity": 0.4, 2224 "width": 1 2225 }, 2226 "move": { 2227 "collisions": false, 2228 "direction": "none", 2229 "enable": true, 2230 "outMode": "out", 2231 "random": false, 2232 "speed": speed, 2233 "straight": false, 2234 "attract": { 2235 "enable": false, 2236 "rotate": { 2237 "x": 600, 2238 "y": 1200 2239 } 2240 }, 2241 }, 2242 "rotate": { 2243 "animation": { 2244 "enable": rotate, 2245 "speed": rotate_speed, 2246 "sync": false 2247 }, 2248 "direction": "random", 2249 "random": true, 2250 "value": 0 2251 }, 2252 "stroke": { 2253 "color": { 2254 "value": color 2255 }, 2256 "width": 0, 2257 "opacity": 1 2258 } 2259 }, 2260 "interactivity": { 2261 "detectsOn": "canvas", 2262 "events": { 2263 "onClick": { 2264 "enable": false, 2265 "mode": "push" 2266 }, 2267 "onHover": { 2268 "enable": hover, 2269 "mode": hover_mode, 2270 "parallax": { 2271 "enable": false, 2272 "force": 60, 2273 "smooth": 10 2274 } 2275 }, 2276 "resize": true 2277 }, 2278 "modes": { 2279 "bubble": { 2280 "distance": 200, 2281 "duration": 20, 2282 "opacity": 1, 2283 "size": size * 1.6, 2284 }, 2285 "connect": { 2286 "distance": 80, 2287 "lineLinked": { 2288 "opacity": 0.5 2289 }, 2290 "radius": 60 2291 }, 2292 "grab": { 2293 "distance": 150, 2294 "lineLinked": { 2295 "opacity": 1, 2296 } 2297 }, 2298 "push": { 2299 "quantity": 4 2300 }, 2301 "remove": { 2302 "quantity": 2 2303 }, 2304 "repulse": { 2305 "distance": 200, 2306 "duration": 0.4 2307 }, 2308 "slow": { 2309 "factor": 1, 2310 "radius": 0 2311 } 2312 } 2313 }, 2314 "backgroundMask": { 2315 "cover": { 2316 "color": { 2317 "value": "#fff" 2318 }, 2319 "opacity": 1 2320 }, 2321 "enable": false 2322 }, 2323 "pauseOnBlur": true, 2324 "background": {} 2325 }); 2326 2327 var update; 2328 update = function () { 2329 requestAnimationFrame(update); 2330 }; 2331 requestAnimationFrame(update); 2332 2333 2334 2335 }); 2336} 2337 2338// wgl Pie Chart 2339function wglPieChartInit() { 2340 2341 var item = jQuery('.wgl-pie_chart'); 2342 2343 if (item.length) { 2344 item.each(function() { 2345 var chart = item.find('.chart'); 2346 2347 item.appear(function() { 2348 jQuery(chart).easyPieChart({ 2349 barColor: jQuery(this).data("barColor"), 2350 trackColor: jQuery(this).data("trackColor"), 2351 scaleColor: false, 2352 lineCap: 'square', 2353 lineWidth: jQuery(this).data("lineWidth"), 2354 animate: { duration: 1400, enabled: true }, 2355 size: jQuery(this).data("size"), 2356 onStep: function(from, to, percent) { 2357 jQuery(this.el).find('.chart__percent').text(Math.round(percent) + '%'); 2358 } 2359 }); 2360 }); 2361 }); 2362 } 2363} 2364// http://brutaldesign.github.io/swipebox/
2365function wglVideoboxInit() { 2366 var gallery = jQuery(".videobox, .swipebox, .gallery a[href$='.jpg'], .gallery a[href$='.jpeg'], .gallery a[href$='.JPEG'], .gallery a[href$='.gif'], .gallery a[href$='.png']"); 2367 if (gallery.length !== 0 ) { 2368 gallery.each(function() { 2369 jQuery(this).attr('data-elementor-open-lightbox', 'yes'); 2370 }); 2371 } 2372} 2373// WGL Progress Bar 2374 2375function wglProgressBarsInit(item) { 2376 let widgetSelector = '.wgl-progress-bar', 2377 widgetEl = item ? jQuery(item).find(widgetSelector) : jQuery(widgetSelector); 2378 2379 widgetEl.each(function () { 2380 let $_this = jQuery(this), 2381 bar = $_this.find('.bar__filled'), 2382 2383 value = bar.data('value'), 2384 max = bar.data('max-value'), 2385 speed = bar.data('speed'), 2386 sep = bar.data('sep'), 2387 2388 progressWidth = (value / max) * 100; 2389 2390 $_this.appear(function() { 2391 $_this.find('.value__digit').countTo({ 2392 from: 0, 2393 to: value, 2394 speed: speed, 2395 refreshInterval: 10, 2396 separator: sep 2397 }); 2398 bar.css({ 2399 'width': progressWidth + '%', 2400 'transitionDuration': speed + 'ms', 2401 }); 2402 2403 if ($_this.hasClass('layout-dynamic')) { 2404 $_this.find('.progress__content').css({ 2405 'width': progressWidth + '%', 2406 'transitionDuration': speed + 'ms', 2407 }); 2408 } 2409 }); 2410 }); 2411} 2412 2413function wglSearchInit() { 2414 2415 // Create plugin Search 2416 (function($) { 2417 2418 $.fn.wglSearch = function(options) { 2419 var defaults = { 2420 'toggleID' : '.header_search-button', 2421 'closeID' : '.header_search-close', 2422 'searchField' : '.header_search-field', 2423 'body' : 'body > *:not(header)', 2424 }; 2425 2426 if (this.length === 0) { return this; } 2427 2428 return this.each(function() { 2429 var wglSearch = {}, 2430 s = $(this), 2431 openClass = 'header_search-open', 2432 searchClass = '.header_search', 2433 2434 init = function() { 2435 wglSearch.settings = $.extend({}, defaults, options); 2436 }, 2437 open = function() { 2438 $(s).addClass(openClass); 2439 setTimeout(function() { 2440 $(s) 2441 .find('input.search-field') 2442 .focus(); 2443 }, 400); 2444 return false; 2445 }, 2446 close = function() { 2447 $(s).removeClass(openClass); 2448 }, 2449 toggleSearch = function(e) { 2450 if (! $(s).closest(searchClass).hasClass(openClass)) { 2451 open(); 2452 } else { 2453 close(); 2454 } 2455 }, 2456 eventClose = function(e) { 2457 if (! $(e.target).closest('.search-form').length) { 2458 if ($(searchClass).hasClass(openClass)) { 2459 close(); 2460 } 2461 } 2462 }; 2463 $(document).bind('keydown', function(e) { 2464 if (e.which === 27 && $(searchClass).hasClass(openClass)) close(); 2465 }); 2466 2467 // Init 2468 init(); 2469 2470 if ($(this).hasClass('search_standard') || $(this).hasClass('search_standard_fw')) { 2471 $(this).find(wglSearch.settings.toggleID).on(click, toggleSearch); 2472 $(this).find(wglSearch.settings.closeID).on(click, eventClose); 2473 } else { 2474 $(wglSearch.settings.toggleID).on(click, toggleSearch); 2475 $(wglSearch.settings.searchField).on(click, eventClose); 2476 } 2477 2478 $(wglSearch.settings.body).on(click, eventClose); 2479 2480 }); 2481 2482 }; 2483 2484 })(jQuery); 2485 2486 jQuery('.header_search').wglSearch(); 2487 2488} 2489// WGL Counter 2490function wglServiceInit() { 2491 Array.prototype.forEach.call(document.querySelectorAll(".toggling_content .wgl-service_wrapper_description, .toggling_image .wgl-service_media"), function(hideable) { 2492 hideable.style.setProperty('--max-height', hideable.scrollHeight + 'px') 2493 }); 2494} 2495window.addEventListener('resize', function(event) { 2496 wglServiceInit(); 2497}, true); 2498// Showcase 2499 2500function wglShowcaseInit() { 2501 let $showcase = jQuery('.wgl-showcase.slide-showcase, .wgl-showcase.fade_bg-showcase'); 2502 if ($showcase.length) { 2503 $showcase.each(function(){
2504 let $this = jQuery(this), 2505 image = $this.find('.showcase__image'), 2506 title = $this.find('.showcase__title'); 2507 2508 image.eq(0).addClass("active"); 2509 title.eq(0).addClass("active"); 2510 2511 let indexItem = $this.find('.wgl-double-heading'); 2512 indexItem = indexItem.length > 0 ? 1 : 0; 2513 title.on('touchstart mouseenter', function(){ 2514 let obj = jQuery(this); 2515 if(!obj.hasClass("active")){ 2516 image.removeClass("active").eq(obj.index() - indexItem).addClass("active"); 2517 title.removeClass("active").eq(obj.index() - indexItem).addClass("active"); 2518 } 2519 }).on("touchend mouseleave", function () { 2520 let obj = jQuery(this); 2521 if(!obj.hasClass("active")){ 2522 image.removeClass("active").eq(obj.index() - indexItem).addClass("active"); 2523 title.removeClass("active").eq(obj.index() - indexItem).addClass("active"); 2524 } 2525 }); 2526 2527 $this.addClass("showcase__init"); 2528 }) 2529 } 2530} 2531function wglSidePanelInit() { 2532 2533 // Create plugin Side Panel 2534 (function($) { 2535 2536 $.fn.wglSidePanel = function(options) { 2537 var defaults = { 2538 "toggleID" : ".side_panel-toggle", 2539 "closeID" : ".side-panel_close", 2540 "closeOverlay" : ".side-panel_overlay", 2541 "body" : "body > *:not(header)", 2542 "sidePanel" : "#side-panel .side-panel_sidebar" 2543 }; 2544 2545 if (this.length === 0) { return this; } 2546 2547 return this.each(function () { 2548 var wglSidePanel = {}, 2549 s = $(this), 2550 openClass = 'side-panel_open', 2551 wglScroll, 2552 sidePanelClass = '.side_panel', 2553 $side_panel = $('#side-panel'), 2554 2555 init = function() { 2556 wglSidePanel.settings = $.extend({}, defaults, options); 2557 }, 2558 open = function () { 2559 if (! $side_panel.hasClass('side-panel_active')) { 2560 $side_panel.addClass('side-panel_active'); 2561 } 2562 2563 $side_panel.addClass(openClass); 2564 $(s).addClass(openClass); 2565 $('body').removeClass('side-panel--closed').addClass('side-panel--opened'); 2566 2567 var wglClassAnimated = $side_panel.find('section.elementor-element').data('settings'); 2568 if (wglClassAnimated && wglClassAnimated.animation) { 2569 $side_panel.find('section.elementor-element').removeClass('elementor-invisible').addClass('animated').addClass(wglClassAnimated.animation); 2570 } 2571 }, 2572 close = function () { 2573 $(s).removeClass(openClass); 2574 $side_panel.removeClass(openClass); 2575 $('body').removeClass('side-panel--opened').addClass('side-panel--closed'); 2576 var wglClassAnimated = $side_panel.find('section.elementor-element').data('settings'); 2577 if (wglClassAnimated && wglClassAnimated.animation) { 2578 $side_panel.find('section.elementor-element').removeClass(wglClassAnimated.animation); 2579 } 2580 }, 2581 togglePanel = function(e) { 2582 e.preventDefault(); 2583 wglScroll = $(window).scrollTop(); 2584 2585 if (! $(s).closest(sidePanelClass).hasClass(openClass)) { 2586 open(); 2587 $(window).scroll(function() { 2588 if (450 < Math.abs($(this).scrollTop() - wglScroll)) { 2589 close(); 2590 } 2591 }); 2592 } else { 2593 2594 } 2595 }, 2596 closePanel = function(e) { 2597 e.preventDefault(); 2598 if ($(s).closest(sidePanelClass).hasClass(openClass)) { 2599 close(); 2600 } 2601 }, 2602 eventClose = function(e) { 2603 var element = $(sidePanelClass); 2604 2605 if (! $side_panel.is(e.target) && $side_panel.has(e.target).length === 0) { 2606 if ($(element).hasClass(openClass)) { 2607 close(); 2608 } 2609 } 2610 }; 2611 2612 init(); 2613 2614 $(wglSidePanel.settings.toggleID).on(click, togglePanel); 2615 $(wglSidePanel.settings.body).on(click, eventClose); 2616 $(wglSidePanel.settings.closeID).on(click, closePanel); 2617 $(wglSidePanel.settings.closeOverlay).on(click, closePanel); 2618 2619 $(document).bind('keydown', function(e) { 2620 if (e.which === 27 && $(sidePanelClass).hasClass(openClass)) close(); 2621 }); 2622 }); 2623 }; 2624 2625 })(jQuery); 2626 2627 if (jQuery('#side-panel').length) { 2628 jQuery('.side_panel').wglSidePanel(); 2629 } 2630} 2631function wglSkrollrInit() { 2632 var blog_scroll = jQuery('.blog_skrollr_init'); 2633 if (blog_scroll.length) {
2634 if ( !/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent || navigator.vendor || window.opera) ) { 2635 // wgl Skrollr 2636 skrollr.init({ 2637 smoothScrolling: false, 2638 forceHeight: false 2639 }); 2640 } 2641 } 2642} 2643 2644// WGL Steps 2645 2646function wglInitStepsAppear() { 2647 let $steps = jQuery('.wgl-steps.appear_anim'); 2648 $steps.each(function() { 2649 jQuery(this).appear(function() { 2650 let item_appear = jQuery(this).find('.steps-single-wrap'); 2651 if (item_appear.length) { 2652 item_appear.each(function() { 2653 jQuery(this).addClass('show'); 2654 }); 2655 } 2656 }); 2657 }); 2658} 2659function wglStickyInit() { 2660 2661 var $header = jQuery('.wgl-theme-header'), 2662 $stickyHeader = jQuery('.wgl-sticky-header'), 2663 $noticesWrapper = jQuery('.wgl_notices_wrapper'), 2664 $mobileSticky = $header.find('.wgl-mobile-header.wgl-sticky-element'), 2665 stickyHeight = $stickyHeader.length !== 0 ? $stickyHeader.height() : 0, 2666 data = $stickyHeader.length !== 0 ? $stickyHeader.data('style') : 'none', 2667 m_width = jQuery('body').data( "mobileWidth" ), 2668 previousScroll = 0, 2669 previousScrollNotice = 0; 2670 2671 const scrollSize = jQuery(window).scrollTop(); 2672 2673 function init(element) { 2674 if ( ! element || m_width >= jQuery(window).width() ) { 2675 $stickyHeader.removeClass('sticky_active'); 2676 return; 2677 } 2678 2679 let scrollSize = jQuery(window).scrollTop(); 2680 if ( data === 'standard' ) { 2681 if ( scrollSize >= stickyHeight && 0 !== stickyHeight ) { 2682 $stickyHeader.addClass( 'sticky_active' ); 2683 } else { 2684 $stickyHeader.removeClass( 'sticky_active' ); 2685 } 2686 } else { 2687 if ( scrollSize > stickyHeight ) { 2688 if ( scrollSize > previousScroll ) { 2689 $stickyHeader.removeClass( 'sticky_active' ); 2690 } else { 2691 $stickyHeader.addClass( 'sticky_active' ); 2692 } 2693 } else { 2694 $stickyHeader.removeClass('sticky_active'); 2695 } 2696 } 2697 previousScroll = scrollSize; 2698 }; 2699 function initNoticeSticky(element) { 2700 let scrollSize = jQuery(window).scrollTop(); 2701 if ( scrollSize > stickyHeight ) { 2702 $noticesWrapper.removeClass( 'stick_home' ); 2703 if ( scrollSize > previousScrollNotice || 0 === stickyHeight || m_width >= jQuery(window).width() ) { 2704 $noticesWrapper.addClass( 'stick_top' ); 2705 } else { 2706 $noticesWrapper.removeClass( 'stick_top' ); 2707 } 2708 } else { 2709 $noticesWrapper.addClass( 'stick_home' ).removeClass( 'stick_top' ); 2710 } 2711 previousScrollNotice = scrollSize; 2712 } 2713 2714 if ( $noticesWrapper.length !== 0 ) { 2715 function setCss() { 2716 $noticesWrapper.css({ 2717 '--height': $header.height() + 'px', 2718 '--sticky-height': stickyHeight + 'px', 2719 '--mobile-sticky-height': $mobileSticky.length !== 0 ? $mobileSticky.height() + 'px' : '0', 2720 'opacity': 1 2721 }); 2722 } 2723 if (scrollSize === 0) { 2724 $noticesWrapper.addClass('stick_home'); 2725 }else if(scrollSize >= stickyHeight) { 2726 $noticesWrapper.addClass( 'stick_top' ); 2727 } 2728 2729 setCss(); 2730 jQuery( window ).scroll( function() { 2731 initNoticeSticky(jQuery(this)); 2732 } ); 2733 jQuery( window ).resize( function() { 2734 initNoticeSticky(jQuery(this)); 2735 setCss(); 2736 } ); 2737 } 2738 2739 if ( $stickyHeader.length !== 0 ) { 2740 jQuery( window ).scroll( function() { 2741 init(jQuery(this)); 2742 } ); 2743 2744 jQuery( window ).resize( function() { 2745 init(jQuery(this)); 2746 } ); 2747 } 2748} 2749function wglStickySidebar() { 2750 if (jQuery('.sticky-sidebar').length) { 2751 jQuery('body').addClass('sticky-sidebar_init'); 2752 jQuery('.sticky-sidebar').each(function() { 2753 jQuery(this).theiaStickySidebar({ 2754 additionalMarginTop: 150, 2755 additionalMarginBottom: 30 2756 }); 2757 }); 2758 } 2759 2760 if (jQuery('.sticky_layout .info-wrapper').length) { 2761 jQuery('.sticky_layout .info-wrapper').each(function() { 2762 jQuery(this).theiaStickySidebar({ 2763 additionalMarginTop: 150, 2764 additionalMarginBottom: 150 2765 }); 2766 }); 2767 } 2768} 2769 2770function wglStripedServicesInit() { 2771 let item_wrap = jQuery('.wgl-striped-services'); 2772 if (item_wrap.length) { 2773 item_wrap.each(function() { 2774 let item = jQuery(this).find('.service-item'); 2775 item.on('mouseenter', function() { 2776 item_wrap.addClass('onhover'); 2777 item.removeClass('active'); 2778 jQuery(this).addClass('active'); 2779 }); 2780 item.on('mouseleave', function() { 2781 item_wrap.removeClass('onhover'); 2782 }); 2783 }); 2784 } 2785} 2786 2787// Tabs 2788
2789function wglTabsInit() { 2790 let $tabs = jQuery('.wgl-tabs'); 2791 if ($tabs.length) { 2792 $tabs.each(function(){ 2793 let $this = jQuery(this); 2794 let tab = $this.find('.wgl-tabs_headings .wgl-tabs_header'); 2795 let data = $this.find('.wgl-tabs_content-wrap .wgl-tabs_content'); 2796 let $contentWrap = $this.find('.wgl-tabs_content-wrap'); 2797 let height = data.filter(':first').outerHeight(); 2798 2799 tab.filter(':first').addClass('active'); 2800 2801 data.filter(':first').addClass('active'); 2802 data.filter(':not(:first)').hide(); 2803 $contentWrap.css({ 'height': height }); 2804 tab.each(function(){ 2805 let currentTab = jQuery(this); 2806 2807 currentTab.on('click tap', function(){ 2808 let id = currentTab.data('tab-id'); 2809 let currentData = jQuery('.wgl-tabs .wgl-tabs_content[data-tab-id='+id+']'); 2810 height = currentData.outerHeight(); 2811 2812 $contentWrap.css({ 'height': height }); 2813 currentTab.addClass('active').siblings().removeClass('active'); 2814 currentData.addClass('active').slideDown().siblings().removeClass('active').slideUp(); 2815 }); 2816 }); 2817 }) 2818 } 2819} 2820 2821// Tabs Horizontal 2822 2823function wglTabsHorizontalInit() { 2824 let $tabs_horizontal = jQuery('.wgl-tabs-horizontal'); 2825 if ($tabs_horizontal.length) { 2826 $tabs_horizontal.each(function(){ 2827 let $this = jQuery(this), 2828 tab = $this.find('.wgl-tabs-horizontal_headings .wgl-tabs-horizontal_header_wrap'), 2829 data = $this.find('.wgl-tabs-horizontal_content-wrap .wgl-tabs-horizontal_content'), 2830 mh = Math.max.apply(Math, data.map(function(){ 2831 return jQuery(this).height(); 2832 }).get()); 2833 2834 $this.css({'min-height': mh }); 2835 2836 tab.filter(':first').addClass('active'); 2837 2838 data.filter(':not(:first)').hide(); 2839 tab.each(function(){ 2840 var currentTab = jQuery(this); 2841 2842 currentTab.on('click tap', function(){ 2843 var id = currentTab.data('tab-id'); 2844 2845 currentTab.addClass('active').siblings().removeClass('active'); 2846 jQuery('.wgl-tabs-horizontal .wgl-tabs-horizontal_content[data-tab-id='+id+']').slideDown().siblings().slideUp(); 2847 }); 2848 }); 2849 }) 2850 } 2851} 2852 2853function wglTextBackground() { 2854 var anim_text = jQuery('.wgl-animation-background-text'); 2855 if (anim_text.length) { 2856 anim_text.each(function(index) { 2857 var paralax_text = jQuery('<div class="wgl-background-text"/>'); 2858 2859 jQuery(this) 2860 .find('>div:eq(0)') 2861 .before(paralax_text); 2862 var text = window.getComputedStyle(this, ':before').content; 2863 2864 text = text.slice(1, -1); 2865 2866 paralax_text.addClass('element-' + index); 2867 paralax_text.attr('data-info', index); 2868 2869 jQuery(this) 2870 .find(paralax_text) 2871 .html(text.replace(/([^\x00-\x80]|\w)/g, "<span class='letter'>$&</span>")) 2872 .appear(function() { 2873 if (typeof anime === 'function') { 2874 var item_anime = jQuery(this) 2875 .data('info'); 2876 2877 if (item_anime === index) { 2878 anime.timeline({ loop: false }).add({ 2879 targets: '.element-' + index + ' .letter', 2880 translateY: [100, 0], 2881 translateZ: 0, 2882 opacity: [0, 1], 2883 easing: 'easeOutExpo', 2884 duration: 1400, 2885 delay: function(el, i) { 2886 return 0 + 350 * i; 2887 } 2888 }); 2889 } 2890 } 2891 }); 2892 }); 2893 } 2894} 2895 2896// WGL Time Line Vertical appear 2897function wglInitTimelineAppear() { 2898 2899 var item = jQuery('.wgl-timeline-vertical.appear_animation [class*="tlv__items-"]'); 2900 2901 if (item.length) { 2902 item.each(function() { 2903 var item = jQuery(this); 2904 item.appear(function() { 2905 item.addClass('show'); 2906 }); 2907 }); 2908 } 2909} 2910// WGL Time Line Horizontal 2911 2912function wglTimelineHorizontal() { 2913 var timeline_swiper = jQuery('.wgl-timeline-horizontal'); 2914 if (timeline_swiper.length) { 2915 timeline_swiper.each(function () { 2916 if (window.elementorFrontend) { 2917 if (window.elementorFrontend.isEditMode()) { 2918 wglTimilineSwiperInit(jQuery(this)); 2919 } else { 2920 elementorFrontend.on('components:init', () => { 2921 wglTimilineSwiperInit(jQuery(this)) 2922 }); 2923 } 2924 } 2925 }); 2926 } 2927} 2928function wglTimilineSwiperInit(self) { 2929 2930 const $container = self.find('.time_line_h-date_container'), 2931 $date_swiper = self.find('.time_line_h-date_container'), 2932 $content_swiper = self.find('.time_line_h-content_container'); 2933 2934 let wglDateSwiper, 2935 wglContentSwiper; 2936 2937 const configData = $container.data('swiper') ? $container.data('swiper')
2937: {}; 2938 const itemID = $container.data('item-carousel') ? '[data-carousel="' + $container.data('item-carousel') + '"]' : ''; 2939 2940 const initial_slide = configData.initial_slide !== undefined ? configData.initial_slide : 0; 2941 const pagination = configData.pagination !== undefined ? configData.pagination : '.swiper-pagination' + itemID; 2942 const arrow_next = '.elementor-swiper-button-next' + itemID; 2943 const arrow_prev = '.elementor-swiper-button-prev' + itemID; 2944 2945 if ('undefined' === typeof Swiper) { 2946 const asyncSwiper = window.elementorFrontend.utils.swiper; 2947 2948 wglDateSwiper = new asyncSwiper($date_swiper, { 2949 slidesPerView: 'auto', 2950 slideActiveClass: 'slide-active', 2951 centeredSlides: true, 2952 slideToClickedSlide: true, 2953 initialSlide: initial_slide, 2954 navigation: { 2955 nextEl: arrow_next, 2956 prevEl: arrow_prev 2957 }, 2958 pagination: { 2959 el: pagination, 2960 clickable: true, 2961 type: 'bullets', 2962 renderBullet: (index, className) => '<li class="' + className + '" role="presentation"><button type="button" role="tab" tabindex="-1">' + (index + 1) + '</button></li>', 2963 }, 2964 }); 2965 wglContentSwiper = new asyncSwiper($content_swiper, { 2966 slidesPerView: 'auto', 2967 slideActiveClass: 'slide-active', 2968 centeredSlides: true, 2969 slideToClickedSlide: true, 2970 initialSlide: initial_slide, 2971 }); 2972 2973 wglDateSwiper.then((newSwiperInstance) => { 2974 wglDateSwiper = newSwiperInstance; 2975 }); 2976 wglContentSwiper.then((newSwiperInstance) => { 2977 wglContentSwiper = newSwiperInstance; 2978 2979 wglDateSwiper.controller.control = wglContentSwiper; 2980 wglContentSwiper.controller.control = wglDateSwiper; 2981 }); 2982 2983 } else { 2984 2985 wglDateSwiper = new Swiper($date_swiper, { 2986 slidesPerView: 'auto', 2987 slideActiveClass: 'slide-active', 2988 centeredSlides: true, 2989 slideToClickedSlide: true, 2990 initialSlide: initial_slide, 2991 navigation: { 2992 nextEl: arrow_next, 2993 prevEl: arrow_prev 2994 }, 2995 pagination: { 2996 el: pagination, 2997 clickable: true, 2998 type: 'bullets', 2999 renderBullet: (index, className) => '<li class="' + className + '" role="presentation"><button type="button" role="tab" tabindex="-1">' + (index + 1) + '</button></li>', 3000 }, 3001 }); 3002 3003 wglContentSwiper = new Swiper($content_swiper, { 3004 slidesPerView: 'auto', 3005 slideActiveClass: 'slide-active', 3006 centeredSlides: true, 3007 slideToClickedSlide: true, 3008 initialSlide: initial_slide, 3009 }); 3010 3011 wglDateSwiper.controller.control = wglContentSwiper; 3012 wglContentSwiper.controller.control = wglDateSwiper; 3013 } 3014 3015 if ( self.hasClass('appear_anim') ){ 3016 if (self.length) { 3017 self.each(function() { 3018 let item_appear = jQuery(this); 3019 item_appear.appear(function() { 3020 item_appear.addClass('show'); 3021 }); 3022 }); 3023 } 3024 } 3025} 3026 3027function wglWoocommerceHelper(){ 3028 let body = jQuery('body'); 3029 body.on('click', '.quantity.number-input span.minus', function(e){ 3030 this.parentNode.querySelector('input[type=number]').stepDown(); 3031 if(document.querySelector('.woocommerce-cart-form [name=update_cart]')){ 3032 document.querySelector('.woocommerce-cart-form [name=update_cart]').disabled = false; 3033 } 3034 jQuery(this).parent().find('.qty').trigger('change'); 3035 }); 3036 3037 body.on('click', '.quantity.number-input span.plus', function(e){ 3038 this.parentNode.querySelector('input[type=number]').stepUp(); 3039 if(document.querySelector('.woocommerce-cart-form [name=update_cart]')){ 3040 document.querySelector('.woocommerce-cart-form [name=update_cart]').disabled = false;
3041 } 3042 jQuery(this).parent().find('.qty').trigger('change'); 3043 }); 3044 3045 jQuery('.wgl-products .product a.add_to_cart_button.ajax_add_to_cart').on( "click", function() { 3046 jQuery(this).closest('.product').addClass('added_to_cart_item'); 3047 }); 3048} 3049 3050function wglWoocommerceLoginIn() { 3051 var login_in = jQuery('.login-in'); 3052 if (login_in.length) { 3053 var mc = login_in, 3054 icon = mc.find('a.login-in_link'), 3055 overlay = mc.find('div.overlay'); 3056 3057 icon.on('click tap', function(e) { 3058 e.preventDefault(); 3059 mc.toggleClass('open_login'); 3060 }); 3061 3062 var eventClose = function(e) { 3063 if ( 3064 !jQuery(e.target).closest('.modal_content').length && 3065 !jQuery(e.target).is('.modal_content') 3066 ) { 3067 mc.removeClass('open_login'); 3068 } 3069 }; 3070 3071 overlay.on('click tap', eventClose); 3072 3073 jQuery(document).bind('keydown', function(e) { 3074 if (e.which === 27) eventClose(e); 3075 }); 3076 } 3077} 3078function wglWoocommerceMiniCart(){ 3079 var mini_cart = jQuery('header .wgl-cart-header .mini-cart'); 3080 if (mini_cart.length) { 3081 mini_cart.each(function(){ 3082 var overlay = jQuery('div.mini_cart-overlay'), 3083 eventClose = function(e) { 3084 jQuery('.wgl-theme-header').removeClass('open_cart'); 3085 }; 3086 3087 jQuery('a.woo_icon').on('click tap', function() { 3088 jQuery('.wgl-theme-header').toggleClass('open_cart'); 3089 }); 3090 overlay.on('click tap', eventClose); 3091 jQuery('body').on('click', 'header a.close_mini_cart', eventClose); 3092 3093 jQuery(document).bind('keydown', function(e) { 3094 if (e.which === 27) eventClose(e); 3095 }); 3096 }); 3097 } 3098} 3099// Select Wrapper 3100function wglSelectWrap() { 3101 jQuery('select').each(function () { 3102 var $select = jQuery(this); 3103 if ($select.hasClass('first-disable')){ 3104 jQuery('option:first-child', $select).attr('disabled',true); 3105 } 3106 }); 3107} 3108 3109function wglButtonAnimation() { 3110 jQuery('.wgl-button.with-border:not(.load_more_item)').each(function () { 3111 let $_this = jQuery(this); 3112 $_this.on('click tap', function(){ 3113 $_this.addClass('animated'); 3114 setTimeout(function(){ 3115 $_this.removeClass('animated'); 3116 },600) 3117 }); 3118 }); 3119 jQuery('.wgl-button').each(function () { 3120 jQuery(this).on('touchstart mouseenter', function(){ 3121 jQuery(this).find('.highlight_svg').removeClass('hide-highlight').addClass('active') 3122 }).on("touchend mouseleave", function () { 3123 jQuery(this).find('.highlight_svg').addClass('hide-highlight').removeClass('active') 3124 }); 3125 }); 3126}
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.