1(function($) { 2 3 "use strict"; 4 5 // New Home script 6 7 //Search Popup 8 if($('#search-popup').length){ 9 10 //Show Popup 11 $('.search-toggler').on('click', function() { 12 $('#search-popup').addClass('popup-visible'); 13 }); 14 $(document).keydown(function(e){ 15 if(e.keyCode === 27) { 16 $('#search-popup').removeClass('popup-visible'); 17 } 18 }); 19 //Hide Popup 20 $('.close-search,.search-popup .overlay-layer').on('click', function() { 21 $('#search-popup').removeClass('popup-visible'); 22 }); 23 } 24 25 //Pricing Tabs 26 if($('.pricing-tabs').length){ 27 $('.pricing-tabs .tab-btns .tab-btn').on('click', function(e) { 28 e.preventDefault(); 29 var target = $($(this).attr('data-tab')); 30 31 if ($(target).hasClass('actve-tab')){ 32 return false; 33 }else{ 34 $('.pricing-tabs .tab-btns .tab-btn').removeClass('active-btn'); 35 $(this).addClass('active-btn'); 36 $('.pricing-tabs .pr-content .pr-tab').removeClass('active-tab'); 37 $(target).addClass('active-tab'); 38 } 39 }); 40 } 41 42 if ($('.theme_carousel').length) { 43 $(".theme_carousel").each(function (index) { 44 var $owlAttr = {}, 45 $extraAttr = $(this).data("options"); 46 $.extend($owlAttr, $extraAttr); 47 $(this).owlCarousel($owlAttr); 48 }); 49 } 50 51 //06 Hidden Sidebar 52 if($('.hidden-sidebar').length){ 53 54 var animButton = $(".sidemenu-nav-toggler"), 55 hiddenBar = $(".hidden-sidebar"), 56 navOverlay = $(".nav-overlay"), 57 hiddenBarClose = $(".hidden-sidebar-close"); 58 59 function showMenu() { 60 TweenMax.to(hiddenBar, 0.6, { 61 force3D: false, 62 right: "0", 63 ease: Expo.easeInOut 64 }); 65 hiddenBar.removeClass("close-sidebar"); 66 navOverlay.fadeIn(500); 67 } 68 69 function hideMenu() { 70 TweenMax.to(hiddenBar, 0.6, { 71 force3D: false, 72 right: "-480px", 73 ease: Expo.easeInOut 74 }); 75 hiddenBar.addClass("close-sidebar"); 76 navOverlay.fadeOut(500); 77 } 78 animButton.on("click", function() { 79 if (hiddenBar.hasClass("close-sidebar")) showMenu(); 80 else hideMenu(); 81 }); 82 navOverlay.on("click", function() { 83 hideMenu(); 84 }); 85 hiddenBarClose.on("click", function() { 86 hideMenu(); 87 }); 88 } 89 90 if ($('.nav-overlay').length) { 91 // / cursor / 92 var cursor = $(".nav-overlay .cursor"), 93 follower = $(".nav-overlay .cursor-follower"); 94 95 var posX = 0, 96 posY = 0; 97 98 var mouseX = 0, 99 mouseY = 0; 100 101 TweenMax.to({}, 0.016, { 102 repeat: -1, 103 onRepeat: function() { 104 posX += (mouseX - posX) / 9; 105 posY += (mouseY - posY) / 9; 106 107 TweenMax.set(follower, { 108 css: { 109 left: posX - 22, 110 top: posY - 22 111 } 112 }); 113 114 TweenMax.set(cursor, { 115 css: { 116 left: mouseX, 117 top: mouseY 118 } 119 }); 120 121 } 122 }); 123 124 $(document).on("mousemove", function(e) { 125 var scrollTop = window.pageYOffset || document.documentElement.scrollTop; 126 mouseX = e.pageX; 127 mouseY = e.pageY - scrollTop; 128 }); 129 $("button, a").on("mouseenter", function() { 130 cursor.addClass("active"); 131 follower.addClass("active"); 132 }); 133 $("button, a").on("mouseleave", function() { 134 cursor.removeClass("active"); 135 follower.removeClass("active"); 136 }); 137 $(".nav-overlay").on("mouseenter", function() { 138 cursor.addClass("close-cursor"); 139 follower.addClass("close-cursor"); 140 }); 141 $(".nav-overlay").on("mouseleave", function() { 142 cursor.removeClass("close-cursor"); 143 follower.removeClass("close-cursor"); 144 }); 145 } 146 147 148 // End new home scrip end 149 150 //Hide Loading Box (Preloader) 151 function handlePreloader() { 152 if($('.preloader').length){ 153 $('.preloader').delay(200).fadeOut(500); 154 } 155 } 156 157 //Tabs Box 158 if($('.tabs-box').length){ 159 $('.tabs-box .tab-btns .tab-btn').on('click', function(e) { 160 e.preventDefault(); 161 var target = $($(this).attr('data-tab')); 162 163 if ($(target).hasClass('actve-tab')){ 164 return false; 165 }else{ 166 $('.tabs-box .tab-btns .tab-btn').removeClass('active-btn'); 167 $(this).addClass('active-btn'); 168 $('.tabs-box .tabs-content .tab').removeClass('active-tab'); 169 $(target).addClass('active-tab'); 170 } 171 }); 172 } 173 174 if ($(".preloader-close").length) { 175 $(".preloader-close").on("click", function(){ 176 $('.loader-wrap').delay(200).fadeOut(500); 177 }) 178 } 179 180 //Update Header Style and Scroll to Top 181 function headerStyle() { 182 if($('.main-header').length){ 183 var windowpos = $(window).scrollTop(); 184 var siteHeader = $('.main-header'); 185 var scrollLink = $('.scroll-top'); 186 if (windowpos >= 110) { 187 siteHeader.addClass('fixed-header'); 188 scrollLink.addClass('open'); 189 } else { 190 siteHeader.removeClass('fixed-header'); 191 scrollLink.removeClass('open'); 192 } 193 } 194 } 195 196 headerStyle(); 197 198 199 //Submenu Dropdown Toggle 200 if($('.main-header li.dropdown ul').length){ 201 $('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fas fa-angle-down"></span></div>'); 202 203 } 204 205 //Mobile Nav Hide Show
206 if($('.mobile-menu').length){ 207 208 $('.mobile-menu .menu-box').mCustomScrollbar(); 209 210 var mobileMenuContent = $('.main-header .menu-area .main-menu').html(); 211 $('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent); 212 $('.sticky-header .main-menu').append(mobileMenuContent); 213 214 //Dropdown Button 215 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 216 $(this).toggleClass('open'); 217 $(this).prev('ul').slideToggle(500); 218 }); 219 //Dropdown Button 220 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 221 $(this).prev('.megamenu').slideToggle(900); 222 }); 223 //Menu Toggle Btn 224 $('.mobile-nav-toggler').on('click', function() { 225 $('body').addClass('mobile-menu-visible'); 226 }); 227 228 //Menu Toggle Btn 229 $('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() { 230 $('body').removeClass('mobile-menu-visible'); 231 }); 232 } 233 234 235 // Scroll to a Specific Div 236 if($('.scroll-to-target').length){ 237 $(".scroll-to-target").on('click', function() { 238 var target = $(this).attr('data-target'); 239 // animate 240 $('html, body').animate({ 241 scrollTop: $(target).offset().top 242 }, 1000); 243 244 }); 245 } 246 247 // Elements Animation 248 if($('.wow').length){ 249 var wow = new WOW({ 250 mobile: false 251 }); 252 wow.init(); 253 } 254 255 256 //Fact Counter + Text Count 257 if($('.count-box').length){ 258 $('.count-box').appear(function(){ 259 260 var $t = $(this), 261 n = $t.find(".count-text").attr("data-stop"), 262 r = parseInt($t.find(".count-text").attr("data-speed"), 10); 263 264 if (!$t.hasClass("counted")) { 265 $t.addClass("counted"); 266 $({ 267 countNum: $t.find(".count-text").text() 268 }).animate({ 269 countNum: n 270 }, { 271 duration: r, 272 easing: "linear", 273 step: function() { 274 $t.find(".count-text").text(Math.floor(this.countNum)); 275 }, 276 complete: function() { 277 $t.find(".count-text").text(this.countNum); 278 } 279 }); 280 } 281 282 },{accY: 0}); 283 } 284 285 // testimonial-carousel 286 if ($('.testimonial-carousel').length) { 287 $('.testimonial-carousel').owlCarousel({ 288 loop:true, 289 margin:30, 290 nav:false, 291 smartSpeed: 3000, 292 autoplay: true, 293 navText: [ '<span class="flaticon-left-arrow"></span>', '<span class="flaticon-right-arrow"></span>' ], 294 responsive:{ 295 0:{ 296 items:1 297 }, 298 480:{ 299 items:1 300 }, 301 600:{ 302 items:1 303 }, 304 800:{ 305 items:1 306 }, 307 1200:{ 308 items:1 309 } 310 311 } 312 }); 313 } 314 315 316 //LightBox / Fancybox 317 if($('.lightbox-image').length) { 318 $('.lightbox-image').fancybox({ 319 openEffect : 'fade', 320 closeEffect : 'fade', 321 helpers : { 322 media : {} 323 } 324 }); 325 } 326 327 328 //Tabs Box 329 if($('.tabs-box').length){ 330 $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) { 331 e.preventDefault(); 332 var target = $($(this).attr('data-tab')); 333 334 if ($(target).is(':visible')){ 335 return false; 336 }else{ 337 target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn'); 338 $(this).addClass('active-btn'); 339 target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0); 340 target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab'); 341 $(target).fadeIn(300); 342 $(target).addClass('active-tab'); 343 } 344 }); 345 } 346 347 348 349 //Accordion Box 350 if($('.accordion-box').length){ 351 $(".accordion-box").on('click', '.acc-btn', function() { 352 353 var outerBox = $(this).parents('.accordion-box'); 354 var target = $(this).parents('.accordion'); 355 356 if($(this).hasClass('active')!==true){ 357 $(outerBox).find('.accordion .acc-btn').removeClass('active'); 358 } 359 360 if ($(this).next('.acc-content').is(':visible')){ 361 return false; 362 }else{ 363 $(this).addClass('active'); 364 $(outerBox).children('.accordion').removeClass('active-block'); 365 $(outerBox).find('.accordion').children('.acc-content').slideUp(300); 366 target.addClass('active-block'); 367 $(this).next('.acc-content').slideDown(300); 368 } 369 }); 370 } 371 372 373 // banner-carousel 374 if ($('.banner-carousel').length) { 375 $('.banner-carousel').owlCarousel({ 376 loop:true, 377 margin:0, 378 nav:true, 379 animateOut: 'fadeOut', 380 animateIn: 'fadeIn', 381 active: true, 382 smartSpeed: 1000, 383 autoplay: 6000, 384 navText: [ '<span class="flaticon-left-arrow"></span>', '<span class="flaticon-right-arrow"></span>' ], 385 responsive:{ 386 0:{ 387 items:1 388 }, 389 600:{ 390 items:1 391 }, 392 800:{ 393 items:1 394 }, 395 1024:{ 396 items:1 397 } 398 } 399 }); 400 } 401 402 403 //three-item-carousel 404 if ($('.three-item-carousel').length) { 405 $('.three-item-carousel').owlCarousel({ 406 loop:true, 407 margin:30, 408 nav:true, 409 smartSpeed: 1000, 410 autoplay: 500, 411 navText: [ '<span class="flaticon-left-2"></span>', '<span class="flaticon-right-1"></span>' ], 412 responsive:{ 413 0:{ 414 items:1 415 }, 416 480:{ 417 items:1 418 }, 419 600:{ 420 items:2 421 }, 422 800:{ 423 items:2 424 }, 425 1024:{ 426 items:3 427 } 428 } 429 }); 430 } 431 432 433 // Four Item Carousel
434 if ($('.four-item-carousel').length) { 435 $('.four-item-carousel').owlCarousel({ 436 loop:true, 437 margin:30, 438 nav:true, 439 smartSpeed: 500, 440 autoplay: 5000, 441 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 442 responsive:{ 443 0:{ 444 items:1 445 }, 446 600:{ 447 items:2 448 }, 449 800:{ 450 items:2 451 }, 452 1024:{ 453 items:3 454 }, 455 1200:{ 456 items:4 457 } 458 } 459 }); 460 } 461 462 // Gallery Carousel 463 if ($('.gallery-carousel').length) { 464 $('.gallery-carousel').owlCarousel({ 465 loop:true, 466 margin:6, 467 nav:true, 468 smartSpeed: 500, 469 autoplay: 5000, 470 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 471 responsive:{ 472 0:{ 473 items:1 474 }, 475 600:{ 476 items:2 477 }, 478 800:{ 479 items:3 480 }, 481 1024:{ 482 items:3 483 }, 484 1200:{ 485 items:4 486 } 487 } 488 }); 489 } 490 491 492 // single-item-carousel 493 if ($('.single-item-carousel').length) { 494 $('.single-item-carousel').owlCarousel({ 495 loop:true, 496 margin:30, 497 nav:false, 498 smartSpeed: 3000, 499 autoplay: true, 500 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 501 responsive:{ 502 0:{ 503 items:1 504 }, 505 480:{ 506 items:1 507 }, 508 600:{ 509 items:1 510 }, 511 800:{ 512 items:1 513 }, 514 1200:{ 515 items:1 516 } 517 518 } 519 }); 520 } 521 522 523 // clients-carousel 524 if ($('.clients-carousel').length) { 525 $('.clients-carousel').owlCarousel({ 526 loop:true, 527 margin:30, 528 nav:false, 529 smartSpeed: 3000, 530 autoplay: true, 531 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 532 responsive:{ 533 0:{ 534 items:1 535 }, 536 480:{ 537 items:2 538 }, 539 600:{ 540 items:3 541 }, 542 800:{ 543 items:4 544 }, 545 1200:{ 546 items:5 547 } 548 549 } 550 }); 551 } 552 553 554 //Add One Page nav 555 if($('.scroll-nav').length) { 556 $('.scroll-nav').onePageNav(); 557 } 558 559 560 //Sortable Masonary with Filters 561 function enableMasonry() { 562 if($('.sortable-masonry').length){ 563 564 var winDow = $(window); 565 // Needed variables 566 var $container=$('.sortable-masonry .items-container'); 567 var $filter=$('.filter-btns'); 568 569 $container.isotope({ 570 filter:'*', 571 masonry: { 572 columnWidth : '.masonry-item.small-column' 573 }, 574 animationOptions:{ 575 duration:500, 576 easing:'linear' 577 } 578 }); 579 580 581 // Isotope Filter 582 $filter.find('li').on('click', function(){ 583 var selector = $(this).attr('data-filter'); 584 585 try { 586 $container.isotope({ 587 filter : selector, 588 animationOptions: { 589 duration: 500, 590 easing : 'linear', 591 queue : false 592 } 593 }); 594 } catch(err) { 595 596 } 597 return false; 598 }); 599 600 601 winDow.on('resize', function(){ 602 var selector = $filter.find('li.active').attr('data-filter'); 603 604 $container.isotope({ 605 filter : selector, 606 animationOptions: { 607 duration: 500, 608 easing : 'linear', 609 queue : false 610 } 611 }); 612 }); 613 614 615 var filterItemA = $('.filter-btns li'); 616 617 filterItemA.on('click', function(){ 618 var $this = $(this); 619 if ( !$this.hasClass('active')) { 620 filterItemA.removeClass('active'); 621 $this.addClass('active'); 622 } 623 }); 624 } 625 } 626 627 enableMasonry(); 628 629 630 // Progress Bar 631 if ($('.count-bar').length) { 632 $('.count-bar').appear(function(){ 633 var el = $(this); 634 var percent = el.data('percent'); 635 $(el).css('width',percent).addClass('counted'); 636 },{accY: -50}); 637 638 } 639 640 641 $(document).ready(function() { 642 $('select:not(.ignore)').niceSelect(); 643 }); 644 645 646 // page direction 647 function directionswitch() { 648 if ($('.page_direction').length) { 649 650 $('.direction_switch button').on('click', function() { 651 $('body').toggleClass(function(){ 652 return $(this).is('.rtl, .ltr') ? 'rtl ltr' : 'rtl'; 653 }) 654 }); 655 }; 656 } 657 658 659 // RoundCircle 660 function expertizeRoundCircle () { 661 var rounderContainer = $('.piechart'); 662 if (rounderContainer.length) { 663 rounderContainer.each(function () { 664 var Self = $(this); 665 var value = Self.data('value'); 666 var size = Self.parent().width(); 667 var color = Self.data('fg-color'); 668 669 Self.find('span').each(function () { 670 var expertCount = $(this); 671 expertCount.appear(function () { 672 expertCount.countTo({ 673 from: 1, 674 to: value*100, 675 speed: 3000 676 }); 677 }); 678 679 });
680 Self.appear(function () { 681 Self.circleProgress({ 682 value: value, 683 size: 120, 684 thickness: 3, 685 emptyFill: '#f45b5b', 686 animation: { 687 duration: 3000 688 }, 689 fill: { 690 color: color 691 } 692 }); 693 }); 694 }); 695 }; 696 } 697 698 699 ///////////////////////////// 700 //Universal Code for All Owl Carousel Sliders 701 ///////////////////////////// 702 703 if ($('.theme_carousel').length) { 704 $(".theme_carousel").each(function (index) { 705 var $owlAttr = {}, 706 $extraAttr = $(this).data("options"); 707 $.extend($owlAttr, $extraAttr); 708 $(this).owlCarousel($owlAttr); 709 }); 710 } 711 712 713 714 if ($('#datepicker').length) { 715 $('#datepicker').datepicker(); 716 }; 717 718 if ($('ul.special-checkbox').length) { 719 $('ul.special-checkbox').find('li').on('click', function () { 720 $(this).toggleClass('active'); 721 }); 722 }; 723 724 if ($('.select-input').length) { 725 $('.select-input').selectmenu(); 726 }; 727 728 if ($('.thm-spinner').length) { 729 var spinnerMin = $('.thm-spinner').data('min-value'); 730 var spinnerMax = $('.thm-spinner').data('max-value'); 731 var spinnerDefault = $('.thm-spinner').data('default-value'); 732 $('.thm-spinner').slider({ 733 range: 'min', 734 min: spinnerMin, 735 max: spinnerMax, 736 value: spinnerDefault, 737 slide: function( event, ui ) { 738 $( '.vehicle-year' ).val( ui.value ); 739 } 740 }); 741 $( '.vehicle-year' ).val( $('.thm-spinner').slider('value') ); 742 }; 743 744 //Jquery Knob animation 745 if ($('.dial').length) { 746 $('.dial').appear(function() { 747 var elm = $(this); 748 var color = elm.attr('data-fgColor'); 749 var perc = elm.attr('value'); 750 elm.knob({ 751 'value': 0, 752 'min': 0, 753 'max': 100, 754 'skin': 'tron', 755 'readOnly': true, 756 'thickness': 0.10, 757 'dynamicDraw': true, 758 'displayInput': false 759 }); 760 $({ 761 value: 0 762 }).animate({ 763 value: perc 764 }, { 765 duration: 2000, 766 easing: 'swing', 767 progress: function() { 768 elm.val(Math.ceil(this.value)).trigger('change'); 769 } 770 }); 771 //circular progress bar color 772 $(this).append(function() { 773 // elm.parent().parent().find('.circular-bar-content').css('color',color); 774 //elm.parent().parent().find('.circular-bar-content .txt').text(perc); 775 }); 776 }, { 777 accY: 20 778 }); 779 } 780 781 782 /* ========================================================================= 783 When document is Scrollig, do 784 ========================================================================== */ 785 786 jQuery(document).on('ready', function () { 787 (function ($) { 788 // add your functions 789 directionswitch(); 790 })(jQuery); 791 }); 792 793 794 795 /* ========================================================================== 796 When document is Scrollig, do 797 ========================================================================== */ 798 799 $(window).on('scroll', function() { 800 headerStyle(); 801 }); 802 803 804 805 /* ========================================================================== 806 When document is loaded, do 807 ========================================================================== */ 808 809 $(window).on('load', function() { 810 handlePreloader(); 811 enableMasonry(); 812 }); 813 814 815 816})(window.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.