1/*! 2 * Creativa scripts 3 */ 4 5(function($) { 6 "use strict"; 7 8 $('.main-nav ul > li, .sidebar-nav ul > li, .full-nav ul > li, .nav-icons ul .nav-bag, #top-bar .woo-settings, #lang_sel li').hover( 9 function(){ 10 $(this).children('ul').stop().slideDown(100).children('li').stop(true, true).delay(100).animate({ 11 opacity: 1, 12 }, 200, function() { 13 // Animation complete. 14 }); 15 }, 16 function(){ 17 $(this).children('ul').stop().slideUp(100).children('li').stop(true, true).animate({ 18 opacity: 0, 19 }, 100, function() { 20 // Animation complete. 21 }); 22 } 23 ); 24 25 $('.main-nav ul .creativa-mega-menu > ul > li > a').click(function(){ 26 return false; 27 }) 28 29 $(".main-nav ul > li").on('mouseenter mouseleave', function (e) { 30 var $this = $(this); 31 if ($('ul', this).length) { 32 var elm = $('ul:first', this); 33 var off = elm.offset(); 34 var l = off.left; 35 var w = elm.width(); 36 var docH = $(window).height(); 37 var docW = $(window).width(); 38 39 var isEntirelyVisible = (l + w >= docW); 40 41 if ($('body').hasClass('rtl')) { 42 var isEntirelyVisible = (l <= 0); 43 } 44 45 if (isEntirelyVisible) { 46 $this.children('.sub-menu').addClass('sub-menu--shift'); 47 } else { 48 // $(this).children('.sub-menu').removeClass('sub-menu--shift'); 49 setTimeout(function() { 50 $this.children('.sub-menu').removeClass('sub-menu--shift'); 51 }, 100); 52 } 53 } 54 }); 55 56 57 function creativa_mobileLogoWidth() { 58 var navbarWidth = $('body:not(.header-centered) #navbar').outerWidth(), 59 logo = $('body:not(.header-centered) #navbar .theme-logo'), 60 logoWidth = logo.outerWidth(), 61 menuWidth = $('body:not(.header-centered) #navbar .menu-nav').outerWidth(), 62 icons = $('body:not(.header-centered) #navbar .nav-icons'), 63 iconsSH = $('body:not(.header-centered) #sticky-header .nav-icons'), 64 iconsWidth = icons.outerWidth(); 65 66 67 // console.log(iconsWidth); 68 69 if (Modernizr.mq('(max-width: 1200px)')) { 70 if (logoWidth + iconsWidth + menuWidth >= navbarWidth) { 71 icons.addClass('hidden-md'); 72 iconsSH.addClass('hidden-md'); 73 } 74 75 if ($('body').hasClass('header-splitted')) { 76 icons.addClass('hidden-md'); 77 iconsSH.addClass('hidden-md'); 78 } 79 } 80 81 if (Modernizr.mq('(max-width: 992px)')) { 82 if (logoWidth + iconsWidth >= navbarWidth) { 83 logo.css('max-width', navbarWidth - iconsWidth); 84 } else { 85 logo.css('max-width', ''); 86 } 87 } 88 } 89 90 creativa_mobileLogoWidth(); 91 $(window).resize(function(){ 92 creativa_mobileLogoWidth(); 93 }); 94 95 96 // Fit Vid 97 $('.fit-vid').fitVids(); 98 $('.fit-vid').each(function(){ 99 var AudIframeH = $(this).children('iframe').height(); 100 $(this).css('height',AudIframeH); 101 102 $(window).resize(function(){ 103 var AudIframeH = $('.fit-vid iframe').height(); 104 $(this).css('height',AudIframeH); 105 }); 106 }) 107 108 $(window).resize(function(){ 109 var VidIframeH = $('.fit-vid iframe').height(); 110 $('.fit-vid').css('height',VidIframeH); 111 }); 112 113 // fit audio height fix 114 $('.fit-aud').each(function(){ 115 var AudIframeH = $(this).children('iframe').height(); 116 $(this).css('height',AudIframeH); 117 118 $(window).resize(function(){ 119 var AudIframeH = $('.fit-aud iframe').height(); 120 $(this).css('height',AudIframeH); 121 }); 122 }) 123 124 125 126 // Article share 127 var pageHref = $('link[rel=canonical]').eq(0).attr('href'), 128 pageTitle = document.title; 129 130 function creativa_facebookShare() { 131 window.open( 'https://www.facebook.com/sharer/sharer.php?u='+ pageHref, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 132 return false; 133 } 134 135 function creativa_twitterShare() { 136 window.open( 'http://twitter.com/intent/tweet?text='+pageHref, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 137 return false; 138 } 139
140 function creativa_googleplusShare() { 141 window.open( 'https://plus.google.com/share?url='+pageHref, "googleplusWindow", "height=400,width=515,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 142 return false; 143 } 144 145 function creativa_linkedInShare() { 146 window.open( 'https://www.linkedin.com/shareArticle?mini=true&url='+pageHref+'&title='+pageTitle, "linkedinWindow", "height=640,width=720,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 147 return false; 148 } 149 150 function creativa_pinterestShare() { 151 var imgShare = $(".content-wrapper img").attr('src'); 152 window.open( 'http://pinterest.com/pin/create/button/?url='+pageHref+'&media='+imgShare, "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 153 return false; 154 } 155 156 $('.share-facebook').click(creativa_facebookShare); 157 $('.share-twitter').click(creativa_twitterShare); 158 $('.share-google-plus').click(creativa_googleplusShare); 159 $('.share-linkedin').click(creativa_linkedInShare); 160 $('.share-pinterest').click(creativa_pinterestShare); 161 162 $('.shares-list .get-share a, #page-shares > ul > li > a').click(function(){ return false; }) 163 164 function creativa_masonryFWFix() { 165 $('.portfolio-fullwidth .portfolio-items--container').each(function(){ 166 var contW = $('.layout-wrapper').outerWidth(), 167 contWGap = $(this).find('.type-portfolio').css('paddingLeft'); 168 169 $(this).css('width', contW - parseInt(contWGap) * 4); 170 }) 171 } 172 173 creativa_masonryFWFix(); 174 175 $(window).resize(function(){ 176 creativa_masonryFWFix(); 177 }) 178 179 // portfolio masonry 180 function creativa_portfolioMasonry() { 181 var $masonryContainer = $('.portfolio--masonry'), 182 loader = '<div class=\"spinner portfolio-spinner\"></div>'; 183 184 $masonryContainer.prepend(loader); 185 $('.portfolio--masonry').each(function(){ 186 var portContWidth = $(this).width(), 187 portContWidthOut = $(this).children('.row').outerWidth(), 188 gapSize = portContWidthOut - portContWidth, 189 paddGap = $(this).find('[class*="col-md"]').innerWidth() - $(this).find('[class*="col-md"]').width(), 190 191 smallH = $(this).find('.portfolio_masonry--small').width(), 192 wideH = $(this).find('.portfolio_masonry--wide').width() / 2, 193 bigH = $(this).find('.portfolio_masonry--big').width(), 194 tallH = $(this).find('.portfolio_masonry--tall').width(), 195 196 elH = '', 197 styleBH = 0; 198 199 200 if (smallH != null) { 201 elH = smallH; 202 } 203 else if (wideH != null) { 204 elH = wideH; 205 } 206 else if (bigH != null) { 207 elH = (bigH / 2) - (paddGap / 2); 208 } 209 else { 210 elH = null; 211 } 212 213 214 $(this).find('.portfolio_masonry--wide .portfolio-item .portfolio_image-container').css({"height" : elH, "padding-bottom" : 0}); 215 $(this).find('.portfolio_masonry--small .portfolio-item .portfolio_image-container').css({"height" : elH, "padding-bottom" : 0}); 216 $(this).find('.portfolio_masonry--big .portfolio-item .portfolio_image-container').css({"height" : (elH * 2) + paddGap + styleBH, "padding-bottom" : 0}); 217 $(this).find('.portfolio_masonry--tall .portfolio-item .portfolio_image-container').css({"height" : (elH * 2) + paddGap + styleBH, "padding-bottom" : 0}); 218 219 220 }) 221 222 var $portfolioCont = $('.portfolio--masonry .row').imagesLoaded(function(){ 223 $('.portfolio-spinner').remove(); 224 225 // responsivePortfolioHeightFix(); 226 $portfolioCont.removeClass('pm-hidden').addClass('pm-visible').isotope({ 227 // options... 228 itemSelector: '[class*="col-"]', 229 layoutMode: 'packery', 230 getSortData: { 231 // name: '.name', // text from querySelector 232 likes: '[data-likes]', 233 views: '[data-views]', 234 }, 235 sortAscending: false, 236 // masonry: { 237 // // columnWidth: 1 238 // } 239 }); 240 }) 241 } 242 243 creativa_portfolioMasonry(); 244 $(window).resize(function(){ 245 creativa_portfolioMasonry(); 246 }) 247 248 jQuery(function($){$("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />'),$(document).on("click",".plus, .minus",function(){var t=$(this).closest(".quantity").find(".qty"),a=parseFloat(t.val()),n=parseFloat(t.attr("max")),s=parseFloat(t.attr("min")),e=t.attr("step");a&&""!==a&&"NaN"!==a||(a=0),(""===n||"NaN"===n)&&(n=""),(""===s||"NaN"===s)&&(s=0),("any"===e||""===e||void 0===e||"NaN"===parseFloat(e))&&(e=1),$(this).is(".plus")?t.val(n&&(n==a||a>n)?n:a+parseFloat(e)):s&&(s==a||s>a)?t.val(s):a>0&&t.val(a-parseFloat(e)),t.trigger("change")})}); 249 250 function creativa_portfolioFiltering() { 251 // portoflio filtering 252 $('.portfolio--filtered .row').each(function(){ 253 var $container = $(this), 254 contW = $(this).outerWidth(); 255 256 $container.imagesLoaded(function(){ 257 // initialize isotope 258 $container.isotope({ 259 // resizesContainer: false, 260 // animationEngine: 'best-available', 261 // isResizeBound: false, 262 getSortData: { 263 // name: '.name', // text from querySelector
264 likes: '[data-likes]', 265 views: '[data-views]', 266 }, 267 sortAscending: false, 268 percentPosition: true, 269 // sortBy: likes, 270 }); 271 272 // filter items when filter link is clicked 273 $container.closest('.portfolio-wrapper').parent().find('.filter--a').click(function(){ 274 var selector = $(this).attr('data-filter'); 275 $container.isotope({ filter: selector }); 276 277 //active classes 278 $(this).parent().parent().find('.filter--a').removeClass('active'); 279 $(this).addClass('active'); 280 281 return false; 282 }); 283 284 $container.closest('.portfolio-wrapper').parent().find('.sorter--a').click(function() { 285 var sortValue = $(this).attr('data-sort-value'); 286 $container.isotope({ sortBy: sortValue }); 287 288 $(this).parent().parent().find('.sorter--a').removeClass('active'); 289 $(this).addClass('active'); 290 291 return false; 292 }); 293 294 $container.closest('.portfolio-wrapper').parent().find('.project--sorting > a').click(function() {return false;}) 295 296 $container.closest('.portfolio-wrapper').parent().find('.project--sorting').hover( 297 function(){ 298 $(this).children('ul').stop().slideDown(100).children('li').stop(true, true).delay(100).animate({ 299 opacity: 1, 300 }, 200, function() { 301 // Animation complete. 302 }); 303 }, 304 function(){ 305 $(this).children('ul').stop().slideUp(100).children('li').stop(true, true).animate({ 306 opacity: 0, 307 }, 100, function() { 308 // Animation complete. 309 }); 310 } 311 ); 312 313 314 }) 315 316 }) 317 } 318 319 creativa_portfolioFiltering(); 320 321 322 function creativa_masonryGalleryFix() { 323 $('.blog-masonry').each(function(){ 324 var galleryImgHeight = $(this).find('.format-gallery .post-media .rsContent img').height(), 325 galleryTmbHeight = $(this).find('.format-gallery .post-media .rsThumb img').height(), 326 galleryHeight = galleryImgHeight + galleryTmbHeight + 12; 327 328 $(this).find('.format-gallery .post-media').css('height', galleryHeight); 329 }) 330 } 331 332 333 // blog masonry 334 function creativa_blogMasonry() { 335 336 var $masonryContainer = $('.blog-masonry'), 337 loader = '<div class=\"spinner blog-spinner\"></div>'; 338 $masonryContainer.before(loader); 339 340 var $blogCont = $('.blog-masonry').imagesLoaded(function(){ 341 342 creativa_masonryGalleryFix(); 343 344 $('.blog-spinner').remove(); 345 $blogCont.removeClass('bm-hidden').addClass('bm-visible').isotope({ 346 // options... 347 itemSelector: '[class^="col-"]', 348 masonry: { 349 // columnWidth: '[class^="col-"]' 350 } 351 }); 352 353 }) 354 355 $(window).on('resize', function(){ 356 setTimeout(function(){ 357 creativa_masonryGalleryFix(); 358 $blogCont.isotope('layout'); 359 }, 1000); 360 }) 361 } 362 363 364 creativa_blogMasonry(); 365 366 367 // timeline 368 function creativa_shortcodeTimeline() { 369 370 var $timelineContainer = $('.loprd_timeline_wrapper.timeline-center'), 371 loader = '<div class=\"spinner timeline-spinner\"></div>'; 372 $timelineContainer.before(loader); 373 374 var $timelineCont = $('.loprd_timeline_wrapper.timeline-center').imagesLoaded(function(){ 375 376 $('.timeline-spinner').remove(); 377 $timelineCont.removeClass('timeline-hidden').addClass('timeline-visible').isotope({ 378 // options... 379 itemSelector: '.loprd_timeline_block_wrap', 380 stamp: '.timeline-stamp', 381 masonry: { 382 columnWidth: '.loprd_timeline_block_wrap' 383 } 384 }); 385 386 $('.loprd_timeline_block_wrap').each(function(){ 387 var posLeft = $(this).position().left; 388 389 if (posLeft == 0 ) { 390 $(this).removeClass('tl_block_right'); 391 $(this).addClass('tl_block_left'); 392 } else { 393 $(this).removeClass('tl_block_left'); 394 $(this).addClass('tl_block_right'); 395 } 396 397 }) 398 399 }) 400 } 401 402 creativa_shortcodeTimeline(); 403 404 $(window).resize(function(){ 405 creativa_shortcodeTimeline(); 406 }) 407 408 $(window).on("orientationchange",function(){ 409 creativa_shortcodeTimeline(); 410 }); 411 412 413 // blog masonry 414 function creativa_imageGrid() { 415 416 var $masonryContainer = $('.image_grid_ul'), 417 loader = '<div class=\"spinner ig-spinner\"></div>'; 418 $masonryContainer.before(loader); 419 420 var $blogCont = $('.image_grid_ul').imagesLoaded(function(){ 421 422 $('.ig-spinner').remove(); 423 $blogCont.removeClass('ig-hidden').addClass('ig-visible').isotope({ 424 // options... 425 itemSelector: '.isotope-item', 426 masonry: { 427 columnWidth: '.isotope-item' 428 } 429 }); 430 431 }) 432 433 $(window).on('load resize', function(){ 434 setTimeout(function(){ 435 $blogCont.isotope('layout'); 436 }, 1000); 437 }) 438 } 439 440 creativa_imageGrid(); 441 442 function creativa_galleryCollage() { 443 $('.loprd-gallery__collage').each(function() { 444 445 var $collageContainer = $(this), 446 collageTargetHeight = $collageContainer.data('collage-target'), 447 collageGap = $collageContainer.data('collage-gap'); 448 449 450 $collageContainer.justifiedGallery({ 451 rowHeight : collageTargetHeight, 452 lastRow : 'nojustify', 453 captions: false, 454 margins : collageGap, 455 // fixedHeight : true, 456 maxRowHeight : '120%', 457 border : 0, 458 selector: '> .gallery-collage__inner', 459 imagesAnimationDuration: 300, 460 }); 461 462 463 }) 464 } 465 466 creativa_galleryCollage(); 467 468 function creativa_secondary_navigation() { 469 470 var triggerBttn = $(".secondary-nav-btn"),
471 overlay = document.querySelector( '.secondary-navigation' ), 472 layoutWrap = document.querySelector( '.layout-wrapper' ), 473 closeBttn = $('.sec-nav-close-btn a'), 474 closeOvrl = $('.sec-nav-overlay'), 475 $html = document.querySelector( 'html' ), 476 transEndEventNames = { 477 'WebkitTransition': 'webkitTransitionEnd', 478 'MozTransition': 'transitionend', 479 'OTransition': 'oTransitionEnd', 480 'msTransition': 'MSTransitionEnd', 481 'transition': 'transitionend' 482 }, 483 transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ], 484 support = { transitions : Modernizr.csstransitions }, 485 486 // stickyH = document.querySelector( '#sticky-header' ), 487 stickyHeader = $('#sticky-header'), 488 stickyHVis = false, 489 490 st = 0, 491 currentPos = 0; 492 493 $(window).scroll(function(){ 494 st = $(document).scrollTop(); 495 }) 496 497 function creativa_toggleOverlay() { 498 if( classie.has( overlay, 'open' ) ) { 499 classie.remove( overlay, 'open' ); 500 classie.remove( layoutWrap, 'open' ); 501 // classie.remove( $html , 'creativa-no-scroll' ); 502 classie.add( overlay, 'closed' ); 503 classie.add( layoutWrap, 'closed' ); 504 // stickyHeader.css('opacity','1'); 505 stickyHeader.delay(200).animate({ 506 opacity: 1, 507 }, 200); 508 setTimeout(function(){ creativa_footerFixed(); }, 800); 509 var onEndTransitionFn = function( ev ) { 510 if( support.transitions ) { 511 if( ev.propertyName !== 'visibility' ) return; 512 this.removeEventListener( transEndEventName, onEndTransitionFn ); 513 } 514 classie.remove( overlay, 'closed' ); 515 classie.remove( layoutWrap, 'closed' ); 516 }; 517 if( support.transitions ) { 518 overlay.addEventListener( transEndEventName, onEndTransitionFn ); 519 } 520 else { 521 onEndTransitionFn(); 522 } 523 } 524 else if( !classie.has( overlay, 'closed' ) ) { 525 classie.add( overlay, 'open' ); 526 classie.add( layoutWrap, 'open' ); 527 // classie.add( $html , 'creativa-no-scroll' ); 528 if ($('body').hasClass('footer--fixed')) { 529 $('.content-wrapper').css('margin-bottom', '0'); 530 } 531 // stickyHeader.css('opacity','0'); 532 stickyHeader.animate({ 533 opacity: 0, 534 }, 300); 535 } 536 537 } 538 539 triggerBttn.click(function(){ 540 creativa_toggleOverlay(); 541 return false; 542 }) 543 closeBttn.click(function(){ 544 creativa_toggleOverlay(); 545 return false; 546 }) 547 closeOvrl.click(function(){ 548 creativa_toggleOverlay(); 549 return false; 550 }) 551 }; 552 553 creativa_secondary_navigation(); 554 555 function creativa_side_nav_responsive() { 556 557 var sideNav = $('.nav-side'), 558 contentWrap = $( '.side-nav--content-wrapper' ), 559 overlay = $('.nav-side__overlay'); 560 561 sideNav.on('scroll mouseenter', function(){ 562 var scrollH = $('.nav-side__wrapper').outerHeight(); 563 overlay.css('min-height', scrollH); 564 }) 565 566 if (Modernizr.mq('(min-width: 1366px)')) { 567 sideNav.addClass('open'); 568 contentWrap.addClass('open'); 569 570 $('.nav-side.open').perfectScrollbar(); 571 } 572 if (Modernizr.mq('(max-width: 1365px)')) { 573 sideNav.removeClass('open'); 574 contentWrap.removeClass('open'); 575 sideNav.addClass('closed'); 576 contentWrap.addClass('closed'); 577 578 sideNav.hover( 579 function(){ 580 sideNav.removeClass('closed'); 581 contentWrap.removeClass('closed'); 582 sideNav.addClass('open'); 583 contentWrap.addClass('open'); 584 $('.nav-side.open').perfectScrollbar(); 585 }, 586 function(){ 587 sideNav.removeClass('open'); 588 contentWrap.removeClass('open'); 589 sideNav.addClass('closed'); 590 contentWrap.addClass('closed'); 591 592 } 593 ) 594 595 contentWrap.click(function(){ 596 if (contentWrap.hasClass('open')) { 597 sideNav.removeClass('open'); 598 contentWrap.removeClass('open'); 599 sideNav.addClass('closed'); 600 contentWrap.addClass('closed'); 601 } 602 }) 603 } 604 }; 605 606 creativa_side_nav_responsive(); 607 $(window).resize(function(){ 608 creativa_side_nav_responsive(); 609 }) 610
611 $('.sidebar-nav-wrap, .full-nav-wrap').perfectScrollbar(); 612 613 $('body').scrollspy({ target: 'nav' }); 614 615 var $hashScrollTo = $("a[href*='#']:not(.comment-reply-link):not([rel='nofollow']):not(#recentcomments a):not(.recent_comments_excerpt):not(.vc_pagination-trigger):not(.comments-link):not(.ui-tabs-anchor):not(.pagination a):not(.hash-external)"); 616 $hashScrollTo.on('click', function(e) { 617 // prevent default anchor click behavior 618 // store hash 619 var hash = this.hash, 620 localPathname = location.pathname, 621 linkPathname = e.currentTarget.pathname; 622 623 if (linkPathname == localPathname) { 624 e.preventDefault(); 625 626 if ( $(hash).length && $(this).attr('class') != 'ui-tabs-anchor') { 627 $('html, body').animate({ 628 scrollTop: $(hash).offset().top 629 }, 500, function(){ 630 window.location.hash = hash; 631 }); 632 } 633 } 634 635 // animate 636 637 }); 638 639 // Royal Slider 640 // Single Project Gallery 641 function creativa_imageSlider() { 642 var contNav = 'thumbnails'; 643 644 $('.image-slider').each(function(){ 645 var attr = $(this).attr('data-nav'); 646 647 var autoplay = $(this).attr('data-autoplay'), 648 autoplayEn = false, 649 transition = $(this).attr('data-transition'), 650 transitionTp = 'move'; 651 652 if (autoplay != 0) { 653 autoplayEn = true; 654 } 655 656 if (transition == 'fade') { 657 transitionTp = 'fade'; 658 } 659 660 if (typeof attr !== typeof undefined && attr !== false) { 661 if (attr == 'nav_thumbs') { 662 contNav = 'thumbnails'; 663 } 664 else if (attr == 'nav_bullets') { 665 contNav = 'bullets'; 666 } 667 else if (attr == 'nav_none') { 668 contNav = 'none'; 669 } 670 } else { 671 contNav = 'thumbnails'; 672 } 673 674 // $(this).imagesLoaded(function(){ 675 676 $(this).royalSlider({ 677 autoHeight: true, 678 arrowsNav: true, 679 arrowsNavAutoHide: false, 680 controlsInside: false, 681 fadeinLoadedSlide: true, 682 controlNavigationSpacing: 0, 683 controlNavigation: contNav, 684 imageScaleMode: 'none', 685 imageAlignCenter: true, 686 loop: false, 687 loopRewind: true, 688 numImagesToPreload: 4, 689 keyboardNavEnabled: true, 690 usePreloader: false, 691 transitionType: transitionTp, 692 addActiveClass: true, 693 slidesSpacing: 4, 694 autoPlay: { 695 // autoplay options go gere 696 enabled: autoplayEn, 697 pauseOnHover: true, 698 stopAtAction: true, 699 delay: +autoplay, 700 }, 701 thumbs: { 702 appendSpan: true, 703 firstMargin: true, 704 arrows: true, 705 autoCenter: false 706 } 707 }); 708 709 // }); 710 }) 711 712 } 713 714 creativa_imageSlider(); 715 716 $(window).on('load resize',function() { 717 // update size of slider (if you already initialized it before) 718 $('.image-slider').royalSlider('updateSliderSize', true); 719 $('.project-slider--wide').royalSlider('updateSliderSize', true); 720 721 creativa_imageSlider(); 722 }); 723 724 725 726 function creativa_projectWideHeight() { 727 728 var heights = $(".project-slider--wide .slider__inner--wrap").imagesLoaded().map(function () 729 { 730 return $(this).outerHeight(); 731 }).get(), 732 733 maxHeight = Math.max.apply(null, heights); 734 735 $('.project-slider--wide').css('height', maxHeight); 736 737 } 738 739 $('.project-slider--wide').imagesLoaded(function(){ 740 creativa_projectWideHeight(); 741 }) 742 743 $(window).resize(function() { 744 creativa_projectWideHeight(); 745 }) 746 747 $('.project-slider--wide').royalSlider({ 748 autoHeight: false, 749 arrowsNav: true, 750 arrowsNavAutoHide: false, 751 controlsInside: false, 752 fadeinLoadedSlide: false, 753 controlNavigationSpacing: 0, 754 controlNavigation: 'bullets', 755 imageScaleMode: 'none', 756 imageAlignCenter: true, 757 loop: false, 758 loopRewind: false, 759 numImagesToPreload: 4, 760 keyboardNavEnabled: true, 761 usePreloader: false, 762 slidesSpacing: 80, 763 addActiveClass: true, 764 }); 765 766 767 768 function creativa_recentsCarousel() { 769 $('.content-carousel').each(function(){ 770 771 var navi = $(this).attr('data-carousel-nav'), 772 autoplay = $(this).attr('data-autoplay'), 773 autoplayEn = false, 774 transition = $(this).attr('data-transition'), 775 transitionTp = 'move', 776 777 itemsGap = 30, 778 itemsGapAttr = $(this).data('gap'); 779 780 if (typeof itemsGapAttr !== typeof undefined && itemsGapAttr !== false) { 781 itemsGap = itemsGapAttr; 782 } 783 784 if (autoplay != 0) { 785 autoplayEn = true; 786 } 787 788 if (transition == 'fade') { 789 transitionTp = 'fade'; 790 } 791 792 $(this).royalSlider({ 793 autoHeight: true, 794 arrowsNav: true, 795 arrowsNavAutoHide: false, 796 controlsInside: false, 797 fadeinLoadedSlide: true, 798 controlNavigationSpacing: 0, 799 controlNavigation: navi, 800 navigateByClick: false, 801 loop: false, 802 loopRewind: true, 803 keyboardNavEnabled: true, 804 // slidesSpacing: 30, 805 transitionType: transitionTp, 806 addActiveClass: true, 807 slidesSpacing: +itemsGap, 808 autoPlay: { 809 // autoplay options go gere
810 enabled: autoplayEn, 811 pauseOnHover: true, 812 stopAtAction: true, 813 delay: +autoplay, 814 } 815 }); 816 817 }) 818 819 } 820 821 creativa_recentsCarousel(); 822 823 $(window).on(('load resize'), function() { 824 // update size of slider (if you already initialized it before) 825 $('.content-carousel').royalSlider('updateSliderSize', true); 826 827 creativa_recentsCarousel(); 828 }); 829 830 $('.quick-view').magnificPopup({ 831 //type: 'image', 832 closeOnContentClick: true, 833 mainClass: 'my-mfp-zoom-in', 834 midClick: true, 835 closeBtnInside: false, 836 image: { 837 verticalFit: true 838 }, 839 gallery: { 840 enabled: true, 841 navigateByImgClick: true, 842 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 843 }, 844 removalDelay: 500, //delay removal by X to allow out-animation 845 callbacks: { 846 beforeOpen: function() { 847 // just a hack that adds mfp-anim class to markup 848 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 849 this.st.iframe.markup = this.st.iframe.markup.replace('mfp-iframe-scaler', 'mfp-iframe-scaler mfp-with-anim'); 850 this.st.mainClass = this.st.el.attr('data-effect'); 851 } 852 }, 853 }); 854 855 $('.portfolio__a--gallery').each(function(){ 856 var galleryID = $(this).attr('data-id'), 857 galleryLink = '.gallery-id-'+galleryID; 858 859 $(galleryLink).magnificPopup({ 860 //type: 'image', 861 // delegate: 'a', 862 closeOnContentClick: true, 863 mainClass: 'my-mfp-zoom-in', 864 midClick: true, 865 closeBtnInside: false, 866 image: { 867 verticalFit: true 868 }, 869 gallery: { 870 enabled: true, 871 navigateByImgClick: true, 872 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 873 }, 874 removalDelay: 500, //delay removal by X to allow out-animation 875 callbacks: { 876 beforeOpen: function() { 877 // just a hack that adds mfp-anim class to markup 878 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 879 this.st.iframe.markup = this.st.iframe.markup.replace('mfp-iframe-scaler', 'mfp-iframe-scaler mfp-with-anim'); 880 this.st.mainClass = this.st.el.attr('data-effect'); 881 } 882 }, 883 }); 884 }) 885 886 887 888 $('a.magnpopup').magnificPopup({ 889 type: 'image', 890 closeOnContentClick: true, 891 mainClass: 'my-mfp-zoom-in', 892 midClick: true, 893 closeBtnInside: false, 894 image: { 895 verticalFit: true 896 }, 897 gallery: { 898 enabled: true, 899 navigateByImgClick: true, 900 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 901 }, 902 removalDelay: 500, //delay removal by X to allow out-animation 903 callbacks: { 904 beforeOpen: function() { 905 // just a hack that adds mfp-anim class to markup 906 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 907 this.st.iframe.markup = this.st.iframe.markup.replace('mfp-iframe-scaler', 'mfp-iframe-scaler mfp-with-anim'); 908 this.st.mainClass = this.st.el.attr('data-effect'); 909 } 910 }, 911 }); 912 913 var isUriImage = function(uri) { 914 //make sure we remove any nasty GET params 915 uri = uri.split('?')[0]; 916 //moving on, split the uri into parts that had dots before them 917 var parts = uri.split('.'); 918 //get the last part ( should be the extension ) 919 var extension = parts[parts.length-1]; 920 //define some image types to test against 921 var imageTypes = ['jpg','jpeg','tiff','png','gif','bmp']; 922 //check if the extension matches anything in the list. 923 if(imageTypes.indexOf(extension) !== -1) { 924 return true; 925 } 926 } 927 928 var WPGalleryHasImage = $('a [class*="wp-image-"]'), 929 WPGalleryHasImageURL = WPGalleryHasImage.parent('a'), 930 openInLightbox = false; 931 932 WPGalleryHasImage.on('click', function(e){ 933 var imageURL = $(this).parent('a').attr('href'); 934 935 openInLightbox = false; 936 937 if (isUriImage(imageURL)) { 938 openInLightbox = true; 939 } 940 }); 941 942 WPGalleryHasImageURL.magnificPopup({ 943 type: 'image', 944 closeOnContentClick: true, 945 mainClass: 'my-mfp-zoom-in', 946 midClick: true, 947 closeBtnInside: false, 948 image: { 949 verticalFit: true 950 }, 951 gallery: { 952 enabled: false, 953 }, 954 removalDelay: 500, //delay removal by X to allow out-animation 955 disableOn: function() { 956 if (openInLightbox === false) { 957 return false;
958 } 959 return true; 960 }, 961 callbacks: { 962 beforeOpen: function() { 963 // just a hack that adds mfp-anim class to markup 964 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 965 this.st.iframe.markup = this.st.iframe.markup.replace('mfp-iframe-scaler', 'mfp-iframe-scaler mfp-with-anim'); 966 this.st.mainClass = this.st.el.attr('data-effect'); 967 } 968 }, 969 }); 970 971 972 // layout fix 973 function creativa_stickyHeaderLayoutFix() { 974 if ($('body').hasClass('layout-boxed') || $('body').hasClass('layout-bordered')) { 975 var layoutWrapWidth = $('.layout-wrapper').width(), 976 windowWidth = $(window).width(), 977 $navbarSticky = $('#sticky-header'), 978 979 layoutGap = (windowWidth - layoutWrapWidth) / 2; 980 981 // console.log(layoutGap); 982 $navbarSticky.css({ 983 width: layoutWrapWidth, 984 left: layoutGap 985 }); 986 } 987 } 988 989 // Sticky Header 990 function creativa_stickyHeader() { 991 if (Modernizr.mq('(min-width: 991px)')) { 992 var $navbarSticky = $('#sticky-header'), 993 slideSpeed = 200, 994 995 topBar = $("#top-bar").height(), 996 navBar = $("#navbar").height(), 997 pageTitle = $(".page-title-container").height(), 998 999 lastScrollTop = 0, delta = 5; 1000 1001 var $header = $('#navbar'), 1002 headerOff = 0, 1003 headerTop = 0; 1004 1005 if ($header.length) { 1006 headerOff = $header.offset(); 1007 headerTop = headerOff.top; 1008 } 1009 1010 var stickyNavShow = topBar + navBar + headerTop + 350; 1011 1012 1013 1014 creativa_stickyHeaderLayoutFix(); 1015 $(window).resize(function(){ 1016 creativa_stickyHeaderLayoutFix(); 1017 }) 1018 1019 1020 // scroll 1021 $(window).scroll(function(){ 1022 var st = $(this).scrollTop(); 1023 1024 if (st >= headerTop) { 1025 if ($navbarSticky.hasClass('sh-show-alw')) { 1026 if(st > stickyNavShow ) { 1027 $navbarSticky.removeClass('sh-hidden').addClass('sh-visible'); 1028 } else { 1029 $navbarSticky.removeClass('sh-visible').addClass('sh-hidden'); 1030 } 1031 } 1032 else if ($navbarSticky.hasClass('sh-show-scrollup')) { 1033 if(st > stickyNavShow ) { 1034 if(Math.abs(lastScrollTop - st) <= delta) 1035 return; 1036 if (st > lastScrollTop){ 1037 if ($(this).scrollTop() > stickyNavShow ) { 1038 $navbarSticky.removeClass('sh-visible').addClass('sh-hidden'); 1039 } 1040 } else { 1041 // upscroll code 1042 $navbarSticky.removeClass('sh-hidden').addClass('sh-visible'); 1043 } 1044 } else { 1045 $navbarSticky.removeClass('sh-visible').addClass('sh-hidden'); 1046 } 1047 lastScrollTop = st; 1048 } 1049 } else { 1050 $navbarSticky.removeClass('sh-visible').addClass('sh-hidden'); 1051 } 1052 1053 }); 1054 } 1055 } 1056 1057 creativa_stickyHeader(); 1058 1059 function creativa_searchBar() { 1060 var openBtn = $('.nav-search a'), 1061 closeBtn = $('.search-bar .close-btn a'), 1062 1063 searchBarSel = '.search-bar'; 1064 1065 1066 openBtn.click(function(){ 1067 // $(this).parents('#navbar, #sticky-header').find(searchBarSel).addClass('search-bar-visible').removeClass('search-bar-hidden'); 1068 $(this).parents('#navbar, #sticky-header').find(searchBarSel).slideDown(100); 1069 $(this).parents('#navbar, #sticky-header').find(searchBarSel +' input').focus(); 1070 return false; 1071 }) 1072 1073 closeBtn.click(function(){ 1074 $(this).parents(searchBarSel).slideUp(100); 1075 return false; 1076 }) 1077 1078 $('.content-wrapper').click(function(){ 1079 $(searchBarSel).slideUp(100); 1080 }) 1081 1082 $(document).keyup(function(e) { 1083 if (e.keyCode == 27) { 1084 $(searchBarSel).slideUp(100); 1085 } 1086 }); 1087 } 1088 1089 creativa_searchBar(); 1090 1091 function creativa_backToTop() { 1092 var $backToTopContainer = $('.back-to-top'), 1093 backToTopBtn = $('.back-to-top-btn, .loprd_sep_btt .loprd_sep_text'), 1094 1095 windowHeight = $(window).height(); 1096 1097 $(window).scroll(function(){ 1098 var st = $(this).scrollTop(); 1099 1100 if (st > windowHeight) { 1101 $backToTopContainer.removeClass('btt-hidden').addClass('btt-visible'); 1102 } else { 1103 $backToTopContainer.removeClass('btt-visible').addClass('btt-hidden'); 1104 } 1105 }) 1106 1107 backToTopBtn.click(function () { 1108 $('body,html').animate({ 1109 scrollTop: 0 1110 }, 700); 1111 return false; 1112 }); 1113 } 1114 1115 creativa_backToTop(); 1116 1117 function creativa_vcRowHeightVA() { 1118 var $vc_va = $('.vc_row_vertical_align'); 1119 1120 $vc_va.each(function(){ 1121 var vcHeight = $(this).outerHeight(), 1122 vcContHeight = $(this).find('.vc_container_inner').outerHeight(), 1123 basicHeight = $(this).attr('data-basic-height'); 1124 1125 if (vcContHeight > vcHeight) { 1126 $(this).css('height', vcContHeight + 40); 1127 } else { 1128 if ($(this).hasClass('vc_row_custom_height')) { 1129 $(this).css('height', basicHeight); 1130 } 1131 } 1132 }) 1133 } 1134 1135 creativa_vcRowHeightVA(); 1136 1137 1138 function creativa_parallaxBG() { 1139 1140 $('.vc_bg_has_parallax').each(function(){ 1141 var $this = $(this), 1142 parallaxWrap = $(this).find('.vc_bg_parallax'), 1143
1144 parallaxRowHeight = 0, 1145 windowHeight = 0; 1146 1147 var pRowTopOffset = 0, 1148 pRowTop = 0, 1149 pRowTopStart = 0, 1150 1151 parallaxHeight = 0; 1152 1153 1154 parallaxRowHeight = $this.outerHeight(); 1155 windowHeight = $(window).height(); 1156 1157 parallaxHeight = windowHeight + parallaxRowHeight; 1158 1159 if ($this.length) { 1160 pRowTopOffset = $this.offset(); 1161 pRowTop = pRowTopOffset.top; 1162 pRowTopStart = pRowTop - windowHeight; 1163 } 1164 1165 $(window).on('scroll', function(){ 1166 parallaxRowHeight = $this.outerHeight(); 1167 windowHeight = $(window).height(); 1168 1169 parallaxHeight = windowHeight + parallaxRowHeight; 1170 1171 if ($this.length) { 1172 pRowTopOffset = $this.offset(); 1173 pRowTop = pRowTopOffset.top; 1174 pRowTopStart = pRowTop - windowHeight; 1175 } 1176 }); 1177 1178 var MQ = 0; 1179 1180 1181 creativa_triggerParallax(); 1182 $(window).on('resize', function(){ 1183 creativa_triggerParallax(); 1184 }); 1185 1186 //bind the scale event to window scroll if window width > $MQ (unbind it otherwise) 1187 function creativa_triggerParallax(){ 1188 if($(window).width()>= MQ) { 1189 creativa_parallaxAnimation(); 1190 1191 $(window).on('scroll', function(){ 1192 window.requestAnimationFrame(creativa_parallaxAnimation); 1193 }); 1194 } else { 1195 $(window).off('scroll'); 1196 } 1197 } 1198 1199 //assign a scale transformation to the #cd-background element and reduce its opacity 1200 function creativa_parallaxAnimation () { 1201 var scrollPos = ($(window).scrollTop() >= pRowTopStart) ? $(window).scrollTop() - pRowTopStart : 0, 1202 scrollPercentage = ((scrollPos / parallaxHeight) * 100).toFixed(3); 1203 1204 1205 1206 if ($(window).scrollTop() >= pRowTopStart && $(window).scrollTop() <= parallaxRowHeight + pRowTop) { 1207 var scrollValueBg = -30 + 30 * scrollPercentage * 0.01 + '%'; 1208 1209 parallaxWrap.css({ 1210 'transform': 'translateY(' + scrollValueBg + ')' 1211 }); 1212 } 1213 } 1214 }) 1215 } 1216 1217 creativa_parallaxBG(); 1218 1219 function creativa_pageTitleAnimation() { 1220 1221 var introSection = $('.page-title--animation'), 1222 introSectionHeight = introSection.height(), 1223 //change scaleSpeed if you want to change the speed of the scale effect 1224 scaleSpeed = 0.3, 1225 //change opacitySpeed if you want to change the speed of opacity reduction effect 1226 opacitySpeed = 1.15; 1227 1228 if (introSection.length) { 1229 var introOffset = introSection.offset(), 1230 introTop = introOffset.top; 1231 } 1232 1233 var bgSelector = introSection.find('.page-title-bg, .animated-canvas'); 1234 1235 //update this vale if you change this breakpoint in the style.css file (or _layout.scss if you use SASS) 1236 var MQ = 600; 1237 1238 creativa_triggerAnimation(); 1239 $(window).on('resize', function(){ 1240 creativa_triggerAnimation(); 1241 }); 1242 1243 //bind the scale event to window scroll if window width > $MQ (unbind it otherwise) 1244 function creativa_triggerAnimation(){ 1245 if($(window).width()>= MQ) { 1246 $(window).on('load scroll resize', function(){ 1247 window.requestAnimationFrame(creativa_animateIntro); 1248 }); 1249 } else { 1250 $(window).off('scroll'); 1251 } 1252 } 1253 1254 //assign a scale transformation to the #cd-background element and reduce its opacity 1255 function creativa_animateIntro () { 1256 var scrollPos = ($(window).scrollTop() >= introTop) ? $(window).scrollTop() - introTop : 0, 1257 scrollPercentage = (scrollPos/introSectionHeight).toFixed(5), 1258 scaleValue = 1 - scrollPercentage*scaleSpeed; 1259 1260 // console.log(introTop); 1261 1262 if( $(window).scrollTop() < introSectionHeight + introTop) { 1263 // console.log('alarm'); 1264 // bg animations 1265 if (introSection.hasClass('page-title__animation--parallax')) { 1266 //check if the page-title is still visible 1267 var scrollValueBg = 30 * scrollPercentage + '%'; 1268 1269 bgSelector.css({ 1270 'transform': 'translate(0, ' + scrollValueBg + ')', 1271 }); 1272 } 1273 else if (introSection.hasClass('page-title__animation--scaledown')) { 1274 //check if the page-title is still visible 1275 var scaleValue = 1 - scrollPercentage*.15; 1276 1277 bgSelector.css({ 1278 'transform': 'scale(' + scaleValue + ')', 1279 'opacity': 1 - scrollPercentage*opacitySpeed 1280 }); 1281 } 1282 else if (introSection.hasClass('page-title__animation--scaleup')) { 1283 //check if the page-title is still visible 1284 var scaleValue = 1 + scrollPercentage*.15; 1285 1286 bgSelector.css({ 1287 'transform': 'scale(' + scaleValue + ')', 1288 }); 1289 } 1290 else if (introSection.hasClass('page-title__animation--fold')) { 1291 //check if the page-title is still visible 1292 var scaleValue = scrollPercentage*90 + 'deg'; 1293 1294 bgSelector.css({ 1295 'transform': 'rotateX(' + scaleValue + ')', 1296 }); 1297 } 1298 else if (introSection.hasClass('page-title__animation--fade')) { 1299 //check if the page-title is still visible 1300 1301 bgSelector.css({ 1302 'opacity': 1 - scrollPercentage*opacitySpeed, 1303 }); 1304 } 1305 1306 1307 // content animations 1308 if (introSection.hasClass('page-title__animation--content-slidedown')) { 1309 var scrollValueC = 30 * scrollPercentage + '%'; 1310 1311 $('.page-title--animation .page-title-content').css({ 1312 'transform': 'translateY(' + scrollValueC + ')', 1313 'opacity': 1 - (scrollPercentage * 1)*opacitySpeed 1314 }); 1315 } 1316 else if (introSection.hasClass('page-title__animation--content-stretch')) { 1317 var scrollValueC = 5 * scrollPercentage + 'px'; 1318 1319 $('.page-title--animation .page-title-content, .page-title--animation .page-title-content h1, .page-title-content h2, .page-title-content h3, .page-title-content h4, .page-title-content h5, .page-title-content h6, .page-title-content p, .page-title-container .breadcrumb').css({ 1320 'letter-spacing': scrollValueC, 1321 'opacity': 1 - (scrollPercentage * 1.5)*opacitySpeed 1322 }); 1323 } 1324 else if (introSection.hasClass('page-title__animation--content-fadedown')) { 1325 $('.page-title--animation .page-title-content').css({ 1326 'opacity': 1 - (scrollPercentage * 3), 1327 }); 1328 } 1329 } 1330 } 1331 // } 1332 } 1333 1334 creativa_pageTitleAnimation(); 1335 1336 $(window).on('resize', function(){ 1337 creativa_pageTitleAnimation(); 1338 }) 1339 1340 1341 function creativa_loprd_counter() { 1342 $('.loprd-shortcode-counter').waypoint(function() { 1343 $('.loprd-counter').each(function(){ 1344 var thousandSepData = $(this).data('separator'), 1345 thousandSep = ' '; 1346 1347 if (thousandSepData == 'comma') { 1348 thousandSep = ','; 1349 } 1350 else if (thousandSepData == 'dot') { 1351 thousandSep = '.'; 1352 } 1353 else if (thousandSepData == 'none') { 1354 thousandSep = ''; 1355 } 1356 1357 $(this).countTo({ 1358 formatter: function (value, options) { 1359 return options.prefix + value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, thousandSep) + options.suffix; 1360 } 1361 }); 1362 }) 1363 }, { triggerOnce: true, offset: '90%' }) 1364 }; 1365 1366 creativa_loprd_counter(); 1367 1368 1369 function creativa_loprd_countdown() { 1370 $('.loprd-countdown').each(function() { 1371 var $this = $(this), 1372 finalDate = $(this).data('countdown'), 1373 formatter = $(this).data('formatter'); 1374 $this.countdown(finalDate, function(event) { 1375 $this.html(event.strftime(formatter)); 1376 }); 1377 }); 1378 } 1379 1380 creativa_loprd_countdown(); 1381 1382 function creativa_rowEqualHeight(container, column) { 1383 $(container).each(function(){ 1384 var vcCol = $(this).find(column); 1385 1386 var maxHeight = -1, 1387 i = 0; 1388 1389 vcCol.each(function() { 1390 vcCol.css('min-height', ''); 1391 var height = $(this)[0].getBoundingClientRect().height; 1392 i++; 1393 maxHeight = height > maxHeight ? height : maxHeight; 1394 }); 1395 1396 if (Modernizr.mq('(min-width: 991px)') && i > 1) { 1397 if ($(column).closest('.vc_column-table').length) { 1398 vcCol.css('height', maxHeight); 1399 } else { 1400 vcCol.css('min-height', maxHeight); 1401 } 1402 } else { 1403 vcCol.css('min-height', ''); 1404 } 1405 }) 1406 } 1407 1408 creativa_rowEqualHeight('.vc_row_common-height', '.vc_column-inner'); 1409 creativa_rowEqualHeight('.vc_inner_common-height', '.vc_inner_column-inner'); 1410 $('.vc_row_common-height, .vc_inner_common-height').on("mresize load", function(){ 1411 creativa_rowEqualHeight('.vc_row_common-height', '.vc_column-inner'); 1412 creativa_rowEqualHeight('.vc_inner_common-height', '.vc_inner_column-inner'); 1413 }) 1414 1415 // VC Shortcodes 1416 function creativa_vcPieChart() { 1417 $('.loprd-pie-chart').each(function(){ 1418 $(this).waypoint(function() { 1419 var $this = $(this), 1420 pieValAttr = $this.attr('data-value'), 1421 pieVal = pieValAttr * 0.01, 1422 pieDur = $this.attr('data-duration'), 1423 pieBg = $this.attr('data-colorbg'), 1424 pieSize = $this.attr('data-size'), 1425 pieThick = $this.attr('data-thickness'), 1426 pieFill = $this.attr('data-fill'), 1427 pieCol1 = $this.attr('data-color1'), 1428 pieCol2 = $this.attr('data-color2'), 1429 showUnit = $this.attr('data-unit'), 1430 pieFillColor = '', 1431 appUnit = ''; 1432 1433 if (pieFill == 'gradient') { 1434 pieFillColor = { gradient: [""+pieCol2+"", ""+pieCol1+""] }; 1435 } 1436 else if (pieFill == 'color') { 1437 pieFillColor = { color: ""+pieCol1+"" }; 1438 } 1439 1440 if (showUnit == 'true') { 1441 appUnit = '<i>%</i>'; 1442 } 1443 1444 $(this).circleProgress({ 1445 value: pieVal, 1446 size: +pieSize, 1447 thickness: +pieThick, 1448 animation: { 1449 duration: +pieDur, 1450 ease: "circleProgressEase" 1451 }, 1452 startAngle: 11, 1453 emptyFill: pieBg, 1454 fill: pieFillColor, 1455 }).on('circle-animation-progress', function(event, progress) { 1456 $(this).find('.heading').html(parseInt(pieValAttr * progress) + appUnit); 1457 }); 1458 }, { triggerOnce: true, offset: '90%' }) 1459 }) 1460 } 1461 1462 creativa_vcPieChart(); 1463 1464 function creativa_progressBar() { 1465 jQuery('.vc_progress_bar').waypoint(function () { 1466 jQuery(this).find('.vc_single_bar').each(function (index) { 1467 var $this = jQuery(this), 1468 bar = $this.find('.vc_bar'), 1469 val = bar.data('percentage-value'); 1470 1471 setTimeout(function () { 1472 bar.css({"width":val + '%'}); 1473 }, index * 200); 1474 }); 1475 }, { triggerOnce: true, offset:'90%' }); 1476 } 1477 1478 creativa_progressBar(); 1479 1480 function vc_waypoints() { 1481 if (typeof jQuery.fn.waypoint !== 'undefined') { 1482 jQuery('.wpb_animate_when_almost_visible:not(.wpb_start_animation)').waypoint(function () { 1483 jQuery(this).addClass('wpb_start_animation'); 1484 }, { triggerOnce: true, offset:'90%' }); 1485 } 1486 } 1487 1488 vc_waypoints(); 1489 1490 if ($('body').hasClass('error404')) { 1491 !function(e,t){"use strict";function o(r,a){this!==e&&this!==t&&(a=r,r=this),a=a||{};for(var i=0;i<r.length;++i)n(r[i],a);return d||(a.followMouse!==!1&&a.angle===t&&(document.body.addEventListener("mousemove",o.frame),d=!0),e.addEventListener("resize",o.update)),o.frame(),r}function n(e,o){var n=f(e);e={node:e,x:n.x,y:n.y,c:e.getAttribute("data-shadow-color")||o.color,inset:o.inset?"inset":"",inverse:o.inverse?-1:1},o.angle!==t?e.angle=o.angle:(o.pageX!==t&&(e.pageX=o.pageX),o.pageY!==t&&(e.pageY=o.pageY)),e.type=o.type,"drop"===o.type?(p===t&&(p=s("webkit")),e.length=o.length||4,e.opacity=o.opacity||.2):(e.length=o.length||7,e.opacity=o.opacity||.05),"flat"===o.style&&(e.style=o.style,e.length=o.length||40,e.opacity=o.opacity||1),y.push(e)}function r(e,t,o){for(var n,r=new Array(e.length-1),a=Math.cos(t),i=Math.sin(t),l=1;l<e.length;++l)n=("flat"===e.style?l:Math.pow(l,o))*e.inverse,r[l-1]=(n*i|0)+"px "+(n*a|0)+"px "+("flat"===e.style?0:0|Math.pow(l,1.7))+"px rgba("+(e.c||"0,0,0")+","+e.opacity+")"+e.inset;"drop"===e.type?e.node.style.webkitFilter="drop-shadow("+r.join(") drop-shadow(")+")":e.node.style["text"===e.type?"textShadow":"boxShadow"]=r.join(",")}function a(e,t,o,n){if(!e.filter){var r="real-shadow-"+Math.random().toString(36).substr(2),a=(new DOMParser).parseFromString(i(r),"application/xml");e.filter={offset:a.getElementsByTagName("feOffset")[0],blur:a.getElementsByTagName("feGaussianBlur")[0],color:a.getElementsByTagName("feFlood")[0]},document.body.appendChild(a.children[0]),e.node.style.filter="url
1491(#"+r+")"}e.filter.offset.setAttribute("dx",l(t)),e.filter.offset.setAttribute("dy",l(o)),e.filter.blur.setAttribute("stdDeviation",2*n),e.filter.color.setAttribute("flood-color","rgba(0,0,0,"+(.6-n/8)+")")}function i(e){return'<svg height="0" xmlns="http://www.w3.org/2000/svg"><filter id="'+e+'"><feGaussianBlur in="SourceAlpha"/><feOffset result="b"/><feFlood/><feComposite in2="b" operator="in"/><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter></svg>'}function l(e){var t=0===e?0:0>e?1:-1;return t*Math.pow(Math.abs(e),1/3)}function s(e){e=e?"-"+e+"-":"";var t=document.createElement("div");return t.style.cssText=e+"filter:drop-shadow(0 0 0 #000)",t.style.length>0}function f(e){var t=e.clientWidth>>1,o=e.clientHeight>>1;do t+=e.offsetLeft,o+=e.offsetTop;while(e=e.offsetParent);return{x:t,y:o}}var d,p,u=2.3,g=.8,h=1/1500,c=Math.PI,y=[];o.reset=function(){y=[],document.body.removeEventListener("mousemove",o.frame),e.removeEventListener("resize",o.update),d=!1},o.update=function(){for(var e,t=y.length;t--;){e=y[t];var n=f(e.node);e.x=n.x,e.y=n.y}o.frame()},o.frame=function(o){o||(o={pageX:e.innerWidth>>1,pageY:0});for(var n,i=y.length;i--;){n=y[i];var l=(n.pageX===t?o.pageX:n.pageX)-n.x,s=(n.pageY===t?o.pageY:n.pageY)-n.y,f=Math.pow(l*l+s*s,g)*h+1;f>u&&(f=u),"drop"!==n.type||p?r(n,n.angle===t?Math.atan2(l,s)-c:n.angle,f):a(n,l,s,f)}};var m=!1;"function"==typeof e.jQuery&&($.fn.realshadow=o,m=!0),"function"==typeof define&&define.amd&&(define(function(){return o}),m=!0),"undefined"!=typeof module&&module.exports&&(module.exports=o,m=!0),m||(e.realshadow=o)}(window); 1492 $(".fof-number").realshadow({type: 'text', opacity: .04, length: 5}); 1493 } 1494 1495 function creativa_footerFixed() { 1496 if ($('body').hasClass('footer--fixed')) { 1497 var $footer = $('#footer-wrapper'), 1498 $content = $('.content-wrapper'), 1499 footerHeight = $footer.height(); 1500 1501 $content.css('margin-bottom', footerHeight); 1502 } 1503 } 1504 1505 creativa_footerFixed(); 1506 1507 $(window).resize(function(){ 1508 creativa_footerFixed(); 1509 }) 1510 1511 1512 $('.vc_ytvm_video').each(function(){ 1513 var videoUrl = $(this).data('video-url'); 1514 1515 $(this).okvideo({ 1516 video: videoUrl, 1517 hd: true, 1518 annotations: false, 1519 volume: 0, 1520 loop: true, 1521 captions: false, 1522 adproof: true, 1523 }) 1524 }) 1525 1526 //full width layouts - sidebar height 1527 function creativa_fullWidthSidebarHeight() { 1528 var sidebarWrap = $('.blog-width-full .sidebar-wrap, .shop__width-full .sidebar-wrap'); 1529 1530 if (sidebarWrap.length) { 1531 var contentHeight = $('.blog-width-full .sidebar-content, .shop__width-full .sidebar-content').outerHeight(); 1532 1533 sidebarWrap.css('min-height', contentHeight); 1534 } 1535 } 1536 1537 $(window).on('load scroll', function(){ 1538 creativa_fullWidthSidebarHeight(); 1539 }) 1540 1541 1542 // // Visual Composer FrontEnd 1543 $(window).load(function() { 1544 creativa_blogMasonry(); 1545 }) 1546 1547 1548 function creativa_creativaShortcodeAnimation() { 1549 if ( 'undefined' !== typeof(jQuery.fn.waypoint ) ) { 1550 var $animationContainer = $( '.creativa_shortcode_animation:not(.creativa_animation_start)' ); 1551 1552 $animationContainer.each(function(){ 1553 var animation = $(this), 1554 animDelay = 0, 1555 animDelayValue = animation.data('animation-delay'); 1556 1557 if (typeof animDelayValue !== typeof undefined && animDelayValue !== false) { 1558 animDelay = animDelayValue; 1559 } 1560 1561 animation.waypoint(function(){ 1562 setTimeout(function(){ 1563 animation.addClass( 'creativa_animation_start' ); 1564 }, animDelay); 1565 }, {triggerOnce: true, offset: '85%'}) 1566 }) 1567 } 1568 } 1569 1570 creativa_creativaShortcodeAnimation(); 1571 1572 1573})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.