1(function($, fnFrontend){ 2 "use strict"; 3 4 5 6 var MarketifyWaxon = { 7 8 isAdmin: false, 9 adminBarH: 0, 10 11 init: function() { 12 13 if($('body').hasClass('admin-bar')){ 14 MarketifyWaxon.isAdmin = true; 15 MarketifyWaxon.adminBarH = $('#wpadminbar').height(); 16 } 17 18 var widgets = { 19 'frel-video-button.default' : MarketifyWaxon.magnific_popup, 20 'frel-team-member.default' : MarketifyWaxon.teamMember, 21 'frel-gallery.default' : MarketifyWaxon.allGalleryFunctions, 22 'frel-accordion.default' : MarketifyWaxon.accordionFunction, 23 'frel-partners.default' : MarketifyWaxon.partners, 24 'frel-progress-bar.default' : MarketifyWaxon.progress, 25 'frel-after-before.default' : MarketifyWaxon.imageAfterBefore, 26 'frel-countdown.default' : MarketifyWaxon.countdown, 27 'frel-circular-progress.default' : MarketifyWaxon.circularProgress, 28 'frel-boxed-counter.default' : MarketifyWaxon.fn_cs_counter, 29 'frel-modal-button.default' : MarketifyWaxon.modal_button, 30 'frel-social-list.default' : MarketifyWaxon.ImgToSVG, 31 'frel-hero-header.default' : MarketifyWaxon.hero, 32 'frel-about.default' : MarketifyWaxon.about, 33 'frel-services.default' : MarketifyWaxon.services, 34 'frel-testimonials.default' : MarketifyWaxon.testimonials, 35 }; 36 37 $.each( widgets, function( widget, callback ) { 38 fnFrontend.hooks.addAction( 'frontend/element_ready/' + widget, callback ); 39 }); 40 }, 41 42 magnific_popup: function(){ 43 $('.gallery_zoom').each(function() { // the containers for all your galleries 44 $(this).magnificPopup({ 45 delegate: 'a.zoom', // the selector for gallery item 46 type: 'image', 47 gallery: { 48 enabled:true 49 }, 50 removalDelay: 300, 51 mainClass: 'mfp-fade' 52 }); 53 54 }); 55 $('.popup-youtube').each(function() { // the containers for all your galleries 56 $(this).magnificPopup({ 57 type: 'iframe', 58 mainClass: 'mfp-fade', 59 removalDelay: 160, 60 preloader: false, 61 fixedContentPos: false 62 }); 63 }); 64 }, 65 66 teamMember: function(){ 67 MarketifyWaxon.BgImg(); 68 MarketifyWaxon.ImgToSVG(); 69 }, 70 71 simpleParallax: function(){ 72 $('.thumbnail').each(function(){ 73 new simpleParallax($(this)[0], { 74 delay:5, 75 overflow: true, 76 orientation:'down' 77 }); 78 }); 79 }, 80 81 testimonials: function(){ 82 var carousel = $('.fn_cs_testi_carousel .owl-carousel'); 83 var rtlMode = false; 84 85 if($('body').hasClass('rtl')){ 86 rtlMode = 'true'; 87 } 88 carousel.each(function(){ 89 $(this).owlCarousel({ 90 loop: true, 91 items: 3, 92 lazyLoad: false, 93 margin: 50, 94 autoplay: true, 95 autoplayTimeout: 7000, 96 dots: false, 97 nav: false, 98 rtl: rtlMode, 99 navSpeed: false, 100 responsive : { 101 0 : { 102 items: 1 103 }, 104 768 : { 105 items: 3 106 } 107 } 108 }); 109 }); 110 111 $('.fn_cs_testimonials .rightpart li').on('mouseenter',function(){ 112 var element = $(this); 113 MarketifyWaxon.testimonial_hover(element); 114 }); 115 $('.fn_cs_testimonials .rightpart a').on('click',function(){ 116 var element = $(this).closest('li'); 117 MarketifyWaxon.testimonial_hover(element); 118 return false; 119 }); 120 MarketifyWaxon.BgImg(); 121 MarketifyWaxon.ImgToSVG(); 122 MarketifyWaxon.isotopeFunction(); 123 }, 124 testimonial_hover: function(element){ 125 if(element.hasClass('active')){ 126 return false; 127 } 128 element.siblings().removeClass('active'); 129 element.addClass('active'); 130 var index = element.index(); 131 var leftpart = element.closest('.fn_cs_testimonials').find('.leftpart'); 132 leftpart.find('.active').removeClass('active'); 133 leftpart.find('li').eq(index).addClass('active'); 134 }, 135 136 services: function(){ 137 var carousel1 = $('.fn_cs_services .owl-carousel'); 138 139 var rtlMode = false; 140 141 if($('body').hasClass('rtl')){ 142 rtlMode = 'true'; 143 } 144 145 carousel1.owlCarousel({ 146 loop: true, 147 items: 2, 148 lazyLoad: false, 149 margin: 50, 150 autoplay: true, 151 autoplayTimeout: 7000, 152 rtl: rtlMode, 153 dots: true, 154 nav: false, 155 navSpeed: true, 156 responsive:{ 157 0:{items:1}, 158 480:{items:1}, 159 768:{items:2}, 160 1040:{items:3} 161 } 162 }); 163 MarketifyWaxon.ImgToSVG(); 164 }, 165 166 about: function(){ 167 MarketifyWaxon.modal_button(); 168 MarketifyWaxon.simpleParallax(); 169 }, 170 171 172 hero: function(){ 173 MarketifyWaxon.BgImg(); 174 var statics = $('.fn_cs_hero'); 175 if(statics.length){ 176 statics.each(function(){ 177 var element = $(this); 178 setTimeout(function(){ 179 element.find('.my_overlay').addClass('loaded'); 180 }, 2000); 181 }); 182 } 183 $(".fn_cs_hero .glitch").each(function(){ 184 $(this).mgGlitch({ 185 destroy: false, 186 glitch: true, 187 scale: true, 188 blend: true, 189 blendModeType: "hue", 190 glitch1TimeMin: 200, 191 glitch1TimeMax: 400, 192 glitch2TimeMin: 10, 193 glitch2TimeMax: 100 194 }); 195 }); 196 $('.fn_cs_hero .overlay_slider').each(function(){ 197 var element = $(this); 198 var html = []; 199 var items = element.find('.k_item'); 200 items.each(function(){ 201 html.push({src:$(this).val()}); 202 }); 203 element.vegas({ 204 timer:false,
205 animation: [ 'kenburnsUp', 'kenburnsLeft', 'kenburnsRight'], 206 delay:7000, 207 slides: html 208 }); 209 }); 210 211 212 // slider 213 var section = $('.fn_cs_personal_slider'); 214 section.each(function(){ 215 var element = $(this); 216 var mainSliderSelector = element.find('.swiper-container'); 217 var transform = 'Y'; 218 var direction = 'horizontal'; 219 var interleaveOffset = 0.5; 220 if(direction === 'horizontal'){ 221 transform = 'X'; 222 } 223 // Main Slider 224 var mainSliderOptions = { 225 loop: true, 226 speed: 1500, 227 autoplay:{ 228 delay: 5000 229 }, 230 slidesPerView: 1, 231 direction: direction, 232 loopAdditionalSlides: 10, 233 watchSlidesProgress: true, 234 navigation: { 235 nextEl: '.swiper-button-next', 236 prevEl: '.swiper-button-prev', 237 }, 238 on: { 239 init: function(){ 240 this.autoplay.stop(); 241 }, 242 imagesReady: function(){ 243 this.autoplay.start(); 244 }, 245 progress: function(){ 246 var swiper = this; 247 for (var i = 0; i < swiper.slides.length; i++) { 248 var slideProgress = swiper.slides[i].progress, 249 innerOffset = swiper.width * interleaveOffset, 250 innerTranslate = slideProgress * innerOffset; 251 $(swiper.slides[i]).find(".main_image").css({transform: "translate"+transform+"(" + innerTranslate + "px)"}); 252 } 253 }, 254 touchStart: function() { 255 var swiper = this; 256 for (var i = 0; i < swiper.slides.length; i++) { 257 swiper.slides[i].style.transition = ""; 258 } 259 }, 260 setTransition: function(speed) { 261 var swiper = this; 262 for (var i = 0; i < swiper.slides.length; i++) { 263 swiper.slides[i].style.transition = speed + "ms"; 264 swiper.slides[i].querySelector(".main_image").style.transition = 265 speed + "ms"; 266 } 267 } 268 } 269 }; 270 new Swiper(mainSliderSelector, mainSliderOptions); 271 }); 272 }, 273 274 modal_button: function(){ 275 $('.fn_cs_modal_button a,.fn__modal_button').off().on('click',function(){ 276 var m = 'waxon_fn_modalbox'; 277 if(!$('.'+m).length){ 278 $('body').append('<div class="'+m+'"><div class="box_inner"><a class="fn_closer" href="#"></a><div class="modal_in"><div class="modal_content"></div></div></div></div>'); 279 } 280 $('.'+m+' .modal_content').html('').html($('.elementor').clone()); 281 $('.'+m).addClass('opened'); 282 283 // recall all functions 284 MarketifyWaxon.accordionFunction(); 285 MarketifyWaxon.allGalleryFunctions(); 286 MarketifyWaxon.partners(); 287 MarketifyWaxon.progress(); 288 MarketifyWaxon.imageAfterBefore(); 289 MarketifyWaxon.countdown(); 290 MarketifyWaxon.circularProgress(); 291 MarketifyWaxon.fn_cs_counter(); 292 MarketifyWaxon.modal_button(); 293 MarketifyWaxon.modal_recalc_height(); 294 295 // call modal closer 296 MarketifyWaxon.modal_closer(); 297 298 return false; 299 }); 300 }, 301 302 modal_closer: function(){ 303 $('.waxon_fn_modalbox .fn_closer').off().on('click',function(){ 304 $('.waxon_fn_modalbox').removeClass('opened');return false; 305 }); 306 }, 307 308 modal_recalc_height: function(){ 309 $('.waxon_fn_modalbox .modal_content').css({height: $('.waxon_fn_modalbox .modal_in').height()}).niceScroll({ 310 touchbehavior:false, 311 cursorwidth:0, 312 autohidemode:true, 313 cursorborder:"0px solid #fff" 314 }); 315 }, 316 317 fn_cs_counter: function(){ 318 var element = $('.fn_cs_counter'); 319 element.each(function() { 320 var el = $(this); 321 el.waypoint({ 322 handler: function(){ 323 if(!el.hasClass('stop') || (el.closest('.elementor').parent().parent().parent().hasClass('waxon_fn_modalbox'))){ 324 el.addClass('stop').countTo({ 325 refreshInterval: 50, 326 formatter: function (value, options) { 327 return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); 328 }, 329 }); 330 } 331 }, 332 offset:'90%' 333 }); 334 }); 335 }, 336 337 inlineStyle: function(){ 338 var s = '';
338$('.waxon_fn_style').each(function(){var e=$(this),v=e.val();e.val('');s+=v;});$('body').append(s); 339 }, 340 341 circularProgress: function(){ 342 var ww = $(window).width(); 343 var circVal = 150; 344 345 if(ww <= 768){ 346 circVal = 100; 347 } 348 349 $('.fn_cs_circular_progress .myCircle').each(function() { 350 var element = $(this); 351 var value = element.data('value'); 352 var fill = element.data('active'); 353 var emptyFill = element.data('inactive'); 354 if(element.hasClass('ready')){return false;}element.addClass('ready'); 355 356 357 element.waypoint({handler: function(){ 358 element.circleProgress({ 359 size: circVal, 360 value: 0, 361 animation: {duration: 1400}, 362 thickness: 7, 363 fill: fill, 364 emptyFill: emptyFill, 365 startAngle: -Math.PI/2 366 }).on('circle-animation-progress', function(event, progress, stepValue) { 367 element.find('.number').text(parseInt(stepValue.toFixed(2)*100) + '%'); 368 }); 369 element.circleProgress('value', value); 370 },offset:'90%'}); 371 }); 372 }, 373 374 countdown: function(){ 375 $('.fn_cs_countdown').each(function(){ 376 var e = $(this), 377 t = e.data('type'), 378 dd = e.data('due-date'); 379 if(!e.hasClass('ready')){e.addClass('ready'); 380 if(t === 'date'){ 381 var countDownDate = new Date( dd ); 382 var x = setInterval(function() { 383 var now = new Date().getTime(); 384 var distance = countDownDate - now; 385 var days = Math.floor(distance / 86400000); 386 var hours = Math.floor((distance % 86400000) / 3600000); 387 var minutes = Math.floor((distance % 3600000) / 60000); 388 var seconds = Math.floor((distance % 60000) / 1000); 389 if(parseInt(days) === 0){ 390 e.find('.day_item').addClass('expired'); 391 } 392 days = (days < 10 && days > 0) ? '0' + days : days; 393 hours = (hours < 10 && hours > 0) ? '0' + hours : hours; 394 minutes = (minutes < 10 && minutes > 0) ? '0' + minutes : minutes; 395 seconds = (seconds < 10 && seconds > 0) ? '0' + seconds : seconds; 396 e.find('.day_item h3').text(days); 397 e.find('.hour_item h3').text(hours); 398 e.find('.minute_item h3').text(minutes); 399 e.find('.second_item h3').text(seconds); 400 401 // If the count down is finished, write some text 402 if (distance < 0) { 403// clearInterval(x); 404 } 405 }, 1000); 406 }else if(t === 'ever'){ 407 var ever = e.data('ever'); 408 var y = setInterval(function(){ 409 var days = Math.floor(ever / 86400); 410 var hours = Math.floor((ever % 86400) / 3600); 411 var minutes = Math.floor((ever % 3600) / 60); 412 var seconds = Math.floor((ever % 60)); 413 if(days === 0){ 414 e.find('.day_item').addClass('expired'); 415 } 416 days = (days < 10) ? '0' + days : days; 417 hours = (hours < 10) ? '0' + hours : hours; 418 minutes = (minutes < 10) ? '0' + minutes : minutes; 419 seconds = (seconds < 10) ? '0' + seconds : seconds; 420 e.find('.day_item h3').text(days); 421 e.find('.hour_item h3').text(hours); 422 e.find('.minute_item h3').text(minutes); 423 e.find('.second_item h3').text(seconds); 424 ever = ever - 1; 425 if(ever < 0){ 426// clearInterval(y); 427 } 428 }, 1000); 429 } 430 } 431 432 }); 433 }, 434 435 436 imageAfterBefore: function(){ 437 $('.fn_cs_after_before').each(function(){ 438 var count = 0; 439 var wrapper = $(this); 440 var container = wrapper.find('.compare_container'); 441 var firstImage = container.find('img:nth-child(1)'); 442 var firstURL = firstImage.attr('src'); 443 var secondImage = container.find('img:nth-child(2)'); 444 var secondURL = secondImage.attr('src'); 445 firstImage.attr('src', firstURL).load(function() { 446 count++; 447 MarketifyWaxon.checkItForImageAfterBefore(count,wrapper); 448 }); 449 secondImage.attr('src', secondURL).load(function() { 450 count++; 451 MarketifyWaxon.checkItForImageAfterBefore(count,wrapper); 452 }); 453 }); 454 }, 455 456 checkItForImageAfterBefore: function(count,wrapper){ 457 if(count === 2){ 458 var ID = MarketifyWaxon.ID(), 459 container = wrapper.find('.compare_container'), 460 href1 = container.find('img:nth-child(1)').attr('src'), 461 href2 = container.find('img:nth-child(2)').attr('src'), 462 label1 = container.data('label1'), 463 label2 = container.data('label2'); 464 container.parent().html('').attr('id',ID); 465 var slider = new juxtapose.JXSlider('#'+ID, 466 [ 467 { 468 src: href1, 469 label: label1, 470 credit: 'Image Credit' 471 }, 472 { 473 src: href2, 474 label: label2, 475 credit: "Image Credit" 476 } 477 ], 478 { 479 animate: true, 480 showLabels: true, 481 showCredits: true, 482 startingPosition: "50%", 483 makeResponsive: true 484 });
485 } 486 }, 487 488 ID: function () { 489 // Math.random should be unique because of its seeding algorithm. 490 // Convert it to base 36 (numbers + letters), and grab the first 9 characters 491 // after the decimal. 492 return 'frenify_' + Math.random().toString(36).substr(2, 9); 493 }, 494 495 swiper: function(){ 496 MarketifyWaxon.BgImg(); 497 $('.fn_cs_testimonials .r_list, .fn_cs_triple_portfolio .r_list').each(function(){ 498 if($(this).hasClass('gogogo')){return false;}$(this).addClass('gogogo'); 499 var element = $(this); 500 var container = element.find('.swiper-container'); 501 var mySwiper = new Swiper (container, { 502 loop: true, 503 slidesPerView: 3, 504 spaceBetween: 45, 505 speed: 1000, 506 loopAdditionalSlides: 10, 507 autoplay: { 508 delay: 7000 509 }, 510 on: { 511 autoplayStop: function(){ 512 mySwiper.autoplay.start(); 513 }, 514 slideChange: function () { 515 MarketifyWaxon.ImgToSVG(); 516 MarketifyWaxon.teamMemberPopup(); 517 }, 518 }, 519 pagination: { 520 el: '.fn_cs_swiper__progress', 521 type: 'custom', // progressbar 522 renderCustom: function (swiper,current,total) { 523 524 // opacity 525 var index = current - 1; 526 var activeSlide = container.find('.swiper-slide[data-swiper-slide-index="'+index+'"]'); 527 container.find('.r_item').removeClass('fn_vision'); 528 activeSlide.find('.r_item').addClass('fn_vision'); 529 activeSlide.next().find('.r_item').addClass('fn_vision'); 530 activeSlide.next().next().find('.r_item').addClass('fn_vision'); 531 532 533 534 // progress animation 535 var scale,translateX; 536 var progressDOM = container.find('.fn_cs_swiper__progress'); 537 if(progressDOM.hasClass('fill')){ 538 translateX = '0px'; 539 scale = parseInt((current/total)*100)/100; 540 }else{ 541 scale = parseInt((1/total)*100)/100; 542 translateX = (current-1) * parseInt((100/total)*100)/100 + 'px'; 543 } 544 545 546 progressDOM.find('.all span').css({transform:'translate3d('+translateX+',0px,0px) scaleX('+scale+') scaleY(1)'}); 547 if(current<10){current = '0' + current;} 548 if(total<10){total = '0' + total;} 549 progressDOM.find('.current').html(current); 550 progressDOM.find('.total').html(total); 551 } 552 }, 553 breakpoints: { 554 0: { 555 slidesPerView: 1, 556 spaceBetween: 0, 557 }, 558 700: { 559 slidesPerView: 2, 560 spaceBetween: 20, 561 }, 562 1200: { 563 slidesPerView: 3, 564 spaceBetween: 45 565 } 566 } 567 }); 568 }); 569 MarketifyWaxon.ImgToSVG(); 570 }, 571 572 573 574 pricingFunctions: function(){ 575 MarketifyWaxon.ImgToSVG(); 576 $('.fn_cs_pricing_switcher input').on('click',function(){ 577 $(this).closest('.fn_cs_pricing').find('.fn_column').toggleClass('active'); 578 }); 579 }, 580 581 progress: function(){ 582 $('.fn_cs_progress_wrap').each(function() { 583 var pWrap = $(this); 584 pWrap.waypoint({handler: function(){MarketifyWaxon.progressF(pWrap);},offset:'90%'}); 585 }); 586 }, 587 588 progressF: function(container){ 589 container.find('.fn_cs_progress').each(function(i) { 590 var progress = $(this); 591 var pValue = parseInt(progress.data('value')); 592 var pBarWrap = progress.find('.fn_cs_bar_wrap'); 593 var pBar = progress.find('.fn_cs_bar'); 594 pBar.css({width:pValue+'%'}); 595 setTimeout(function(){pBarWrap.addClass('open');},(i*500)); 596 }); 597 }, 598 599 partners: function(){ 600 var carousel = $('.fn_cs_partners .owl-carousel'); 601 var rtlMode = false; 602 if($('body').hasClass('rtl')){ 603 rtlMode = true; 604 } 605 carousel.each(function(){ 606 $(this).owlCarousel({ 607 loop: true, 608 rtl: rtlMode, 609 items: 4, 610 autoWidth: false, 611 lazyLoad: true, 612 margin: 50, 613 autoplay: true, 614 autoplayTimeout: 4000, 615 smartSpeed: 2000, 616 dots: false, 617 nav: false, 618 navSpeed: true, 619 responsive:{ 620 0:{items:1}, 621 480:{items:1}, 622 768:{items:2}, 623 1040:{items:3}, 624 1200:{items:3}, 625 1600:{items:4}, 626 1920:{items:4} 627 } 628 }); 629 }); 630 631 var carousel2 = $('.fn_cs_partners_beta .owl-carousel'); 632 633 carousel2.owlCarousel({ 634 loop: true, 635 items: 4, 636 lazyLoad: false, 637 margin: 100, 638 autoplay: true, 639 autoplayTimeout: 7000, 640 rtl: rtlMode, 641 dots: true, 642 nav: false, 643 navSpeed: true, 644 responsive:{ 645 0:{items:1}, 646 480:{items:1}, 647 768:{items:2}, 648 1040:{items:3}, 649 1200:{items:3}, 650 1600:{items:4}, 651 1920:{items:4} 652 } 653 }); 654 655 }, 656 657 658 659 accordionFunction: function(){ 660 var head = $('.fn_cs_accordion .acc_head'), 661 s = 300, 662 a = 'swing'; 663 head.off().on('click',function(){ 664 var e = $(this), 665 p = e.closest('.fn_cs_accordion'),
666 c = e.closest('.accordion_in'), 667 t = p.data('type'); 668 if(!c.hasClass('acc_active')){ 669 if(t === 'accordion'){ 670 p.find('.acc_active').removeClass('acc_active').find('.acc_content').slideUp({duration:s,easing:a}); 671 } 672 c.addClass('acc_active').find('.acc_content').slideDown({duration:s,easing:a}); 673 }else{ 674 c.removeClass('acc_active').find('.acc_content').slideUp({duration:s,easing:a}); 675 } 676 }); 677 }, 678 679 680 681 allGalleryFunctions: function(){ 682 MarketifyWaxon.lightGallery(); 683 MarketifyWaxon.justifiedGallery(); 684 MarketifyWaxon.galleryMasonry(); 685 MarketifyWaxon.BgImg(); 686 MarketifyWaxon.gallerySlider(); 687 MarketifyWaxon.collageCarousel(); 688 MarketifyWaxon.isotopeFunction(); 689 MarketifyWaxon.inlineStyle(); 690 setTimeout(function(){ 691 MarketifyWaxon.isotopeFunction(); 692 },2000); 693 }, 694 695 collageCarousel: function(){ 696 var carousel = $('.fn_cs_gallery_collage_a .owl-carousel'); 697 var rtlMode = false; 698 if($('body').hasClass('rtl')){ 699 rtlMode = true; 700 } 701 702 carousel.each(function(){ 703 var e = $(this); 704 var myNav = false; 705 var gutter = parseInt(e.closest('.fn_cs_gallery_collage_a').data('gutter')); 706 707 e.owlCarousel({ 708 items: 4, 709 lazyLoad: true, 710 loop:true, 711 rtl: rtlMode, 712 animateOut: 'fadeOut', 713 animateIn: 'fadeIn', 714 autoWidth:true, 715 autoplay: true, 716 autoplayTimeout: 70000, 717 smartSpeed: 2000, 718 margin: gutter, 719 dots: true, 720 nav: myNav, 721 navSpeed: true 722 }); 723 }); 724 }, 725 726 gallerySlider: function(){ 727 $('.fn_cs_gallery_slider .inner').each(function(){ 728 var element = $(this); 729 if(element.hasClass('gogogo')){ 730 return false; 731 }element.addClass('gogogo'); 732 var container = element.find('.swiper-container'); 733 734 735 var pagination = element.closest('.fn_cs_gallery_slider').data('pag'); 736 var paginationClass = 'fn_cs_swiper__progress'; 737 var type = 'custom'; 738 var clickable = false; 739 if(pagination === 'dots'){ 740 paginationClass = 'fn_cs_swiper__dots'; 741 type = 'bullets'; 742 clickable = true; 743 } 744 745 746 var mySwiper = new Swiper (container, { 747 loop: true, 748 slidesPerView: 1, 749 spaceBetween: 70, 750 loopAdditionalSlides: 50, 751 speed: 800, 752 autoplay: { 753 delay: 8000, 754 }, 755 navigation: { 756 nextEl: '.swiper-button-next', 757 prevEl: '.swiper-button-prev', 758 }, 759 on: { 760 init: function(){ 761 element.closest('.fn_cs_gallery_slider').addClass('ready'); 762 }, 763 autoplayStop: function(){ 764 mySwiper.autoplay.start(); 765 }, 766 }, 767 pagination: { 768 el: '.'+paginationClass, 769 type: type, // progressbar 770 clickable: clickable, 771 renderCustom: function (swiper,current,total) { 772 if(pagination === 'fill' || pagination === 'scrollbar'){ 773 // progress animation 774 var scale,translateX; 775 var progressDOM = container.find('.fn_cs_swiper__progress'); 776 if(progressDOM.hasClass('fill')){ 777 translateX = '0px'; 778 scale = parseInt((current/total)*100)/100; 779 }else{ 780 scale = parseInt((1/total)*100)/100; 781 translateX = (current-1) * parseInt((100/total)*100)/100 + 'px'; 782 } 783 784 785 progressDOM.find('.all span').css({transform:'translate3d('+translateX+',0px,0px) scaleX('+scale+') scaleY(1)'}); 786 if(current<10){current = '0' + current;} 787 if(total<10){total = '0' + total;} 788 progressDOM.find('.current').html(current); 789 progressDOM.find('.total').html(total); 790 } 791 }, 792 renderBullet: function (index, className) { 793 return '<span class="' + className + ' fn_dots"></span>'; 794 } 795 }, 796 }); 797 }); 798 MarketifyWaxon.BgImg(); 799 }, 800 801 galleryMasonry: function(){ 802 MarketifyWaxon.lightGallery(); 803 MarketifyWaxon.isotopeFunction(); 804 }, 805 806 justifiedGallery: function(){ 807 MarketifyWaxon.lightGallery(); 808 var justified = $(".fn_cs_gallery_justified"); 809 justified.each(function(){ 810 var element = $(this); 811 var height = parseInt(element.attr('data-height')); 812 var gutter = parseInt(element.attr('data-gutter')); 813 if(!height || height === 0){height = 400;} 814 if(!gutter || gutter === 0){gutter = 10;} 815 if($().justifiedGallery){ 816 element.justifiedGallery({ 817 rowHeight : height, 818 lastRow : 'nojustify', 819 margins : gutter, 820 refreshTime: 500, 821 refreshSensitivity: 0, 822 maxRowHeight: null, 823 border: 0, 824 captions: false, 825 randomize: false 826 });
827 } 828 }); 829 }, 830 831 832 /* COMMMON FUNCTIONS */ 833 BgImg: function(){ 834 var div = $('*[data-fn-bg-img]'); 835 div.each(function(){ 836 var element = $(this); 837 var attrBg = element.attr('data-fn-bg-img'); 838 var dataBg = element.data('fn-bg-img'); 839 if(typeof(attrBg) !== 'undefined'){ 840 element.addClass('frenify-ready'); 841 element.css({backgroundImage:'url('+dataBg+')'}); 842 } 843 }); 844 var div2 = $('*[data-img]'); 845 div2.each(function(){ 846 var element = $(this); 847 var attrBg = element.attr('data-img'); 848 var dataBg = element.data('img'); 849 if(typeof(attrBg) !== 'undefined'){ 850 element.css({backgroundImage:'url('+dataBg+')'}); 851 } 852 }); 853 }, 854 855 ImgToSVG: function(){ 856 857 $('img.fn__svg').each(function(){ 858 var $img = $(this); 859 var imgClass = $img.attr('class'); 860 var imgURL = $img.attr('src'); 861 862 $.get(imgURL, function(data) { 863 var $svg = $(data).find('svg'); 864 if(typeof imgClass !== 'undefined') { 865 $svg = $svg.attr('class', imgClass+' replaced-svg'); 866 } 867 $img.replaceWith($svg); 868 869 }, 'xml'); 870 871 }); 872 }, 873 874 jarallaxEffect: function(){ 875 $('.jarallax').each(function(){ 876 var element = $(this); 877 var customSpeed = element.data('speed'); 878 879 if(customSpeed !== "undefined" && customSpeed !== ""){ 880 customSpeed = customSpeed; 881 }else{ 882 customSpeed = 0.5; 883 } 884 element.jarallax({ 885 speed: customSpeed, 886 automaticResize: true 887 }); 888 }); 889 }, 890 isotopeFunction: function(){ 891 var masonry = $('.fn_cs_masonry'); 892 if($().isotope){ 893 masonry.each(function(){ 894 $(this).isotope({ 895 itemSelector: '.fn_cs_masonry_in', 896 masonry: {}, 897 isOriginLeft: false 898 }); 899 $(this).isotope( 'reloadItems' ).isotope(); 900 }); 901 } 902 var items = $('.fn_cs_project_category .posts_list'); 903 if($().isotope){ 904 items.each(function() { 905 $(this).isotope({ 906 itemSelector: 'li', 907 masonry: {} 908 }); 909 }); 910 } 911 }, 912 913 lightGallery: function(){ 914 if($().lightGallery){ 915 // FIRST WE SHOULD DESTROY LIGHTBOX FOR NEW SET OF IMAGES 916 var gallery = $('.fn_cs_lightgallery'); 917 918 gallery.each(function(){ 919 var element = $(this); 920 element.lightGallery(); // binding 921 if(element.length){element.data('lightGallery').destroy(true); }// destroying 922 $(this).lightGallery({ 923 selector: ".lightbox", 924 thumbnail: 1, 925 loadYoutubeThumbnail: !1, 926 loadVimeoThumbnail: !1, 927 showThumbByDefault: !1, 928 mode: "lg-fade", 929 download:!1, 930 getCaptionFromTitleOrAlt:!1, 931 }); 932 }); 933 } 934 }, 935 }; 936 937 $( window ).on( 'elementor/frontend/init', MarketifyWaxon.init ); 938 939 940 $( window ).on('resize',function(){ 941 MarketifyWaxon.modal_recalc_height(); 942 MarketifyWaxon.isotopeFunction(); 943 setTimeout(function(){ 944 MarketifyWaxon.isotopeFunction(); 945 },700); 946 }); 947 $( window ).on('load',function(){ 948 MarketifyWaxon.isotopeFunction(); 949 }); 950 951 $(window).on('scroll',function(){ 952 953 }); 954 955})(jQuery, window.elementorFrontend);
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.