1/** 2 Core layout handlers and component wrappers 3 **/ 4 5// BEGIN: Layout Brand 6var LayoutBrand = function () { 7 8 return { 9 //main function to initiate the module 10 init: function () { 11 $('body').on('click', '.c-hor-nav-toggler', function () { 12 var target = $(this).data('target'); 13 $(target).toggleClass("c-shown"); 14 }); 15 } 16 17 }; 18}(); 19// END 20 21// BEGIN: Layout Brand 22var LayoutHeaderCart = function () { 23 24 return { 25 //main function to initiate the module 26 init: function () { 27 var cart = $('.c-cart-menu'); 28 29 if (cart.size() === 0) { 30 return; 31 } 32 33 if (App.getViewPort().width < App.getBreakpoint('md')) { // mpbile mode 34 $('body').on('click', '.c-cart-toggler', function (e) { 35 e.preventDefault(); 36 e.stopPropagation(); 37 $('body').toggleClass("c-header-cart-shown"); 38 }); 39 40 $('body').on('click', function (e) { 41 if (!cart.is(e.target) && cart.has(e.target).length === 0) { 42 $('body').removeClass('c-header-cart-shown'); 43 } 44 }); 45 } else { // desktop 46 $('body').on('hover', '.c-cart-toggler, .c-cart-menu', function (e) { 47 $('body').addClass("c-header-cart-shown"); 48 }); 49 50 $('body').on('hover', '.c-mega-menu > .navbar-nav > li:not(.c-cart-toggler-wrapper)', function (e) { 51 $('body').removeClass("c-header-cart-shown"); 52 }); 53 54 $('body').on('mouseleave', '.c-cart-menu', function (e) { 55 $('body').removeClass("c-header-cart-shown"); 56 }); 57 } 58 } 59 }; 60}(); 61// END 62 63// BEGIN: Layout Header 64var LayoutHeader = function () { 65 var offset = parseInt($('.c-layout-header').attr('data-minimize-offset') > 0 ? parseInt($('.c-layout-header').attr('data-minimize-offset')) : 0); 66 var _handleHeaderOnScroll = function () { 67 if ($(window).scrollTop() > offset) { 68 $("body").addClass("c-page-on-scroll"); 69 } else { 70 $("body").removeClass("c-page-on-scroll"); 71 } 72 } 73 74 var _handleTopbarCollapse = function () { 75 $('.c-layout-header .c-topbar-toggler').on('click', function (e) { 76 $('.c-layout-header-topbar-collapse').toggleClass("c-topbar-expanded"); 77 }); 78 } 79 80 return { 81 //main function to initiate the module 82 init: function () { 83 if ($('body').hasClass('c-layout-header-fixed-non-minimized')) { 84 return; 85 } 86 87 _handleHeaderOnScroll(); 88 _handleTopbarCollapse(); 89 90 $(window).scroll(function () { 91 _handleHeaderOnScroll(); 92 }); 93 } 94 }; 95}(); 96// END 97 98// BEGIN: Layout Mega Menu 99var LayoutMegaMenu = function () { 100 101 return { 102 //main function to initiate the module 103 init: function () { 104 $('.c-mega-menu').on('click', '.c-toggler', function (e) { 105 if (App.getViewPort().width < App.getBreakpoint('md')) { 106 e.preventDefault(); 107 if ($(this).closest("li").hasClass('c-open')) { 108 $(this).closest("li").removeClass('c-open'); 109 } else { 110 $(this).closest("li").addClass('c-open'); 111 } 112 } 113 }); 114 115 $('.c-layout-header .c-hor-nav-toggler:not(.c-quick-sidebar-toggler)').on('click', function () { 116 $('.c-layout-header').toggleClass('c-mega-menu-shown'); 117 118 if ($('body').hasClass('c-layout-header-mobile-fixed')) { 119 var height = App.getViewPort().height - $('.c-layout-header').outerHeight(true) - 60; 120 $('.c-mega-menu').css('max-height', height); 121 } 122 }); 123 } 124 }; 125}(); 126// END 127 128// BEGIN: Layout Mega Menu 129var LayoutSidebarMenu = function () { 130 131 return { 132 //main function to initiate the module 133 init: function () { 134 $('.c-layout-sidebar-menu > .c-sidebar-menu .c-toggler').on('click', function (e) { 135 e.preventDefault(); 136 $(this).closest('.c-dropdown').toggleClass('c-open').siblings().removeClass('c-open'); 137 }); 138 } 139 }; 140}(); 141// END 142 143// BEGIN: Layout Mega Menu 144var LayoutQuickSearch = function () { 145 146 return { 147 //main function to initiate the module 148 init: function () { 149 // desktop mode 150 $('.c-layout-header').on('click', '.c-mega-menu .c-search-toggler', function (e) { 151 e.preventDefault(); 152 153 $('body').addClass('c-layout-quick-search-shown'); 154 155 if (App.isIE() === false) { 156 $('.c-quick-search > .form-control').focus(); 157 } 158 }); 159 160 // mobile mode 161 $('.c-layout-header').on('click', '.c-brand .c-search-toggler', function (e) { 162 e.preventDefault(); 163 164 $('body').addClass('c-layout-quick-search-shown'); 165 166 if (App.isIE() === false) { 167 $('.c-quick-search > .form-control').focus(); 168 } 169 }); 170 171 // handle close icon for mobile and desktop 172 $('.c-quick-search').on('click', '> span', function (e) { 173 e.preventDefault(); 174 $('body').removeClass('c-layout-quick-search-shown'); 175 }); 176 } 177 }; 178}(); 179// END 180 181var LayoutCartMenu = function () { 182 183 return { 184 //main function to initiate the module 185 init: function () { 186 // desktop mode 187 $('.c-layout-header').on('mouseenter', '.c-mega-menu .c-cart-toggler-wrapper', function (e) { 188 e.preventDefault(); 189 190 $('.c-cart-menu').addClass('c-layout-cart-menu-shown'); 191 192 }); 193 194 $('.c-cart-menu, .c-layout-header').on('mouseleave', function (e) { 195 e.preventDefault(); 196 197 $('.c-cart-menu').removeClass('c-layout-cart-menu-shown'); 198 199 }); 200 201 // mobile mode 202 $('.c-layout-header').on('click', '.c-brand .c-cart-toggler', function (e) { 203 e.preventDefault(); 204 205 $('.c-cart-menu').toggleClass('c-layout-cart-menu-shown'); 206 207 }); 208 } 209 }; 210}(); 211// END 212 213// BEGIN: Layout Mega Menu 214var LayoutQuickSidebar = function () { 215 216 return { 217 //main function to initiate the module 218 init: function () { 219 // desktop mode 220 $('.c-layout-header').on('click', '.c-quick-sidebar-toggler', function (e) { 221 e.preventDefault(); 222 e.stopPropagation(); 223
224 if ($('body').hasClass("c-layout-quick-sidebar-shown")) { 225 $('body').removeClass("c-layout-quick-sidebar-shown"); 226 } else { 227 $('body').addClass("c-layout-quick-sidebar-shown"); 228 } 229 }); 230 231 $('.c-layout-quick-sidebar').on('click', '.c-close', function (e) { 232 e.preventDefault(); 233 234 $('body').removeClass("c-layout-quick-sidebar-shown"); 235 }); 236 237 $('.c-layout-quick-sidebar').on('click', function (e) { 238 e.stopPropagation(); 239 }); 240 241 $(document).on('click', '.c-layout-quick-sidebar-shown', function (e) { 242 $(this).removeClass("c-layout-quick-sidebar-shown"); 243 }); 244 } 245 }; 246}(); 247// END 248 249// BEGIN: Layout Go To Top 250var LayoutGo2Top = function () { 251 252 var handle = function () { 253 var currentWindowPosition = $(window).scrollTop(); // current vertical position 254 if (currentWindowPosition > 300) { 255 $(".c-layout-go2top").show(); 256 } else { 257 $(".c-layout-go2top").hide(); 258 } 259 }; 260 261 return { 262 263 //main function to initiate the module 264 init: function () { 265 266 handle(); // call headerFix() when the page was loaded 267 268 if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { 269 $(window).bind("touchend touchcancel touchleave", function (e) { 270 handle(); 271 }); 272 } else { 273 $(window).scroll(function () { 274 handle(); 275 }); 276 } 277 278 $(".c-layout-go2top").on('click', function (e) { 279 e.preventDefault(); 280 $("html, body").animate({ 281 scrollTop: 0 282 }, 600); 283 }); 284 } 285 286 }; 287}(); 288// END: Layout Go To Top 289 290// BEGIN: Onepage Nav 291var LayoutOnepageNav = function () { 292 293 var handle = function () { 294 var offset; 295 var scrollspy; 296 var speed; 297 var nav; 298 299 $('body').addClass('c-page-on-scroll'); 300 offset = $('.c-layout-header-onepage').outerHeight(true); 301 $('body').removeClass('c-page-on-scroll'); 302 303 if ($('.c-mega-menu-onepage-dots').size() > 0) { 304 if ($('.c-onepage-dots-nav').size() > 0) { 305 $('.c-onepage-dots-nav').css('margin-top', -($('.c-onepage-dots-nav').outerHeight(true) / 2)); 306 } 307 scrollspy = $('body').scrollspy({ 308 target: '.c-mega-menu-onepage-dots', 309 offset: offset 310 }); 311 speed = parseInt($('.c-mega-menu-onepage-dots').attr('data-onepage-animation-speed')); 312 } else { 313 scrollspy = $('body').scrollspy({ 314 target: '.c-mega-menu-onepage', 315 offset: offset 316 }); 317 speed = parseInt($('.c-mega-menu-onepage').attr('data-onepage-animation-speed')); 318 } 319 320 scrollspy.on('activate.bs.scrollspy', function () { 321 $(this).find('.c-onepage-link.c-active').removeClass('c-active'); 322 $(this).find('.c-onepage-link.active').addClass('c-active'); 323 }); 324 325 $('.c-onepage-link > a').on('click', function (e) { 326 var section = $(this).attr('href'); 327 var top = 0; 328 329 if (section !== "#home") { 330 top = $(section).offset().top - offset + 1; 331 } 332 333 $('html, body').stop().animate({ 334 scrollTop: top, 335 }, speed, 'easeInExpo'); 336 337 e.preventDefault(); 338 339 if (App.getViewPort().width < App.getBreakpoint('md')) { 340 $('.c-hor-nav-toggler').click(); 341 } 342 }); 343 }; 344 345 return { 346 347 //main function to initiate the module 348 init: function () { 349 handle(); // call headerFix() when the page was loaded 350 } 351 352 }; 353}(); 354// END: Onepage Nav 355 356// BEGIN: Handle Theme Settings 357var LayoutThemeSettings = function () { 358 359 var handle = function () { 360 361 $('.c-settings .c-color').on('click', function () { 362 var val = $(this).attr('data-color'); 363 var demo = App.getURLParameter('d') || 'default'; 364 $('#style_theme').attr('href', '../assets/demos/' + demo + '/css/themes/' + val + '.css'); 365 366 $('.c-settings .c-color').removeClass('c-active'); 367 $(this).addClass('c-active'); 368 }); 369 370 $('.c-setting_header-type').on('click', function () { 371 var val = $(this).attr('data-value'); 372 if (val == 'fluid') { 373 $('.c-layout-header .c-topbar > .container').removeClass('container').addClass('container-fluid'); 374 $('.c-layout-header .c-navbar > .container').removeClass('container').addClass('container-fluid'); 375 } else { 376 $('.c-layout-header .c-topbar > .container-fluid').removeClass('container-fluid').addClass('container'); 377 $('.c-layout-header .c-navbar > .container-fluid').removeClass('container-fluid').addClass('container'); 378 } 379 $('.c-setting_header-type').removeClass('active'); 380 $(this).addClass('active'); 381 }); 382 383 $('.c-setting_header-mode').on('click', function () { 384 var val = $(this).attr('data-value'); 385 if (val == 'static') { 386 $('body').removeClass('c-layout-header-fixed').addClass('c-layout-header-static'); 387 } else { 388 $('body').removeClass('c-layout-header-static').addClass('c-layout-header-fixed'); 389 } 390 $('.c-setting_header-mode').removeClass('active'); 391 $(this).addClass('active'); 392 }); 393 394 $('.c-setting_font-style').on('click', function () { 395 var val = $(this).attr('data-value'); 396 397 if (val == 'light') { 398 $('.c-font-uppercase').addClass('c-font-uppercase-reset').removeClass('c-font-uppercase'); 399 $('.c-font-bold').addClass('c-font-bold-reset').removeClass('c-font-bold'); 400 401 $('.c-fonts-uppercase').addClass('c-fonts-uppercase-reset').removeClass('c-fonts-uppercase'); 402 $('.c-fonts-bold').addClass('c-fonts-bold-reset').removeClass('c-fonts-bold'); 403 } else { 404 $('.c-font-uppercase-reset').addClass('c-font-uppercase').removeClass('c-font-uppercase-reset'); 405 $('.c-font-bold-reset').addClass('c-font-bold').removeClass('c-font-bold-reset'); 406 407 $('.c-fonts-uppercase-reset').addClass('c-fonts-uppercase').removeClass('c-fonts-uppercase-reset'); 408 $('.c-fonts-bold-reset').addClass('c-fonts-bold').removeClass('c-fonts-bold-reset'); 409 } 410 411 $('.c-setting_font-style').removeClass('active'); 412 $(this).addClass('active'); 413 }); 414 415 $('.c-setting_megamenu-style').on('click', function () { 416 var val = $(this).attr('data-value'); 417 if (val == 'dark') { 418 $('.c-mega-menu').removeClass('c-mega-menu-light').addClass('c-mega-menu-dark'); 419 } else { 420 $('.c-mega-menu').removeClass('c-mega-menu-dark').addClass('c-mega-menu-light'); 421 } 422 $('.c-setting_megamenu-style').removeClass('active'); 423 $(this).addClass('active'); 424 }); 425 426 }; 427 428 return { 429 430 //main function to initiate the module 431 init: function () { 432 433 handle(); 434 } 435 436 }; 437}(); 438// END: Handle Theme Settings 439 440// BEGIN: OwlCarousel 441var ContentOwlcarousel = function () { 442 443 var _initInstances = function () {
444 $("[data-slider='owl'] .owl-carousel").each(function () { 445 446 var parent = $(this); 447 448 var items; 449 var itemsDesktop; 450 var itemsDesktopSmall; 451 var itemsTablet; 452 var itemsTabletSmall; 453 var itemsMobile; 454 455 var rtl_mode = (parent.data('rtl')) ? parent.data('rtl') : false ; 456 var items_loop = (parent.data('loop')) ? parent.data('loop') : true ; 457 var items_nav_dots = (parent.attr('data-navigation-dots')) ? parent.data('navigation-dots') : true ; 458 var items_nav_label = (parent.attr('data-navigation-label')) ? parent.data('navigation-label') : false ; 459 460 if (parent.data("single-item") == true) { 461 items = 1; 462 itemsDesktop = 1; 463 itemsDesktopSmall = 1; 464 itemsTablet = 1; 465 itemsTabletSmall = 1; 466 itemsMobile = 1; 467 } else { 468 items = parent.data('items'); 469 itemsDesktop = parent.data('desktop-items') ? parent.data('desktop-items') : items; 470 itemsDesktopSmall = parent.data('desktop-small-items') ? parent.data('desktop-small-items') : 3; 471 itemsTablet = parent.data('tablet-items') ? parent.data('tablet-items') : 2; 472 itemsMobile = parent.data('mobile-items') ? parent.data('mobile-items') : 1; 473 } 474 475 parent.owlCarousel({ 476 477 rtl: rtl_mode, 478 loop: items_loop, 479 items: items, 480 responsive: { 481 0:{ 482 items: itemsMobile 483 }, 484 480:{ 485 items: itemsMobile 486 }, 487 768:{ 488 items: itemsTablet 489 }, 490 980:{ 491 items: itemsDesktopSmall 492 }, 493 1200:{ 494 items: itemsDesktop 495 } 496 }, 497 498 dots: items_nav_dots, 499 nav: items_nav_label, 500 navText: false, 501 autoplay: (parent.data("auto-play")) ? parent.data("auto-play") : true, 502 autoplayTimeout: (parent.data('slide-speed')) ? parent.data('slide-speed') : 5000, 503 autoplayHoverPause: (parent.data('auto-play-hover-pause')) ? parent.data('auto-play-hover-pause') : false, 504 }); 505 }); 506 }; 507 508 return { 509 510 //main function to initiate the module 511 init: function () { 512 513 _initInstances(); 514 } 515 516 }; 517}(); 518// END: OwlCarousel 519 520// BEGIN: ContentCubeLatestPortfolio 521var ContentCubeLatestPortfolio = function () { 522 523 var _initInstances = function () { 524 525 // init cubeportfolio 526 $('.c-content-latest-works').cubeportfolio({ 527 filters: '#filters-container', 528 loadMore: '#loadMore-container', 529 loadMoreAction: 'click', 530 layoutMode: 'grid', 531 defaultFilter: '*', 532 animationType: 'quicksand', 533 gapHorizontal: 20, 534 gapVertical: 23, 535 gridAdjustment: 'responsive', 536 mediaQueries: [{ 537 width: 1100, 538 cols: 4 539 }, { 540 width: 800, 541 cols: 3 542 }, { 543 width: 500, 544 cols: 2 545 }, { 546 width: 320, 547 cols: 1 548 }], 549 caption: 'zoom', 550 displayType: 'lazyLoading', 551 displayTypeSpeed: 100, 552 553 // lightbox 554 lightboxDelegate: '.cbp-lightbox', 555 lightboxGallery: true, 556 lightboxTitleSrc: 'data-title', 557 lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>', 558 559 // singlePage popup 560 singlePageDelegate: '.cbp-singlePage', 561 singlePageDeeplinking: true, 562 singlePageStickyNavigation: true, 563 singlePageCounter: '<div class="cbp-popup-singlePage-counter">{{current}} of {{total}}</div>', 564 singlePageCallback: function (url, element) { 565 // to update singlePage content use the following method: this.updateSinglePage(yourContent) 566 var t = this; 567 568 $.ajax({
569 url: url, 570 type: 'GET', 571 dataType: 'html', 572 timeout: 5000 573 }) 574 .done(function (result) { 575 t.updateSinglePage(result); 576 }) 577 .fail(function () { 578 t.updateSinglePage("Error! Please refresh the page!"); 579 }); 580 }, 581 }); 582 583 $('.c-content-latest-works-fullwidth').cubeportfolio({ 584 loadMoreAction: 'auto', 585 layoutMode: 'grid', 586 defaultFilter: '*', 587 animationType: 'fadeOutTop', 588 gapHorizontal: 0, 589 gapVertical: 0, 590 gridAdjustment: 'responsive', 591 mediaQueries: [{ 592 width: 1600, 593 cols: 5 594 }, { 595 width: 1200, 596 cols: 4 597 }, { 598 width: 800, 599 cols: 3 600 }, { 601 width: 500, 602 cols: 2 603 }, { 604 width: 320, 605 cols: 1 606 }], 607 caption: 'zoom', 608 displayType: 'lazyLoading', 609 displayTypeSpeed: 100, 610 611 // lightbox 612 lightboxDelegate: '.cbp-lightbox', 613 lightboxGallery: true, 614 lightboxTitleSrc: 'data-title', 615 lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>', 616 }); 617 618 }; 619 620 return { 621 622 //main function to initiate the module 623 init: function () { 624 _initInstances(); 625 } 626 627 }; 628}(); 629// END: ContentCubeLatestPortfolio 630 631// BEGIN: CounterUp 632var ContentCounterUp = function () { 633 634 var _initInstances = function () { 635 636 // init counter up 637 $("[data-counter='counterup']").counterUp({ 638 delay: 10, 639 time: 1000 640 }); 641 }; 642 643 return { 644 645 //main function to initiate the module 646 init: function () { 647 _initInstances(); 648 } 649 650 }; 651}(); 652// END: CounterUp 653 654// BEGIN: Fancybox 655var ContentFancybox = function () { 656 657 var _initInstances = function () { 658 // init fancybox 659 $("[data-lightbox='fancybox']").fancybox(); 660 }; 661 662 return { 663 664 //main function to initiate the module 665 init: function () { 666 _initInstances(); 667 } 668 669 }; 670}(); 671// END: Fancybox 672 673// BEGIN: Twitter 674var ContentTwitter = function () { 675 676 var _initInstances = function () { 677 // init twitter 678 if ($(".twitter-timeline")[0]) { 679 !function (d, s, id) { 680 var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; 681 if (!d.getElementById(id)) { 682 js = d.createElement(s); 683 js.id = id; 684 js.src = p + "://platform.twitter.com/widgets.js"; 685 fjs.parentNode.insertBefore(js, fjs); 686 } 687 }(document, "script", "twitter-wjs"); 688 } 689 }; 690 691 return { 692 693 //main function to initiate the module 694 init: function () { 695 _initInstances(); 696 } 697 698 }; 699}(); 700// END: Twitter 701 702 703// BEGIN : SCROLL TO VIEW DETECTION 704function isScrolledIntoView(elem) 705{ 706 var $elem = $(elem); 707 var $window = $(window); 708 709 var docViewTop = $window.scrollTop(); 710 var docViewBottom = docViewTop + $window.height(); 711 712 var elemTop = $elem.offset().top; 713 var elemBottom = elemTop + $elem.height(); 714 715 return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); 716} 717// END : SCROLL TO VIEW FUNCTION 718 719// BEGIN : PROGRESS BAR 720var LayoutProgressBar = function ($) { 721 722 return { 723 init: function () { 724 var id_count = 0; // init progress bar id number 725 $('.c-progress-bar-line').each(function(){ 726 id_count++; // progress bar id running number 727 // build progress bar class selector with running id number 728 var this_id = $(this).attr('data-id', id_count); 729 var this_bar = '.c-progress-bar-line[data-id="'+id_count+'"]'; 730 731 // build progress bar object key 732 var progress_data = $(this).data('progress-bar'); 733 progress_data = progress_data.toLowerCase().replace(/\b[a-z]/g, function(letter) { 734 return letter.toUpperCase(); 735 }); 736 if(progress_data == 'Semicircle') { progress_data = 'SemiCircle'; } 737 738 // grab options 739 var bar_color = $(this).css('border-top-color'); // color 740 var this_animation = $(this).data('animation'); // animation type : linear, easeIn, easeOut, easeInOut, bounce 741 var stroke_width = $(this).data('stroke-width'); // stroke width 742 var bar_duration = $(this).data('duration'); // duration 743 var trail_width = $(this).data('trail-width'); // trail width 744 var trail_color = $(this).data('trail-color'); // trail color 745 var bar_progress = $(this).data('progress'); // progress value 746 var font_color = $(this).css('color'); // progress font color 747 748 // set default data if options is null / undefinded 749 if (bar_color == 'rgb(92, 104, 115)'){ bar_color = '#32c5d2'; } // set default color 750 if (trail_color == ''){ trail_color = '#5c6873'; } 751 if (trail_width == ''){ trail_width = '0'; } 752 if (bar_progress == ""){ bar_progress = '1'; } 753 if (stroke_width == ""){ stroke_width = '3'; } 754 if (this_animation == ""){ this_animation = 'easeInOut'; } 755 if (bar_duration == ""){ bar_duration = '1500'; } 756 757 758 // set progress bar 759 var bar = new ProgressBar[progress_data](this_bar, { 760 strokeWidth: stroke_width, 761 easing: this_animation, 762 duration: bar_duration, 763 color: bar_color, 764 trailWidth: trail_width, 765 trailColor: trail_color, 766 svgStyle: null, 767 step: function (state, bar) { 768 bar.setText(Math.round(bar.value() * 100) + '%'); 769 }, 770 text: { 771 style: { 772 color: font_color, 773 } 774 }, 775 }); 776 777 // init animation when progress bar in view without scroll 778 var check_scroll = isScrolledIntoView(this_bar); // check if progress bar is in view - return true / false 779 if (check_scroll == true){ 780 bar.animate(bar_progress); // Number from 0.0 to 1.0 781 } 782 783 // start progress bar animation upon scroll view 784 $(window).scroll(function (event) { 785 var check_scroll = isScrolledIntoView(this_bar); // check if progress bar is in view - return true / false 786 if (check_scroll == true){ 787 bar.animate(bar_progress); // Number from 0.0 to 1.0 788 } 789 }); 790 791 792 });
793 794 795 796 797 } 798 } 799}(jQuery); 800// END : PROGRESS BAR 801 802// BEGIN : COOKIES NOTIFICATION BAR 803var LayoutCookies = function () { 804 805 var _initInstances = function () { 806 807 $('.c-cookies-bar-close').click(function(){ 808 $('.c-cookies-bar').animate({ 809 opacity: 0, 810 }, 500, function() { 811 $('.c-cookies-bar').css('display', 'none'); 812 }); 813 }); 814 }; 815 816 return { 817 818 //main function to initiate the module 819 init: function () { 820 _initInstances(); 821 } 822 823 }; 824}(); 825// END : COOKIES NOTIFICATION BAR 826 827// BEGIN : JQUERY SMOOTH SCROLL 828var LayoutSmoothScroll = function () { 829 830 var _initInstances = function () { 831 832 $('.js-smoothscroll').on('click', function() { 833 var scroll_target = $(this).data('target'); 834 var scroll_offset = ($(this).data('scroll-offset')) ? $(this).data('scroll-offset') : 0; 835 $.smoothScroll({ 836 scrollTarget: '#'+scroll_target, 837 offset: scroll_offset, 838 }); 839 return false; 840 }); 841 }; 842 843 return { 844 845 //main function to initiate the module 846 init: function () { 847 _initInstances(); 848 } 849 850 }; 851}(); 852// END : JQUERY SMOOTH SCROLL 853 854// BEGIN : TYPED.JS 855var ContentTyped = function () { 856 857 var _initInstances = function () { 858 859 $('.c-typed-animation').each(function(){ 860 var final_string = []; 861 if($(this).data('first-sentence')){ 862 final_string.push($(this).data('first-sentence')); 863 } 864 if($(this).data('second-sentence')){ 865 final_string.push($(this).data('second-sentence')); 866 } 867 if($(this).data('third-sentence')){ 868 final_string.push($(this).data('third-sentence')); 869 } 870 if($(this).data('forth-sentence')){ 871 final_string.push($(this).data('forth-sentence')); 872 } 873 if($(this).data('fifth-sentence')){ 874 final_string.push($(this).data('fifth-sentence')); 875 } 876 var type_speed = ($(this).attr('data-type-speed')) ? $(this).attr('data-type-speed') : 0; 877 var delay = ($(this).attr('data-delay')) ? $(this).attr('data-delay') : 0; 878 var backSpeed = ($(this).attr('data-backspace-speed')) ? $(this).attr('data-backspace-speed') : 0; 879 var shuffle = ($(this).attr('data-shuffle')) ? $(this).attr('data-shuffle') : false; 880 var backDelay = ($(this).attr('data-backspace-delay')) ? $(this).attr('data-bakcspace-delay') : 500; 881 var fadeOut = ($(this).attr('data-fadeout')) ? $(this).attr('data-fadeout') : false; 882 var fadeOutDelay = ($(this).attr('data-fadeout-delay')) ? $(this).attr('data-fadeout-delay') : 500; 883 var loop = ($(this).attr('data-loop')) ? $(this).attr('data-loop') : false; 884 var loopCount = ($(this).attr('data-loop-count')) ? $(this).attr('data-loop-count') : null; 885 var showCursor = ($(this).attr('data-cursor')) ? $(this).attr('data-cursor') : true; 886 var cursorChar = ($(this).attr('data-cursor-char')) ? $(this).attr('data-cursor-char') : "|"; 887 888 $(this).typed({ 889 strings: final_string, 890 typeSpeed: type_speed, 891 startDelay: delay, 892 backSpeed: backSpeed, 893 shuffle: shuffle, 894 backDelay: backDelay, 895 fadeOut: fadeOut, 896 fadeOutClass: 'typed-fade-out', 897 fadeOutDelay: fadeOutDelay, 898 loop: loop, 899 loopCount: loopCount, 900 showCursor: showCursor, 901 cursorChar: cursorChar, 902 }); 903 }); 904 905 }; 906 907 return { 908 909 //main function to initiate the module 910 init: function () { 911 _initInstances(); 912 } 913 914 }; 915}(); 916// END : TYPED.JS 917 918// BEGIN : DATEPICKERS 919var ContentDatePickers = function () { 920 921 var handleDatePickers = function () { 922 923 $('.date-picker').each(function(){ 924 $(this).datepicker({ 925 rtl: $(this).data('rtl'), 926 orientation: "left", 927 autoclose: true, 928 container: $(this), 929 format: $(this).data('date-format'), 930 }); 931 }); 932 } 933 934 return { 935 //main function to initiate the module 936 init: function () { 937 handleDatePickers(); 938 } 939 }; 940 941}(); 942// END : DATEPICKERS 943 944// Main theme initialization 945$(document).ready(function () { 946 // init layout handlers 947 LayoutBrand.init(); 948 LayoutHeaderCart.init(); 949 LayoutMegaMenu.init(); 950 LayoutSidebarMenu.init(); 951 LayoutQuickSearch.init(); 952 LayoutCartMenu.init(); 953 LayoutQuickSidebar.init(); 954 LayoutGo2Top.init(); 955 LayoutOnepageNav.init(); 956 LayoutThemeSettings.init();
957 LayoutProgressBar.init(); 958 LayoutCookies.init(); 959 LayoutSmoothScroll.init(); 960 LayoutHeader.init(); 961 962 // init plugin wrappers 963 ContentOwlcarousel.init(); 964 //ContentCubeLatestPortfolio.init(); 965 //ContentCounterUp.init(); 966 ContentFancybox.init(); 967 ContentTwitter.init(); 968 //ContentDatePickers.init(); 969 ContentTyped.init(); 970}); 971
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.