1(function($, fnFrontend){ 2 "use strict"; 3 4 5 6 var MarketifyTokyo = { 7 8 isAdmin: false, 9 adminBarH: 0, 10 11 init: function() { 12 13 if($('body').hasClass('admin-bar')){ 14 MarketifyTokyo.isAdmin = true; 15 MarketifyTokyo.adminBarH = $('#wpadminbar').height(); 16 } 17 18 var widgets = { 19 'frel-gallery.default' : MarketifyTokyo.allGalleryFunctions, 20 'frel-numbered-list.default' : MarketifyTokyo.fn_service_functions, 21 'frel-accordion.default' : MarketifyTokyo.accordionFunction, 22 'frel-partners.default' : MarketifyTokyo.partners, 23 'frel-testimonials.default' : MarketifyTokyo.testimonials, 24 'frel-progress-bar.default' : MarketifyTokyo.progress, 25 'frel-after-before.default' : MarketifyTokyo.imageAfterBefore, 26 'frel-countdown.default' : MarketifyTokyo.countdown, 27 'frel-circular-progress.default' : MarketifyTokyo.circularProgress, 28 'frel-boxed-counter.default' : MarketifyTokyo.fn_cs_counter, 29 'frel-social-list.default' : MarketifyTokyo.ImgToSVG, 30 }; 31 32 $.each( widgets, function( widget, callback ) { 33 fnFrontend.hooks.addAction( 'frontend/element_ready/' + widget, callback ); 34 }); 35 }, 36 37 fn_service_functions: function(){ 38 MarketifyTokyo.fn_modalbox(); 39 MarketifyTokyo.fn_modalbox_service(); 40 MarketifyTokyo.ImgToSVG(); 41 }, 42 43 fn_modalbox:function(){ 44 if(!$('.fn_modalbox').length){ 45 $('.tokyo-fn-wrapper').prepend('<div class="fn_modalbox"><div class="box_inner"><div class="close"><a href="#"></a></div><div class="description_wrap"></div></div></div>'); 46 $('.fn_modalbox .close a').html($('.fn_cs_numbered_list .hidden_icon').html()); 47 } 48 49 }, 50 51 fn_modalbox_service:function(){ 52 var modalBox = $('.fn_modalbox'); 53 var button = $('.fn_cs_numbered_list .fn_full_link'); 54 var closePopup = modalBox.find('.close'); 55 56 button.on('click',function(){ 57 var element = $(this); 58 var parent = element.closest('.list_inner'); 59 var content = parent.find('.service_hidden_details').html(); 60 modalBox.addClass('opened'); 61 modalBox.find('.description_wrap').html(content); 62 MarketifyTokyo.BgImg(); 63 return false; 64 }); 65 closePopup.on('click',function(){ 66 modalBox.removeClass('opened'); 67 modalBox.find('.description_wrap').html(''); 68 return false; 69 }); 70 }, 71 72 fn_cs_counter: function(){ 73 var element = $('.fn_cs_counter'); 74 element.each(function() { 75 var el = $(this); 76 el.waypoint({ 77 handler: function(){ 78 if(!el.hasClass('stop')){ 79 el.addClass('stop').countTo({ 80 refreshInterval: 50, 81 formatter: function (value, options) { 82 return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); 83 }, 84 }); 85 } 86 }, 87 offset:'90%' 88 }); 89 }); 90 }, 91 92 inlineStyle: function(){ 93 var style = ''; 94 $('.tokyo_fn_style').each(function(){ 95 var element = $(this), 96 value = element.val(); 97 element.val(''); 98 style += value; 99 }); 100 $('body').append(style); 101 }, 102 103 circularProgress: function(){ 104 $('.fn_cs_circular_progress').each(function () { 105 var element = $(this); 106 var elementPos = element.offset().top; 107 var topOfWindow = $(window).scrollTop(); 108 var circle = element.find('.fn_circle'); 109 110 var percent = element.attr('data-percent'); 111 var overlay = element.attr('data-overlay'); 112 var gradient1 = element.attr('data-gradient1'); 113 var gradient2 = element.attr('data-gradient2'); 114 var color = element.attr('data-color'); 115 var width = element.attr('data-width'); 116 var thickness = element.attr('data-thickness'); 117 var animate = element.data('animate'); 118 119 if (elementPos < topOfWindow + $(window).height() - 30 && !animate) { 120 element.data('animate', true); 121 var objectOptions = {}; 122 objectOptions.startAngle = -Math.PI / 2; 123 objectOptions.value = percent / 100; 124 objectOptions.size = width; 125 objectOptions.thickness = thickness; 126 objectOptions.emptyFill = "rgba(0,0,0,0)"; 127 if(overlay === 'gradient'){ 128 objectOptions.fill = {gradient: [gradient2,gradient1]}; 129 }else if(overlay === 'color'){ 130 objectOptions.fill = {color: color}; 131 } 132 circle.circleProgress(objectOptions).on('circle-animation-progress', function (event, progress, stepValue) { 133 circle.find('.fn_number').text((stepValue*100).toFixed(0)); 134 }).stop(); 135 } 136 }); 137 }, 138 139 countdown: function(){ 140 $('.fn_cs_countdown').each(function(){ 141 var e = $(this), 142 t = e.data('type'), 143 dd = e.data('due-date'); 144 if(!e.hasClass('ready')){e.addClass('ready'); 145 if(t === 'date'){ 146 var countDownDate = new Date( dd ); 147 var x = setInterval(function() { 148 var now = new Date().getTime(); 149 var distance = countDownDate - now; 150 var days = Math.floor(distance / 86400000); 151 var hours = Math.floor((distance % 86400000) / 3600000); 152 var minutes = Math.floor((distance % 3600000) / 60000); 153 var seconds = Math.floor((distance % 60000) / 1000); 154 if(parseInt(days) === 0){ 155 e.find('.day_item').addClass('expired'); 156 } 157 days = (days < 10 && days > 0) ? '0' + days : days; 158 hours = (hours < 10 && hours > 0) ? '0' + hours : hours; 159 minutes = (minutes < 10 && minutes > 0) ? '0' + minutes : minutes; 160 seconds = (seconds < 10 && seconds > 0) ? '0' + seconds : seconds; 161 e.find('.day_item h3').text(days);
162 e.find('.hour_item h3').text(hours); 163 e.find('.minute_item h3').text(minutes); 164 e.find('.second_item h3').text(seconds); 165 166 // If the count down is finished, write some text 167 if (distance < 0) { 168// clearInterval(x); 169 } 170 }, 1000); 171 }else if(t === 'ever'){ 172 var ever = e.data('ever'); 173 var y = setInterval(function(){ 174 var days = Math.floor(ever / 86400); 175 var hours = Math.floor((ever % 86400) / 3600); 176 var minutes = Math.floor((ever % 3600) / 60); 177 var seconds = Math.floor((ever % 60)); 178 if(days == 0){ 179 e.find('.day_item').addClass('expired'); 180 } 181 days = (days < 10) ? '0' + days : days; 182 hours = (hours < 10) ? '0' + hours : hours; 183 minutes = (minutes < 10) ? '0' + minutes : minutes; 184 seconds = (seconds < 10) ? '0' + seconds : seconds; 185 e.find('.day_item h3').text(days); 186 e.find('.hour_item h3').text(hours); 187 e.find('.minute_item h3').text(minutes); 188 e.find('.second_item h3').text(seconds); 189 ever = ever - 1; 190 if(ever < 0){ 191// clearInterval(y); 192 } 193 }, 1000); 194 } 195 } 196 197 }); 198 }, 199 200 201 imageAfterBefore: function(){ 202 $('.fn_cs_after_before').each(function(){ 203 var count = 0; 204 var wrapper = $(this); 205 var container = wrapper.find('.compare_container'); 206 var firstImage = container.find('img:nth-child(1)'); 207 var firstURL = firstImage.attr('src'); 208 var secondImage = container.find('img:nth-child(2)'); 209 var secondURL = secondImage.attr('src'); 210 firstImage.attr('src', firstURL).load(function() { 211 count++; 212 MarketifyTokyo.checkItForImageAfterBefore(count,wrapper); 213 }); 214 secondImage.attr('src', secondURL).load(function() { 215 count++; 216 MarketifyTokyo.checkItForImageAfterBefore(count,wrapper); 217 }); 218 }); 219 }, 220 221 checkItForImageAfterBefore: function(count,wrapper){ 222 if(count === 2){ 223 var ID = MarketifyTokyo.ID(), 224 container = wrapper.find('.compare_container'), 225 href1 = container.find('img:nth-child(1)').attr('src'), 226 href2 = container.find('img:nth-child(2)').attr('src'), 227 label1 = container.data('label1'), 228 label2 = container.data('label2'); 229 container.parent().html('').attr('id',ID); 230 var slider = new juxtapose.JXSlider('#'+ID, 231 [ 232 { 233 src: href1, 234 label: label1, 235 credit: 'Image Credit' 236 }, 237 { 238 src: href2, 239 label: label2, 240 credit: "Image Credit" 241 } 242 ], 243 { 244 animate: true, 245 showLabels: true, 246 showCredits: true, 247 startingPosition: "50%", 248 makeResponsive: true 249 }); 250 } 251 }, 252 253 ID: function () { 254 // Math.random should be unique because of its seeding algorithm. 255 // Convert it to base 36 (numbers + letters), and grab the first 9 characters 256 // after the decimal. 257 return 'marketify_' + Math.random().toString(36).substr(2, 9); 258 }, 259 260 swiper: function(){ 261 MarketifyTokyo.BgImg(); 262 $('.fn_cs_testimonials .r_list, .fn_cs_triple_portfolio .r_list').each(function(){ 263 if($(this).hasClass('gogogo')){return false;}$(this).addClass('gogogo'); 264 var element = $(this); 265 var container = element.find('.swiper-container'); 266 var mySwiper = new Swiper (container, { 267 loop: true, 268 slidesPerView: 3, 269 spaceBetween: 45, 270 speed: 1000, 271 loopAdditionalSlides: 10, 272 autoplay: { 273 delay: 7000 274 }, 275 on: { 276 autoplayStop: function(){ 277 mySwiper.autoplay.start(); 278 }, 279 slideChange: function () { 280 MarketifyTokyo.ImgToSVG(); 281 MarketifyTokyo.teamMemberPopup(); 282 }, 283 }, 284 pagination: { 285 el: '.fn_cs_swiper__progress', 286 type: 'custom', // progressbar 287 renderCustom: function (swiper,current,total) { 288 289 // opacity 290 var index = current - 1; 291 var activeSlide = container.find('.swiper-slide[data-swiper-slide-index="'+index+'"]'); 292 container.find('.r_item').removeClass('fn_vision'); 293 activeSlide.find('.r_item').addClass('fn_vision'); 294 activeSlide.next().find('.r_item').addClass('fn_vision'); 295 activeSlide.next().next().find('.r_item').addClass('fn_vision'); 296 297 298 299 // progress animation 300 var scale,translateX; 301 var progressDOM = container.find('.fn_cs_swiper__progress'); 302 if(progressDOM.hasClass('fill')){ 303 translateX = '0px'; 304 scale = parseInt((current/total)*100)/100; 305 }else{ 306 scale = parseInt((1/total)*100)/100; 307 translateX = (current-1) * parseInt((100/total)*100)/100 + 'px'; 308 } 309 310 311 progressDOM.find('.all span').css({transform:'translate3d('+translateX+',0px,0px) scaleX('+scale+') scaleY(1)'}); 312 if(current<10){current = '0' + current;} 313 if(total<10){total = '0' + total;} 314 progressDOM.find('.current').html(current); 315 progressDOM.find('.total').html(total); 316 } 317 }, 318 breakpoints: { 319 0: { 320 slidesPerView: 1, 321 spaceBetween: 0, 322 }, 323 700: { 324 slidesPerView: 2, 325 spaceBetween: 20, 326 }, 327 1200: { 328 slidesPerView: 3, 329 spaceBetween: 45 330 } 331 } 332 }); 333 }); 334 MarketifyTokyo.ImgToSVG(); 335 }, 336 337 338 339 pricingFunctions: function(){ 340 MarketifyTokyo.ImgToSVG(); 341 $('.fn_cs_pricing_switcher input').on('click',function(){ 342 $(this).closest('.fn_cs_pricing').find('.fn_column').toggleClass('active'); 343 }); 344 }, 345 346 progress: function(){ 347 $('.fn_cs_progress_wrap').each(function() { 348 var pWrap = $(this); 349 pWrap.waypoint({handler: function(){MarketifyTokyo.progressF(pWrap);},offset:'90%'}); 350 }); 351 }, 352 353 progressF: function(container){ 354 container.find('.fn_cs_progress').each(function(i) { 355 var progress = $(this); 356 var pValue = parseInt(progress.data('value')); 357 var pBarWrap = progress.find('.fn_cs_bar_wrap'); 358 var pBar = progress.find('.fn_cs_bar'); 359 pBar.css({width:pValue+'%'}); 360 setTimeout(function(){pBarWrap.addClass('open');},(i*500)); 361 }); 362 }, 363 364 partners: function(){ 365 var carousel = $('.fn_cs_partners .owl-carousel'); 366 var rtlMode = false; 367 if($('body').hasClass('rtl')){ 368 rtlMode = true; 369 } 370 carousel.each(function(){ 371 $(this).owlCarousel({ 372 loop: true, 373 rtl: rtlMode, 374 items: 4, 375 lazyLoad: true, 376 margin: 40, 377 autoplay: true, 378 autoplayTimeout: 4000, 379 smartSpeed: 2000, 380 dots: false, 381 nav: false, 382 navSpeed: true, 383 responsive:{ 384 0:{items:1}, 385 480:{items:2}, 386 768:{items:3}, 387 1040:{items:4}, 388 1400:{items:4}, 389 } 390 }); 391 }); 392 393 }, 394 395 testimonials: function(){ 396 var carousel = $('.fn_cs_testi_carousel .owl-carousel'); 397 398 var rtlMode = false; 399 400 if($('body').hasClass('rtl')){ 401 rtlMode = 'true'; 402 } 403 carousel.each(function(){ 404 $(this).owlCarousel({ 405 loop: true, 406 items: 3, 407 lazyLoad: false, 408 margin: 40, 409 autoplay: true, 410 autoplayTimeout: 7000, 411 dots: false, 412 nav: false, 413 navSpeed: false, 414 rtl: rtlMode, 415 responsive : { 416 0 : { 417 items: 1 418 }, 419 768 : { 420 items: 2 421 } 422 } 423 }); 424 }); 425 MarketifyTokyo.BgImg(); 426 }, 427 428 429 430 accordionFunction: function(){ 431 var head = $('.fn_cs_accordion .acc_head'), 432 s = 300, 433 a = 'swing'; 434 head.off().on('click',function(){ 435 var e = $(this), 436 p = e.closest('.fn_cs_accordion'),
437 c = e.closest('.accordion_in'), 438 t = p.data('type'); 439 if(!c.hasClass('acc_active')){ 440 if(t === 'accordion'){ 441 p.find('.acc_active').removeClass('acc_active').find('.acc_content').slideUp({duration:s,easing:a}); 442 } 443 c.addClass('acc_active').find('.acc_content').slideDown({duration:s,easing:a}); 444 }else{ 445 c.removeClass('acc_active').find('.acc_content').slideUp({duration:s,easing:a}); 446 } 447 }); 448 }, 449 450 451 452 allGalleryFunctions: function(){ 453 MarketifyTokyo.lightGallery(); 454 MarketifyTokyo.justifiedGallery(); 455 MarketifyTokyo.galleryMasonry(); 456 MarketifyTokyo.BgImg(); 457 MarketifyTokyo.gallerySlider(); 458 MarketifyTokyo.collageCarousel(); 459 MarketifyTokyo.isotopeFunction(); 460 MarketifyTokyo.inlineStyle(); 461 setTimeout(function(){ 462 MarketifyTokyo.isotopeFunction(); 463 },2000); 464 }, 465 466 collageCarousel: function(){ 467 var carousel = $('.fn_cs_gallery_collage_a .owl-carousel'); 468 var rtlMode = false; 469 if($('body').hasClass('rtl')){ 470 rtlMode = true; 471 } 472 473 carousel.each(function(){ 474 var e = $(this); 475 var myNav = false; 476 var gutter = parseInt(e.closest('.fn_cs_gallery_collage_a').data('gutter')); 477 478 e.owlCarousel({ 479 items: 4, 480 lazyLoad: true, 481 loop:true, 482 rtl: rtlMode, 483 animateOut: 'fadeOut', 484 animateIn: 'fadeIn', 485 autoWidth:true, 486 autoplay: true, 487 autoplayTimeout: 70000, 488 smartSpeed: 2000, 489 margin: gutter, 490 dots: true, 491 nav: myNav, 492 navSpeed: true 493 }); 494 }); 495 }, 496 497 gallerySlider: function(){ 498 $('.fn_cs_gallery_slider .inner').each(function(){ 499 var element = $(this); 500 if(element.hasClass('gogogo')){ 501 return false; 502 }element.addClass('gogogo'); 503 var container = element.find('.swiper-container'); 504 505 506 var pagination = element.closest('.fn_cs_gallery_slider').data('pag'); 507 var paginationClass = 'fn_cs_swiper__progress'; 508 var type = 'custom'; 509 var clickable = false; 510 if(pagination === 'dots'){ 511 paginationClass = 'fn_cs_swiper__dots'; 512 type = 'bullets'; 513 clickable = true; 514 } 515 516 517 var mySwiper = new Swiper (container, { 518 loop: true, 519 slidesPerView: 1, 520 spaceBetween: 70, 521 loopAdditionalSlides: 50, 522 speed: 800, 523 autoplay: { 524 delay: 8000, 525 }, 526 navigation: { 527 nextEl: '.swiper-button-next', 528 prevEl: '.swiper-button-prev', 529 }, 530 on: { 531 init: function(){ 532 element.closest('.fn_cs_gallery_slider').addClass('ready'); 533 }, 534 autoplayStop: function(){ 535 mySwiper.autoplay.start(); 536 }, 537 }, 538 pagination: { 539 el: '.'+paginationClass, 540 type: type, // progressbar 541 clickable: clickable, 542 renderCustom: function (swiper,current,total) { 543 if(pagination === 'fill' || pagination === 'scrollbar'){ 544 // progress animation 545 var scale,translateX; 546 var progressDOM = container.find('.fn_cs_swiper__progress'); 547 if(progressDOM.hasClass('fill')){ 548 translateX = '0px'; 549 scale = parseInt((current/total)*100)/100; 550 }else{ 551 scale = parseInt((1/total)*100)/100; 552 translateX = (current-1) * parseInt((100/total)*100)/100 + 'px'; 553 } 554 555 556 progressDOM.find('.all span').css({transform:'translate3d('+translateX+',0px,0px) scaleX('+scale+') scaleY(1)'}); 557 if(current<10){current = '0' + current;} 558 if(total<10){total = '0' + total;} 559 progressDOM.find('.current').html(current); 560 progressDOM.find('.total').html(total); 561 } 562 }, 563 renderBullet: function (index, className) { 564 return '<span class="' + className + ' fn_dots"></span>'; 565 } 566 }, 567 }); 568 }); 569 MarketifyTokyo.BgImg(); 570 }, 571 572 galleryMasonry: function(){ 573 MarketifyTokyo.lightGallery(); 574 MarketifyTokyo.isotopeFunction(); 575 }, 576 577 justifiedGallery: function(){ 578 MarketifyTokyo.lightGallery(); 579 var justified = $(".fn_cs_gallery_justified"); 580 justified.each(function(){ 581 var element = $(this); 582 var height = parseInt(element.attr('data-height')); 583 var gutter = parseInt(element.attr('data-gutter')); 584 if(!height || height === 0){height = 400;} 585 if(!gutter || gutter === 0){gutter = 10;} 586 if($().justifiedGallery){ 587 element.justifiedGallery({ 588 rowHeight : height, 589 lastRow : 'nojustify', 590 margins : gutter, 591 refreshTime: 500, 592 refreshSensitivity: 0, 593 maxRowHeight: null, 594 border: 0, 595 captions: false, 596 randomize: false 597 });
598 } 599 }); 600 }, 601 602 603 /* COMMMON FUNCTIONS */ 604 BgImg: function(){ 605 var div = $('*[data-fn-bg-img]'); 606 div.each(function(){ 607 var element = $(this); 608 var attrBg = element.attr('data-fn-bg-img'); 609 var dataBg = element.data('fn-bg-img'); 610 if(typeof(attrBg) !== 'undefined'){ 611 element.addClass('marketify-ready'); 612 element.css({backgroundImage:'url('+dataBg+')'}); 613 } 614 }); 615 }, 616 617 ImgToSVG: function(){ 618 619 $('img.tokyo_fn_svg,img.tokyo_w_fn_svg').each(function(){ 620 var $img = $(this); 621 var imgClass = $img.attr('class'); 622 var imgURL = $img.attr('src'); 623 624 $.get(imgURL, function(data) { 625 var $svg = $(data).find('svg'); 626 if(typeof imgClass !== 'undefined') { 627 $svg = $svg.attr('class', imgClass+' replaced-svg'); 628 } 629 $img.replaceWith($svg); 630 631 }, 'xml'); 632 633 }); 634 }, 635 636 jarallaxEffect: function(){ 637 $('.jarallax').each(function(){ 638 var element = $(this); 639 var customSpeed = element.data('speed'); 640 641 if(customSpeed !== "undefined" && customSpeed !== ""){ 642 customSpeed = customSpeed; 643 }else{ 644 customSpeed = 0.5; 645 } 646 element.jarallax({ 647 speed: customSpeed, 648 automaticResize: true 649 }); 650 }); 651 }, 652 isotopeFunction: function(){ 653 var masonry = $('.fn_cs_masonry'); 654 if($().isotope){ 655 masonry.each(function(){ 656 $(this).isotope({ 657 itemSelector: '.fn_cs_masonry_in', 658 masonry: {} 659 }); 660 $(this).isotope( 'reloadItems' ).isotope(); 661 }); 662 } 663 var items = $('.fn_cs_project_category .posts_list'); 664 if($().isotope){ 665 items.each(function() { 666 $(this).isotope({ 667 itemSelector: 'li', 668 masonry: {} 669 }); 670 }); 671 } 672 }, 673 674 lightGallery: function(){ 675 if($().lightGallery){ 676 // FIRST WE SHOULD DESTROY LIGHTBOX FOR NEW SET OF IMAGES 677 var gallery = $('.fn_cs_lightgallery'); 678 679 gallery.each(function(){ 680 var element = $(this); 681 element.lightGallery(); // binding 682 if(element.length){element.data('lightGallery').destroy(true); }// destroying 683 $(this).lightGallery({ 684 selector: ".lightbox", 685 thumbnail: 1, 686 loadYoutubeThumbnail: !1, 687 loadVimeoThumbnail: !1, 688 showThumbByDefault: !1, 689 mode: "lg-fade", 690 download:!1, 691 getCaptionFromTitleOrAlt:!1, 692 }); 693 }); 694 } 695 }, 696 }; 697 698 $( window ).on( 'elementor/frontend/init', MarketifyTokyo.init ); 699 700 701 $( window ).on('resize',function(){ 702 MarketifyTokyo.isotopeFunction(); 703 setTimeout(function(){ 704 MarketifyTokyo.isotopeFunction(); 705 },700); 706 }); 707 $( window ).on('load',function(){ 708 MarketifyTokyo.isotopeFunction(); 709 }); 710 711 $(window).on('scroll',function(){ 712 MarketifyTokyo.circularProgress(); 713 }); 714 715})(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.