1//Global var 2var CRUMINA = {}; 3 4(function ($) { 5 6 // USE STRICT 7 "use strict"; 8 9 //----------------------------------------------------/ 10 // Predefined Variables 11 //----------------------------------------------------/ 12 var $window = $(window), 13 $document = $(document), 14 $body = $('body'), 15 16 swipers = {}, 17 //Elements 18 $header = $('#site-header'), 19 $nav = $('#primary-menu'), 20 $header_space = $header.next('.header-spacer'), 21 $counter = $('.counter'), 22 $progress_bar = $('.skills-item'), 23 $pie_chart = $('.pie-chart'), 24 $animatedIcons = $('.js-animate-icon'), 25 $asidePanel = $('.right-menu'), 26 $primaryMenu = $('.primary-menu'), 27 $subscribe_section = $('#subscribe-section'), 28 $footer = $('#site-footer'); 29 30 31 var $popupSearch = $(".popup-search"); 32 var $cartPopap = $(".cart-popup-wrap"); 33 34 35 /* ----------------------- 36 * Fixed Header 37 * --------------------- */ 38 39 40 41 CRUMINA.fixedHeader = function () { 42 $header.headroom( 43 { 44 "offset": 50, 45 "tolerance": 5, 46 "classes": { 47 "initial": "animated", 48 "pinned": "swingInX", 49 "unpinned": "swingOutX" 50 }, 51 onUnpin: function () { 52 if ($nav.find('.sub-menu, .megamenu').hasClass('drop-up')) { 53 this.elem.classList.remove(this.classes.unpinned); 54 this.elem.classList.add(this.classes.pinned); 55 } 56 else { 57 this.elem.classList.add(this.classes.unpinned); 58 this.elem.classList.remove(this.classes.pinned); 59 } 60 } 61 } 62 ) 63 }; 64 65 /* ----------------------- 66 * Parallax footer 67 * --------------------- */ 68 69 CRUMINA.parallaxFooter = function () { 70 if ($footer.length && $footer.hasClass('js-fixed-footer')) { 71 $footer.before('<div class="block-footer-height"></div>'); 72 $('.block-footer-height').matchHeight({ 73 target: $footer 74 }); 75 } 76 }; 77 78 /* ----------------------- 79 * COUNTER NUMBERS 80 * --------------------- */ 81 CRUMINA.counters = function () { 82 if ($counter.length) { 83 $counter.each(function () { 84 $(this).waypoint(function () { 85 $(this.element).find('span').countTo(); 86 }, {offset: '95%'}); 87 }); 88 } 89 }; 90 91 /* ----------------------- 92 * Progress bars Animation 93 * --------------------- */ 94 CRUMINA.progresBars = function () { 95 if ($progress_bar.length) { 96 $progress_bar.each(function () { 97 $(this).find('.skills-item-meter-active').addClass('item-fully-transparent'); 98 // $(this).waypoint(function () { 99 $(this).find('.count-animate').countTo(); 100 $(this).find('.skills-item-meter-active').fadeTo(300, 1).addClass('skills-animate').removeClass('item-fully-transparent'); 101 // }, {offset: '90%'}); 102 }); 103 } 104 }; 105 106 /* ----------------------- 107 * Pie chart Animation 108 * --------------------- */ 109 CRUMINA.pieCharts = function () { 110 if ($pie_chart.length) { 111 $pie_chart.each(function () { 112 // $(this).waypoint(function () { 113 var current_cart = $(this); 114 var startColor = current_cart.data('startcolor'); 115 var endColor = current_cart.data('endcolor'); 116 var counter = current_cart.data('value') * 100; 117 118 current_cart.circleProgress({ 119 thickness: 16, 120 size: 320, 121 startAngle: -Math.PI / 4 * 2, 122 emptyFill: '#fff', 123 lineCap: 'round', 124 fill: { 125 gradient: [endColor,startColor], 126 gradientAngle: Math.PI / 4 127 } 128 }).on('circle-animation-progress', function (event, progress) { 129 current_cart.find('.content').html(parseInt(counter * progress, 10) + '<span>%</span>' 130 ) 131 }); 132 // this.destroy(); 133 134 //}, {offset: '90%'}); 135 }); 136 } 137 }; 138 /* ----------------------- 139 * Animate SVG Icons 140 * --------------------- */ 141 CRUMINA.animateSvg = function () { 142 if ($animatedIcons.length) { 143 $animatedIcons.each(function () { 144 $(this).waypoint(function () { 145 var mySVG = $(this.element).find('> svg').drawsvg(); 146 mySVG.drawsvg('animate'); 147 // this.destroy(); 148 }, {offset: '95%'}); 149 }); 150 } 151 }; 152 /* ----------------------- 153 * Run Chart js module 154 * --------------------- */ 155 CRUMINA.chartJs = function () { 156 $('.chart-js-run').each(function () { 157 $(this).waypoint(function () { 158 var $wrapper = $(this.element); 159 var el_id = $wrapper.data('id');
160 var dataholder = $wrapper.find('.chart-data'); 161 var ctx = document.getElementById(el_id); 162 var myChart = new Chart(ctx, { 163 type: $wrapper.data('type'), 164 data: { 165 labels: dataholder.data('labels'), 166 datasets: [ 167 { 168 data: dataholder.data('numbers'), 169 backgroundColor: dataholder.data('colors') 170 }] 171 }, 172 options: { 173 legend: { 174 display: false 175 } 176 }, 177 animation: { 178 animateScale: true 179 } 180 }); 181 this.destroy(); 182 }, {offset: '75%'}); 183 }); 184 }; 185 186 CRUMINA.runchartJS = function ( $wrapper ) { 187 var el_id = $wrapper.data('id'); 188 var dataholder = $wrapper.find('.chart-data'); 189 var ctx = document.getElementById(el_id); 190 var myChart = new Chart(ctx, { 191 type: $wrapper.data('type'), 192 data: { 193 labels: dataholder.data('labels'), 194 datasets: [ 195 { 196 data: dataholder.data('numbers'), 197 backgroundColor: dataholder.data('colors') 198 }] 199 }, 200 options: { 201 legend: { 202 display: false 203 } 204 }, 205 animation: { 206 animateScale: true 207 } 208 }); 209 }; 210 CRUMINA.runTimeLine = function () { 211 $('.cd-horizontal-timeline').each(function () { 212 $(this).horizontalTimeline(); 213 }); 214 }; 215 /* ----------------------------- 216 * Custom Scroll bar 217 * ---------------------------*/ 218 CRUMINA.customScroll = function () { 219 if ($asidePanel.length) { 220 $asidePanel.mCustomScrollbar({ 221 axis: "y", 222 scrollEasing: "linear", 223 scrollInertia: 150 224 }); 225 } 226 }; 227 228 229 //top bar 230 $('.top-bar-close').on('click', function () { 231 $('.top-bar').removeClass('open'); 232 $body.removeClass('overlay-enable'); 233 return false; 234 }); 235 236 $("#top-bar-js").on('click', function () { 237 $header.siblings('.top-bar').addClass('open'); 238 $body.addClass('overlay-enable'); 239 return false; 240 }); 241 242 $("#top-bar-language").on('change', function () { 243 var lang_href = jQuery(jQuery(this).children('[value=' + $(this).val() + ']')).data('url'); 244 if (lang_href) { 245 document.location.href = lang_href; 246 } 247 }); 248 249 /* ----------------------------- 250 * Toggle aside panel on click 251 * ---------------------------*/ 252 CRUMINA.togglePanel = function () { 253 if ($asidePanel.length) { 254 $asidePanel.toggleClass('opened'); 255 $body.toggleClass('overlay-enable'); 256 } 257 }; 258 /* ----------------------------- 259 * Toggle search overlay 260 * ---------------------------*/ 261 CRUMINA.toggleSearch = function () { 262 $body.toggleClass('open'); 263 $('.overlay_search-input').focus(); 264 }; 265 /* ----------------------------- 266 * Embedded Video in pop up 267 * ---------------------------*/ 268 CRUMINA.mediaPopups = function () { 269 $('.js-popup-iframe').magnificPopup({ 270 disableOn: 700, 271 type: 'iframe', 272 mainClass: 'mfp-fade', 273 removalDelay: 160, 274 preloader: false, 275 276 fixedContentPos: false 277 }); 278 $('.js-zoom-image, .link-image').magnificPopup({ 279 type: 'image', 280 removalDelay: 500, //delay removal by X to allow out-animation 281 callbacks: { 282 beforeOpen: function () { 283 // just a hack that adds mfp-anim class to markup 284 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 285 this.st.mainClass = 'mfp-zoom-in'; 286 } 287 }, 288 closeOnContentClick: true, 289 midClick: true 290 }); 291 $('.js-zoom-gallery').each(function () { 292 $(this).magnificPopup({ 293 delegate: 'a[data-lightbox="gallery-item"]', 294 type: 'image', 295 gallery: { 296 enabled: true 297 }, 298 removalDelay: 500, //delay removal by X to allow out-animation 299 callbacks: { 300 beforeOpen: function () { 301 // just a hack that adds mfp-anim class to markup 302 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 303 this.st.mainClass = 'mfp-zoom-in'; 304 } 305 }, 306 closeOnContentClick: true, 307 midClick: true 308 }); 309 }); 310 $('.js-open-video').magnificPopup({ 311 type: 'inline', 312 mainClass: 'inline--media-content overlay active animation-wrapper', // this class is for CSS animation below 313 zoom: { 314 enabled: true, // By default it's false, so don't forget to enable it 315 duration: 300, // duration of the effect, in milliseconds 316 easing: 'ease-in-out' // CSS transition easing function 317 }, 318 callbacks: { 319 open: function () { 320 var player = $(this.content).find('.plyr'); 321 if ('oembed' != player.data('source')) { 322 player[0].plyr.play(); 323 } 324 }, 325 close: function () { 326 var player = $(this.content).find('.plyr'); 327 if ('oembed' != player.data('source')) { 328 player[0].plyr.restart(); 329 player[0].plyr.pause(); 330 } 331 } 332 } 333 }); 334 }; 335 /* ----------------------------- 336 * Equal height 337 * ---------------------------*/ 338 CRUMINA.equalHeight = function () { 339 $('.js-equal-child').find('.theme-module').matchHeight({ 340 property: 'min-height' 341 }); 342 }; 343 344 /* -----------------------------
345 * Scrollmagic scenes animation 346 * ---------------------------*/ 347 CRUMINA.SubscribeScrollAnnimation = function () { 348 var controller = new ScrollMagic.Controller(); 349 new ScrollMagic.Scene({triggerElement: "#subscribe-section"}) 350 .setVelocity(".gear", {opacity: 1, rotateZ: "360deg"}, 1200) 351 .triggerHook("onEnter") 352 .addTo(controller); 353 354 new ScrollMagic.Scene({triggerElement: "#subscribe-section"}) 355 .setVelocity(".mail", {opacity: 1, bottom: "0"}, 600) 356 .triggerHook(0.8) 357 .addTo(controller); 358 359 new ScrollMagic.Scene({triggerElement: "#subscribe-section"}) 360 .setVelocity(".mail-2", {opacity: 1, right: "20"}, 800) 361 .triggerHook(0.9) 362 .addTo(controller); 363 }; 364 365 CRUMINA.SeoScoreScrollAnnimation = function () { 366 var controller = new ScrollMagic.Controller(); 367 368 new ScrollMagic.Scene({triggerElement: ".crumina-seo-score"}) 369 .setVelocity(".crumina-seo-score .seoscore1", {opacity: 1, top: "-10"}, 400) 370 .triggerHook("onEnter") 371 .addTo(controller); 372 373 new ScrollMagic.Scene({triggerElement: ".crumina-seo-score"}) 374 .setVelocity(".crumina-seo-score .seoscore2", {opacity: 1, bottom: "0"}, 800) 375 .triggerHook(0.7) 376 .addTo(controller); 377 378 new ScrollMagic.Scene({triggerElement: ".crumina-seo-score"}) 379 .setVelocity(".crumina-seo-score .seoscore3", {opacity: 1, bottom: "0"}, 1000) 380 .triggerHook(0.8) 381 .addTo(controller); 382 }; 383 384 CRUMINA.TestimonialScrollAnnimation = function () { 385 var controller = new ScrollMagic.Controller(); 386 387 new ScrollMagic.Scene({triggerElement: ".crumina-testimonial-slider"}) 388 .setVelocity(".crumina-testimonial-slider .testimonial2", {opacity: 1, bottom: "-50"}, 400) 389 .triggerHook(0.6) 390 .addTo(controller); 391 392 new ScrollMagic.Scene({triggerElement: ".crumina-testimonial-slider"}) 393 .setVelocity(".crumina-testimonial-slider .testimonial1", {opacity: 1, top: "20"}, 600) 394 .triggerHook(1) 395 .addTo(controller); 396 }; 397 398 CRUMINA.OurVisionScrollAnnimation = function () { 399 var controller = new ScrollMagic.Controller(); 400 401 new ScrollMagic.Scene({triggerElement: ".crumina-our-vision"}) 402 .setVelocity(".crumina-our-vision .elements", {opacity: 1}, 600) 403 .triggerHook(0.6) 404 .addTo(controller); 405 406 new ScrollMagic.Scene({triggerElement: ".crumina-our-vision"}) 407 .setVelocity(".crumina-our-vision .eye", {opacity: 1, bottom: "-90"}, 1000) 408 .triggerHook(1) 409 .addTo(controller); 410 }; 411 412 CRUMINA.MountainsScrollAnnimation = function () { 413 var controller = new ScrollMagic.Controller(); 414 415 new ScrollMagic.Scene({triggerElement: ".crumina-background-mountains"}) 416 .setVelocity(".crumina-background-mountains .mountain1", { 417 opacity: 1, 418 bottom: "0", 419 paddingBottom: "10%" 420 }, 800) 421 .triggerHook(0.4) 422 .addTo(controller); 423 424 new ScrollMagic.Scene({triggerElement: ".crumina-background-mountains"}) 425 .setVelocity(".crumina-background-mountains .mountain2", {opacity: 1, bottom: "0"}, 800) 426 .triggerHook(0.3) 427 .addTo(controller); 428 }; 429 /* ----------------------------- 430 * Isotope sorting 431 * ---------------------------*/ 432 433 CRUMINA.IsotopeSort = function () { 434 var $container = $('.sorting-container'); 435 $container.each(function () { 436 var $current = $(this); 437 var layout = ($current.data('layout').length) ? $current.data('layout') : 'masonry'; 438 $current.isotope({ 439 itemSelector: '.sorting-item', 440 layoutMode: layout, 441 percentPosition: true 442 }); 443 444 $current.imagesLoaded().progress(function () { 445 $current.isotope('layout'); 446 }); 447 448 var $sorting_buttons = $current.siblings('.sorting-menu').find('li'); 449 450 $sorting_buttons.each(function () { 451 var selector = $(this).data('filter'); 452 var count = $container.find(selector).length; 453 if (count == 0) { 454 $(this).css('display', 'none'); 455 } 456 }); 457 if ($sorting_buttons.filter(':visible').length < 2 ){ 458 $container.siblings('.sorting-menu').hide(); 459 } 460 461 $sorting_buttons.on('click', function () { 462 if ($(this).hasClass('active')) return false;
463 $(this).parent().find('.active').removeClass('active'); 464 $(this).addClass('active'); 465 var filterValue = $(this).data('filter'); 466 if (typeof filterValue != "undefined") { 467 $current.isotope({filter: filterValue}); 468 return false; 469 } 470 }); 471 }); 472 }; 473 474 /* ----------------------------- 475 * Sliders and Carousels 476 * ---------------------------*/ 477 478 CRUMINA.initSwiper = function () { 479 var initIterator = 0; 480 var $breakPoints = false; 481 $('.swiper-container').each(function () { 482 483 var $t = $(this); 484 var index = 'swiper-unique-id-' + initIterator; 485 486 $t.addClass('swiper-' + index + ' initialized').attr('id', index); 487 $t.find('.swiper-pagination').addClass('pagination-' + index); 488 489 var $effect = ($t.data('effect')) ? $t.data('effect') : 'slide', 490 $crossfade = ($t.data('crossfade')) ? $t.data('crossfade') : true, 491 $loop = ($t.data('loop') == false) ? $t.data('loop') : true, 492 $showItems = ($t.data('show-items')) ? $t.data('show-items') : 1, 493 $scrollItems = ($t.data('scroll-items')) ? $t.data('scroll-items') : 1, 494 $scrollDirection = ($t.data('direction')) ? $t.data('direction') : 'horizontal', 495 $mouseScroll = ($t.data('mouse-scroll')) ? $t.data('mouse-scroll') : false, 496 $parallax = ($t.data('parallax')) ? $t.data('parallax') : false, 497 $autoplay = ($t.data('autoplay')) ? parseInt($t.data('autoplay'), 10) : 0, 498 $slidesSpace = ($showItems > 1) ? 20 : 0; 499 500 if ($showItems > 1) { 501 $breakPoints = { 502 480: { 503 slidesPerView: 1, 504 slidesPerGroup: 1 505 }, 506 768: { 507 slidesPerView: 2, 508 slidesPerGroup: 2 509 } 510 } 511 } else { 512 $breakPoints = { 513 768: { 514 slidesPerView: 1, 515 slidesPerGroup: 1 516 } 517 } 518 } 519 520 swipers['swiper-' + index] = new Swiper('.swiper-' + index, { 521 pagination: '.pagination-' + index, 522 paginationClickable: true, 523 direction: $scrollDirection, 524 mousewheelControl: $mouseScroll, 525 mousewheelReleaseOnEdges: $mouseScroll, 526 slidesPerView: $showItems, 527 slidesPerGroup: $scrollItems, 528 spaceBetween: $slidesSpace, 529 keyboardControl: true, 530 preloadImages: true, 531 updateOnImagesReady: true, 532 autoplay: $autoplay, 533 loop: $loop, 534 breakpoints: $breakPoints, 535 effect: $effect, 536 fade: { 537 crossFade: true 538 }, 539 parallax: $parallax, 540 calculateHeight: true, 541 onImagesReady: function (swiper) { 542 CRUMINA.resizeSwiper(swiper); 543 }, 544 onTransitionStart: function (swiper) { 545 CRUMINA.resizeSwiper(swiper); 546 }, 547 onSlideChangeStart: function (swiper) { 548 if ($t.find('.slider-slides').length) { 549 $t.find('.slider-slides .slide-active').removeClass('slide-active'); 550 var realIndex = swiper.slides.eq(swiper.activeIndex).attr('data-swiper-slide-index'); 551 $t.find('.slider-slides .slides-item').eq(realIndex).addClass('slide-active'); 552 } 553 } 554 555 }); 556 initIterator++; 557 }); 558 559 //swiper arrows 560 $('.btn-prev').on('click', function () { 561 swipers['swiper-' + $(this).parent().attr('id')].slidePrev(); 562 }); 563 564 $('.btn-next').on('click', function () { 565 swipers['swiper-' + $(this).parent().attr('id')].slideNext(); 566 }); 567 568 //swiper tabs 569 $('.slider-slides .slides-item').on('click', function () { 570 if ($(this).hasClass('slide-active')) return false;
571 var activeIndex = $(this).parent().find('.slides-item').index(this); 572 swipers['swiper-' + $(this).closest('.swiper-container').attr('id')].slideTo(activeIndex + 1); 573 $(this).parent().find('.slide-active').removeClass('slide-active'); 574 $(this).addClass('slide-active'); 575 576 return false; 577 578 }); 579 }; 580 581 CRUMINA.resizeSwiper = function (swiper) { 582 swiper = (swiper) ? swiper : $(this)[0].swiper; 583 584 var activeSlideHeight = swiper.slides.eq(swiper.activeIndex).find('> *').outerHeight(); 585 586 if ($(swiper.container).hasClass('pagination-vertical')){ 587 var headlineHeights = swiper.slides.map(function() { 588 return $(this).find('> *').height(); 589 }).get(); 590 591 var maxHeadLineHeight = Math.max.apply(Math, headlineHeights); 592 swiper.container.css({height: maxHeadLineHeight + 'px'}); 593 swiper.update(true) 594 } 595 596 if ($(swiper.container).hasClass('auto-height')){ 597 swiper = (swiper) ? swiper : $(this)[0].swiper; 598 swiper.container.css({height: activeSlideHeight + 'px'}); 599 swiper.onResize(); 600 } 601 602 $('.swiper-container.js-full-window').each(function () { 603 var $slider = $(this); 604 var $pagination = $slider.find(' > .slider-slides'), 605 $pagination_height = ($pagination.length) ? $pagination.height() : 0; 606 607 var winHei = $(window).height(); 608 $slider.css('min-height', winHei + 'px'); 609 if ($pagination_height > 0) { 610 $slider.css('paddingBottom', $pagination_height + 'px') 611 } 612 if ($header_space.length) { 613 var $heder_height = $header_space.height(); 614 } else { 615 $heder_height = 0; 616 } 617 $slider.css('min-height', winHei - $heder_height + 'px'); 618 $slider.find('> .swiper-wrapper').css('min-height', winHei - $pagination_height - $heder_height + 'px'); 619 }); 620 }; 621 622 623 CRUMINA.initSmoothScroll = function () { 624 625 // Cut the mustard 626 var supports = 'querySelector' in document && 'addEventListener' in window; 627 if (!supports) return; 628 629 // Get all Toggle selectors 630 var anchors = $('#primary-menu a[href*=\\#], .btn[href*=\\#]').filter(function () { 631 return $(this).is(":not([href=\\#])"); 632 }); 633 634 // Add smooth scroll to all anchors 635 for (var i = 0, len = anchors.length; i < len; i++) { 636 var url = new RegExp(window.location.hostname + window.location.pathname); 637 if (!url.test(anchors[i].href)) continue; 638 anchors[i].setAttribute('data-scroll', true); 639 } 640 641 if ( window.location.hash ) { 642 var anchor = document.querySelector( window.location.hash ); // Get the anchor 643 var toggle = document.querySelector( 'a[href*="' + window.location.hash + '"]' ); // Get the toggle (if one exists) 644 var options = {}; // Any custom options you want to use would go here 645 smoothScroll.animateScroll( anchor, toggle, options ); 646 } 647 648 smoothScroll.init({ 649 selector: '[data-scroll]', 650 speed: 500, // Integer. How fast to complete the scroll in milliseconds 651 easing: 'easeOutQuad', // Easing pattern to use 652 offset: $header.height(), 653 updateURL: true, // Boolean. If true, update the URL hash on scroll 654 callback: function (anchor, toggle) { 655 } // Function to run after scrolling 656 }); 657 658 $('#primary-menu').find('[href=\\#]').on('click',function () { 659 return false 660 }) 661 662 }; 663 664 CRUMINA.initVideo = function () { 665 plyr.setup('.plyr'); 666 }; 667 668 CRUMINA.burgerAnimation = function () { 669 /* In animations (to close icon) */ 670 671 var beginAC = 80, 672 endAC = 320, 673 beginB = 80, 674 endB = 320; 675 676 function inAC(s) { 677 s.draw('80% - 240', '80%', 0.3, { 678 delay: 0.1, 679 callback: function () { 680 inAC2(s) 681 } 682 }); 683 } 684
685 function inAC2(s) { 686 s.draw('100% - 545', '100% - 305', 0.6, { 687 easing: ease.ease('elastic-out', 1, 0.3) 688 }); 689 } 690 691 function inB(s) { 692 s.draw(beginB - 60, endB + 60, 0.1, { 693 callback: function () { 694 inB2(s) 695 } 696 }); 697 } 698 699 function inB2(s) { 700 s.draw(beginB + 120, endB - 120, 0.3, { 701 easing: ease.ease('bounce-out', 1, 0.3) 702 }); 703 } 704 705 /* Out animations (to burger icon) */ 706 707 function outAC(s) { 708 s.draw('90% - 240', '90%', 0.1, { 709 easing: ease.ease('elastic-in', 1, 0.3), 710 callback: function () { 711 outAC2(s) 712 } 713 }); 714 } 715 716 function outAC2(s) { 717 s.draw('20% - 240', '20%', 0.3, { 718 callback: function () { 719 outAC3(s) 720 } 721 }); 722 } 723 724 function outAC3(s) { 725 s.draw(beginAC, endAC, 0.7, { 726 easing: ease.ease('elastic-out', 1, 0.3) 727 }); 728 } 729 730 function outB(s) { 731 s.draw(beginB, endB, 0.7, { 732 delay: 0.1, 733 easing: ease.ease('elastic-out', 2, 0.4) 734 }); 735 } 736 737 /* Scale functions */ 738 739 function addScale(m) { 740 m.className = 'menu-icon-wrapper scaled'; 741 } 742 743 function removeScale(m) { 744 m.className = 'menu-icon-wrapper'; 745 } 746 747 /* Awesome burger scaled */ 748 749 var pathD = document.getElementById('pathD'), 750 pathE = document.getElementById('pathE'), 751 pathF = document.getElementById('pathF'), 752 segmentD = new Segment(pathD, beginAC, endAC), 753 segmentE = new Segment(pathE, beginB, endB), 754 segmentF = new Segment(pathF, beginAC, endAC), 755 wrapper2 = document.getElementById('menu-icon-wrapper'), 756 trigger2 = document.getElementById('menu-icon-trigger'), 757 toCloseIcon2 = true; 758 759 wrapper2.style.visibility = 'visible'; 760
761 trigger2.onclick = function () { 762 addScale(wrapper2); 763 if (toCloseIcon2) { 764 inAC(segmentD); 765 inB(segmentE); 766 inAC(segmentF); 767 } else { 768 outAC(segmentD); 769 outB(segmentE); 770 outAC(segmentF); 771 772 } 773 toCloseIcon2 = !toCloseIcon2; 774 setTimeout(function () { 775 removeScale(wrapper2) 776 }, 450); 777 }; 778 }; 779 780 781 /* ----------------------------- 782 * On Click Functions 783 * ---------------------------*/ 784 785 786 $window.keydown(function (eventObject) { 787 if (eventObject.which == 27) { 788 if ($asidePanel.hasClass('opened')) { 789 CRUMINA.togglePanel(); 790 } 791 if ($body.hasClass('open')) { 792 CRUMINA.toggleSearch(); 793 } 794 } 795 }); 796 797 jQuery(".js-close-aside").on('click', function () { 798 if ($asidePanel.hasClass('opened')) { 799 CRUMINA.togglePanel(); 800 } 801 return false; 802 }); 803 804 jQuery(".js-open-aside").on('click', function () { 805 if (!$asidePanel.hasClass('opened')) { 806 CRUMINA.togglePanel(); 807 } 808 return false; 809 }); 810 811 jQuery(".js-open-search").on('click', function (event) { 812 console.log('open'); 813 CRUMINA.toggleSearch(); 814 return false; 815 }); 816 817 jQuery(".overlay_search-close").on('click', function () { 818 $body.removeClass('open'); 819 return false; 820 }); 821 822 jQuery(".js-open-p-search").on('click', function () { 823 $popupSearch.fadeToggle(); 824 }); 825 826 if ($popupSearch.length) { 827 $popupSearch.find('input').focus(function () { 828 $popupSearch.stop().animate({ 829 'width': $popupSearch.closest('.container').width() + 70 830 }, 600) 831 }).blur(function () { 832 $popupSearch.fadeToggle('fast', function () { 833 $popupSearch.css({ 834 'width': '' 835 }); 836 }); 837 838 }); 839 } 840 841 // Hide cart on click outside. 842 $document.on('click', function (event) { 843 if (!$(event.target).closest($cartPopap).length) { 844 if ($cartPopap.hasClass('visible')) { 845 $cartPopap.fadeToggle(200); 846 $cartPopap.toggleClass('visible') 847 } 848 } 849 if (!$(event.target).closest($asidePanel).length) { 850 if ($asidePanel.hasClass('opened')) { 851 CRUMINA.togglePanel(); 852 } 853 } 854 855 }); 856 857 // Show sub-menu cart on icon click. 858 $(".js-cart-animate").on('click', function (event) { 859 event.stopPropagation(); 860 $cartPopap.toggleClass('visible'); 861 $cartPopap.fadeToggle(200); 862 }); 863 864 //Remove play button on play in video player 865 $('.plyr').on('click', function () { 866 $(this).removeClass('hide-controls'); 867 }); 868 869 870 CRUMINA.quantity_selector_button_mod = function(){ 871 jQuery(".quantity input[type=number]").each(function() { 872 var number = jQuery(this), 873 max = parseFloat( number.attr( 'max' ) ), 874 min = parseFloat( number.attr( 'min' ) ), 875 step = parseInt( number.attr( 'step' ), 10 ), 876 newNum = jQuery(jQuery('<div />').append(number.clone(true)).html().replace('number','text')).insertAfter(number); 877 number.remove(); 878 879 setTimeout(function(){ 880 if(newNum.next('.quantity-plus').length == 0) { 881 var minus = jQuery('<input type="button" value="-" class="quantity-minus">').insertBefore(newNum), 882 plus = jQuery('<input type="button" value="+" class="quantity-plus">').insertAfter(newNum); 883 884 minus.on('click', function(){ 885 var the_val = parseInt( newNum.val(), 10 ) - step; 886 the_val = the_val < 0 ? 0 : the_val; 887 the_val = the_val < min ? min : the_val; 888 newNum.val(the_val); 889 enable_update_cart_button(); 890 }); 891 plus.on('click', function(){ 892 var the_val = parseInt( newNum.val(), 10 ) + step; 893 the_val = the_val > max ? max : the_val; 894 newNum.val(the_val); 895 enable_update_cart_button(); 896 }); 897 898 } 899 },10); 900 901 }); 902 }; 903 // since woocommerce 2.6 the update_cart button is disabeld by default and needs to be enabled if quantities change 904 function enable_update_cart_button(){ 905 var $update_cart_button = jQuery( 'table.shop_table.cart' ).closest( 'form' ).find( 'input[name="update_cart"]' ); 906 if ( $update_cart_button.length ) { 907 $update_cart_button.prop( 'disabled', false ); 908 } 909 } 910 // listen to updated_wc_div event since woocommerce 2.6 to redraw quantity selector and update the cart icon value 911 jQuery( document ).bind( "updated_wc_div", function() { 912 //setTimeout( update_cart_sub-menu, 1000 ); // high timeout needed because the minicard is drawn after the updated_wc_div event 913 CRUMINA.quantity_selector_button_mod(); 914 }); 915 916 /*--------------------------------- 917 Ajax Form Submit 918 -----------------------------------*/ 919 if ($('.fw_form_fw_form').length) { 920 fwForm.initAjaxSubmit({ 921 selector: 'form[data-fw-ext-forms-type="contact-forms"]' 922 923 // Open the script code and check the `opts` variable 924 // to see all options that you can overwrite/customize. 925 }); 926 } 927 928 929 /*--------------------------------- 930 ACCORDION 931 -----------------------------------*/ 932 $('.accordion-heading').on('click', function () { 933 $(this).parents('.panel-heading').toggleClass('active'); 934 $(this).parents('.accordion-panel').toggleClass('active'); 935 }); 936 CRUMINA.initAccordion = function (wrp) { 937 $(wrp).find('.accordion-heading') 938 .off('click') 939 .on('click', function () { 940 $(this).parents('.panel-heading').toggleClass('active'); 941 $(this).parents('.accordion-panel').toggleClass('active'); 942 }); 943 }; 944 945 //Scroll to top. 946 $('.back-to-top').on('click', function () { 947 $('html,body').animate({ 948 scrollTop: 0 949 }, 1200); 950 return false;
951 }); 952 953 $(".input-dark").find('input').focus(function () { 954 $(this).closest('form').addClass('input-drop-shadow'); 955 }).blur(function () { 956 $(this).closest('form').removeClass('input-drop-shadow'); 957 }); 958 959 /* ----------------------------- 960 * On DOM ready functions 961 * ---------------------------*/ 962 963 $document.ready(function () { 964 965 $(".input-text").each(function () { 966 $(this).addClass('input-standard-grey'); 967 }); 968 $(".crumina-module.list").each(function () { 969 var $this = $(this); 970 var $icon = $(this).data('icon'); 971 if ($icon.length){ 972 $this.find('li').wrapInner('<div class="ovh"></div>'); 973 $this.find('li').prepend('<i class="'+$icon+'"></i>'); 974 } 975 }); 976 977 if ($('#menu-icon-wrapper').length) { 978 CRUMINA.burgerAnimation(); 979 } 980 // 3-d party libs run 981 $primaryMenu.crumegamenu({ 982 showSpeed: 300, 983 hideSpeed: 200, 984 trigger: "hover", 985 animation: "drop-up", 986 indicatorFirstLevel: "", 987 indicatorSecondLevel: "" 988 }); 989 if ( ! $('#site-header').hasClass('absolute')) { 990 CRUMINA.fixedHeader(); 991 } 992 993 //dom modifcation 994 $('.nice-select').niceSelect(); 995 996 CRUMINA.initSwiper(); 997 CRUMINA.equalHeight(); 998 CRUMINA.customScroll(); 999 CRUMINA.mediaPopups(); 1000 CRUMINA.IsotopeSort(); 1001 CRUMINA.parallaxFooter(); 1002 CRUMINA.runTimeLine(); 1003 CRUMINA.initSmoothScroll(); 1004 CRUMINA.quantity_selector_button_mod(); 1005 1006 // On Scroll animations. 1007 CRUMINA.animateSvg(); 1008 CRUMINA.counters(); 1009 CRUMINA.progresBars(); 1010 CRUMINA.pieCharts(); 1011 CRUMINA.chartJs(); 1012 1013 1014 // Dom mofifications 1015 $('select.orderby, .variations select, .card-expiration select').niceSelect(); 1016 //$('select#billing_country, select#card_state').select2(); 1017 1018 // Row background animation 1019 if ($subscribe_section.length && $subscribe_section.hasClass('js-animated')) { 1020 CRUMINA.SubscribeScrollAnnimation(); 1021 } 1022 if ($('.crumina-seo-score').length) { 1023 CRUMINA.SeoScoreScrollAnnimation(); 1024 } 1025 if ($('.crumina-testimonial-slider').length) { 1026 CRUMINA.TestimonialScrollAnnimation(); 1027 } 1028 if ($('.crumina-our-vision').length) { 1029 CRUMINA.OurVisionScrollAnnimation(); 1030 } 1031 if ($('.crumina-background-mountains').length) { 1032 CRUMINA.MountainsScrollAnnimation(); 1033 } 1034 }); 1035 1036 $(window).on('load resize',function(){ 1037 if ( $window.width() > 769 ){ 1038 CRUMINA.fixedHeader(); 1039 $header.removeClass('headroom--not-bottom'); 1040 } else { 1041 $header.headroom("destroy"); 1042 } 1043 }) 1044})(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.