1(function($) { 2 3 "use strict"; 4 5 //Hide Loading Box (Preloader) 6 function handlePreloader() { 7 if($('.loader-wrap').length){ 8 $('.loader-wrap').delay(1000).fadeOut(500); 9 } 10 } 11 12 if ($(".preloader-close").length) { 13 $(".preloader-close").on("click", function(){ 14 $('.loader-wrap').delay(200).fadeOut(500); 15 }) 16 } 17 18 //Update Header Style and Scroll to Top 19 function headerStyle() { 20 if($('.main-header').length){ 21 var windowpos = $(window).scrollTop(); 22 var siteHeader = $('.main-header'); 23 var scrollLink = $('.scroll-top'); 24 if (windowpos >= 110) { 25 siteHeader.addClass('fixed-header'); 26 scrollLink.addClass('open'); 27 } else { 28 siteHeader.removeClass('fixed-header'); 29 scrollLink.removeClass('open'); 30 } 31 } 32 } 33 34 headerStyle(); 35 36 37 //Submenu Dropdown Toggle 38 if($('.main-header li.dropdown ul').length){ 39 $('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fas fa-angle-down"></span></div>'); 40 41 } 42 43 //Mobile Nav Hide Show 44 if($('.mobile-menu').length){ 45 46 $('.mobile-menu .menu-box').mCustomScrollbar(); 47 48 var mobileMenuContent = $('.main-header .menu-area .main-menu').html(); 49 $('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent); 50 $('.sticky-header .main-menu').append(mobileMenuContent); 51 52 //Dropdown Button 53 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 54 $(this).toggleClass('open'); 55 $(this).prev('ul').slideToggle(500); 56 }); 57 //Dropdown Button 58 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 59 $(this).prev('.megamenu').slideToggle(900); 60 }); 61 //Menu Toggle Btn 62 $('.mobile-nav-toggler').on('click', function() { 63 $('body').addClass('mobile-menu-visible'); 64 }); 65 66 //Menu Toggle Btn 67 $('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() { 68 $('body').removeClass('mobile-menu-visible'); 69 }); 70 } 71 72 73 // Scroll to a Specific Div 74 if($('.scroll-to-target').length){ 75 $(".scroll-to-target").on('click', function() { 76 var target = $(this).attr('data-target'); 77 // animate 78 $('html, body').animate({ 79 scrollTop: $(target).offset().top 80 }, 1000); 81 82 }); 83 } 84 85 // Elements Animation 86 if($('.wow').length){ 87 var wow = new WOW({ 88 mobile: false 89 }); 90 wow.init(); 91 } 92 93 94 //Fact Counter + Text Count 95 if($('.count-box').length){ 96 $('.count-box').appear(function(){ 97 98 var $t = $(this), 99 n = $t.find(".count-text").attr("data-stop"), 100 r = parseInt($t.find(".count-text").attr("data-speed"), 10); 101 102 if (!$t.hasClass("counted")) { 103 $t.addClass("counted"); 104 $({ 105 countNum: $t.find(".count-text").text() 106 }).animate({ 107 countNum: n 108 }, { 109 duration: r, 110 easing: "linear", 111 step: function() { 112 $t.find(".count-text").text(Math.floor(this.countNum)); 113 }, 114 complete: function() { 115 $t.find(".count-text").text(this.countNum); 116 } 117 }); 118 } 119 120 },{accY: 0}); 121 } 122 123 124 //LightBox / Fancybox 125 if($('.lightbox-image').length) { 126 $('.lightbox-image').fancybox({ 127 openEffect : 'fade', 128 closeEffect : 'fade', 129 helpers : { 130 media : {} 131 } 132 }); 133 } 134 135 136 //Tabs Box 137 if($('.tabs-box').length){ 138 $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) { 139 e.preventDefault(); 140 var target = $($(this).attr('data-tab')); 141 142 if ($(target).is(':visible')){ 143 return false; 144 }else{ 145 target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn'); 146 $(this).addClass('active-btn'); 147 target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0); 148 target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab'); 149 $(target).fadeIn(300); 150 $(target).addClass('active-tab'); 151 } 152 }); 153 } 154 155 156 157 //Accordion Box 158 if($('.accordion-box').length){ 159 $(".accordion-box").on('click', '.acc-btn', function() { 160 161 var outerBox = $(this).parents('.accordion-box'); 162 var target = $(this).parents('.accordion'); 163 164 if($(this).hasClass('active')!==true){ 165 $(outerBox).find('.accordion .acc-btn').removeClass('active'); 166 } 167 168 if ($(this).next('.acc-content').is(':visible')){ 169 return false;
170 }else{ 171 $(this).addClass('active'); 172 $(outerBox).children('.accordion').removeClass('active-block'); 173 $(outerBox).find('.accordion').children('.acc-content').slideUp(300); 174 target.addClass('active-block'); 175 $(this).next('.acc-content').slideDown(300); 176 } 177 }); 178 } 179 180 181 // banner-carousel 182 if ($('.banner-carousel').length) { 183 $('.banner-carousel').owlCarousel({ 184 loop:true, 185 margin:0, 186 nav:true, 187 animateOut: 'fadeOut', 188 animateIn: 'fadeIn', 189 active: true, 190 smartSpeed: 1000, 191 autoplay: 6000, 192 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 193 responsive:{ 194 0:{ 195 items:1 196 }, 197 600:{ 198 items:1 199 }, 200 800:{ 201 items:1 202 }, 203 1024:{ 204 items:1 205 } 206 } 207 }); 208 } 209 210 211 // news-carousel 212 if ($('.news-carousel').length) { 213 $('.news-carousel').owlCarousel({ 214 loop:true, 215 margin:0, 216 nav:true, 217 animateOut: 'fadeOut', 218 animateIn: 'fadeIn', 219 active: true, 220 smartSpeed: 1000, 221 autoplay: 5000, 222 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 223 responsive:{ 224 0:{ 225 items:1 226 }, 227 600:{ 228 items:1 229 }, 230 800:{ 231 items:1 232 }, 233 1024:{ 234 items:1 235 } 236 } 237 }); 238 } 239 240 241 //two-column-carousel 242 if ($('.two-column-carousel').length) { 243 $('.two-column-carousel').owlCarousel({ 244 loop:true, 245 margin:30, 246 nav:true, 247 smartSpeed: 1000, 248 autoplay: 500, 249 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 250 responsive:{ 251 0:{ 252 items:1 253 }, 254 480:{ 255 items:1 256 }, 257 600:{ 258 items:1 259 }, 260 800:{ 261 items:2 262 }, 263 1024:{ 264 items:2 265 } 266 } 267 }); 268 } 269 270 271 //three-item-carousel 272 if ($('.three-item-carousel').length) { 273 $('.three-item-carousel').owlCarousel({ 274 loop:true, 275 margin:15, 276 nav:true, 277 smartSpeed: 1000, 278 autoplay: 500, 279 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 280 responsive:{ 281 0:{ 282 items:1 283 }, 284 480:{ 285 items:1 286 }, 287 600:{ 288 items:2 289 }, 290 800:{ 291 items:2 292 }, 293 1024:{ 294 items:3 295 } 296 } 297 }); 298 } 299 300 301 // Four Item Carousel 302 if ($('.four-item-carousel').length) { 303 $('.four-item-carousel').owlCarousel({ 304 loop:true, 305 margin:15, 306 nav:true, 307 smartSpeed: 500, 308 autoplay: 5000, 309 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 310 responsive:{ 311 0:{ 312 items:1 313 }, 314 600:{ 315 items:2 316 }, 317 800:{ 318 items:2 319 }, 320 1024:{ 321 items:3 322 }, 323 1200:{ 324 items: 4 325 } 326 } 327 }); 328 } 329 330 331 // single-item-carousel 332 if ($('.single-item-carousel').length) { 333 $('.single-item-carousel').owlCarousel({ 334 loop:true, 335 margin:30, 336 nav:false, 337 smartSpeed: 3000, 338 autoplay: true, 339 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 340 responsive:{ 341 0:{ 342 items:1 343 }, 344 480:{ 345 items:1 346 }, 347 600:{ 348 items:1 349 }, 350 800:{ 351 items:1 352 }, 353 1200:{ 354 items:1 355 } 356 357 } 358 }); 359 } 360 361 // twitter-carousel 362 if ($('.twitter-carousel').length) { 363 $('.twitter-carousel').owlCarousel({ 364 loop:true, 365 margin:30, 366 nav:false, 367 smartSpeed: 3000, 368 autoplay: true, 369 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 370 responsive:{ 371 0:{ 372 items:1 373 }, 374 480:{ 375 items:1 376 }, 377 600:{ 378 items:1 379 }, 380 800:{ 381 items:1 382 }, 383 1200:{ 384 items:1 385 } 386 387 } 388 }); 389 } 390 391 // bx-slider 392 if($('.schedule-carousel').length){ 393 $('.schedule-carousel').bxSlider({ 394 395 auto:true, 396 mode:'vertical', 397 nextText: '<i class="fal fa-angle-up"></i>', 398 prevText: '<i class="fal fa-angle-down"></i>', 399 maxSlides: 1, 400 minSlides: 1, 401 moveSlides: 1, 402 pause: 5000, 403 speed: 700, 404 pager: true, 405 }); 406 } 407 408 //schedule Tabs 409 if($('.schedule-tab').length){ 410 $('.schedule-tab .schedule-tab-btns .p-tab-btn').on('click', function(e) { 411 e.preventDefault(); 412 var target = $($(this).attr('data-tab')); 413 414 if ($(target).hasClass('actve-tab')){ 415 return false;
416 }else{ 417 $('.schedule-tab .schedule-tab-btns .p-tab-btn').removeClass('active-btn'); 418 $(this).addClass('active-btn'); 419 $('.schedule-tab .p-tabs-content .p-tab').removeClass('active-tab'); 420 $(target).addClass('active-tab'); 421 $(".owl-carousel").owlCarousel('to', 0) 422 } 423 }); 424 } 425 426 //Add One Page nav 427 if($('.scroll-nav').length) { 428 $('.scroll-nav').onePageNav(); 429 } 430 431 432 //Sortable Masonary with Filters 433 function enableMasonry() { 434 if($('.sortable-masonry').length){ 435 436 var winDow = $(window); 437 // Needed variables 438 var $container=$('.sortable-masonry .items-container'); 439 var $filter=$('.filter-btns'); 440 441 $container.isotope({ 442 filter:'*', 443 masonry: { 444 columnWidth : '.masonry-item.small-column' 445 }, 446 animationOptions:{ 447 duration:500, 448 easing:'linear' 449 } 450 }); 451 452 453 // Isotope Filter 454 $filter.find('li').on('click', function(){ 455 var selector = $(this).attr('data-filter'); 456 457 try { 458 $container.isotope({ 459 filter : selector, 460 animationOptions: { 461 duration: 500, 462 easing : 'linear', 463 queue : false 464 } 465 }); 466 } catch(err) { 467 468 } 469 return false; 470 }); 471 472 473 winDow.on('resize', function(){ 474 var selector = $filter.find('li.active').attr('data-filter'); 475 476 $container.isotope({ 477 filter : selector, 478 animationOptions: { 479 duration: 500, 480 easing : 'linear', 481 queue : false 482 } 483 }); 484 }); 485 486 487 var filterItemA = $('.filter-btns li'); 488 489 filterItemA.on('click', function(){ 490 var $this = $(this); 491 if ( !$this.hasClass('active')) { 492 filterItemA.removeClass('active'); 493 $this.addClass('active'); 494 } 495 }); 496 } 497 } 498 499 enableMasonry(); 500 501 // bx-slider 502 if($('.hostory-slide').length){ 503 $('.hostory-slide').bxSlider({ 504 505 auto:true, 506 mode:'vertical', 507 nextText: '<i class="fal fa-angle-up"></i>', 508 prevText: '<i class="fal fa-angle-down"></i>', 509 maxSlides: 3, 510 minSlides: 3, 511 moveSlides: 1, 512 pause: 5000, 513 speed: 700, 514 pager: false, 515 }); 516 } 517 518 if ($('.testimonial-style-two .bxslider').length) { 519 $('.testimonial-style-two .bxslider').bxSlider({ 520 nextText: '<i class="fal fa-angle-right"></i>', 521 prevText: '<i class="fal fa-angle-left"></i>', 522 mode: 'fade', 523 auto: 'true', 524 speed: '700', 525 pagerCustom: '.testimonial-style-two .slider-pager .thumb-box' 526 }); 527 }; 528 529 530 //Jquery Spinner / Quantity Spinner 531 if($('.quantity-spinner').length){ 532 $("input.quantity-spinner").TouchSpin({ 533 verticalbuttons: true 534 }); 535 } 536 537 538 //Search Popup 539 if($('#search-popup').length){ 540 541 //Show Popup 542 $('.search-toggler').on('click', function() { 543 $('#search-popup').addClass('popup-visible'); 544 }); 545 $(document).keydown(function(e){ 546 if(e.keyCode === 27) { 547 $('#search-popup').removeClass('popup-visible'); 548 } 549 }); 550 //Hide Popup 551 $('.close-search,.search-popup .overlay-layer').on('click', function() { 552 $('#search-popup').removeClass('popup-visible'); 553 }); 554 } 555 556 // Screen Reader 557 console.log ($('.screen-reader-btn')); 558 $('.screen-reader-btn').on('click', function () { 559 window.open ($(this).attr('href')); 560 }); 561 562 563 // Progress Bar 564 if ($('.count-bar').length) { 565 $('.count-bar').appear(function(){ 566 var el = $(this); 567 var percent = el.data('percent'); 568 $(el).css('width',percent).addClass('counted'); 569 },{accY: -50}); 570 571 } 572 573 574 if($('.timer').length){ 575 $(function(){ 576 $('[data-countdown]').each(function() { 577 var $this = $(this), finalDate = $(this).data('countdown'); 578 $this.countdown(finalDate, function(event) { 579 $this.html(event.strftime('%D days %H:%M:%S')); 580 }); 581 }); 582 }); 583 584 $('.cs-countdown').countdown('').on('update.countdown', function(event) { 585 var $this = $(this).html(event.strftime('<div class="count-col"><span>%D</span><h6>days</h6></div> <div class="count-col"><span>%H</span><h6>Hours</h6></div> <div class="count-col"><span>%M</span><h6>Minutes</h6></div> <div class="count-col"><span>%S</span><h6>Seconds</h6></div>')); 586 }); 587 } 588 589 590 // page direction 591 function directionswitch() { 592 if ($('.page_direction').length) { 593 594 $('.direction_switch button').on('click', function() { 595 $('body').toggleClass(function(){ 596 return $(this).is('.rtl, .ltr') ? 'rtl ltr' : 'rtl'; 597 }) 598 }); 599 }; 600 } 601 602 603 // Date picker 604 function datepicker () { 605 if ($('#datepicker').length) { 606 $('#datepicker').datepicker(); 607 }; 608 } 609 610 /* ========================================================================= 611 When document is Scrollig, do 612 ========================================================================== */ 613 614 jQuery(document).on('ready', function () { 615 (function ($) { 616 // add your functions 617 directionswitch(); 618 datepicker (); 619 })(jQuery); 620 }); 621 622 623 624 /* ========================================================================== 625 When document is Scrollig, do 626 ========================================================================== */ 627 628 $(window).on('scroll', function() { 629 headerStyle(); 630 }); 631 632 633 634 /* ========================================================================== 635 When document is loaded, do 636 ========================================================================== */ 637 638 $(window).on('load', function() { 639 handlePreloader(); 640 enableMasonry(); 641 }); 642 643 644 645})(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.