1(function($) { 2 3 "use strict"; 4 5 //Hide Loading Box (Preloader) 6 function handlePreloader() { 7 if($('.loader-wrap').length){ 8 $('.loader-wrap').delay(200).fadeOut(0); 9 } 10 } 11 12 if ($(".preloader-close").length) { 13 $(".preloader-close").on("click", function(){ 14 $('.loader-wrap').delay(0).slideDown(500); 15 }) 16 } 17 18 $(function() { 19 $('.theme-btn-one') 20 .on('mouseenter', function(e) { 21 var parentOffset = $(this).offset(), 22 relX = e.pageX - parentOffset.left, 23 relY = e.pageY - parentOffset.top; 24 $(this).find('span').css({top:relY, left:relX}) 25 }) 26 .on('mouseout', function(e) { 27 var parentOffset = $(this).offset(), 28 relX = e.pageX - parentOffset.left, 29 relY = e.pageY - parentOffset.top; 30 $(this).find('span').css({top:relY, left:relX}) 31 }); 32 }); 33 34 //Update Header Style and Scroll to Top 35 function headerStyle() { 36 if($('.main-header').length){ 37 var windowpos = $(window).scrollTop(); 38 var siteHeader = $('.main-header'); 39 var scrollLink = $('.scroll-top'); 40 if (windowpos >= 110) { 41 siteHeader.addClass('fixed-header'); 42 scrollLink.addClass('open'); 43 } else { 44 siteHeader.removeClass('fixed-header'); 45 scrollLink.removeClass('open'); 46 } 47 } 48 } 49 50 headerStyle(); 51 52 53 //Submenu Dropdown Toggle 54 if($('.main-header li.dropdown ul').length){ 55 $('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fas fa-angle-down"></span></div>'); 56 57 } 58 59 //Mobile Nav Hide Show 60 if($('.mobile-menu').length){ 61 62 63 var mobileMenuContent = $('.main-header .menu-area .main-menu').html(); 64 $('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent); 65 $('.sticky-header .main-menu').append(mobileMenuContent); 66 67 //Dropdown Button 68 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 69 $(this).toggleClass('open'); 70 $(this).prev('ul').slideToggle(500); 71 }); 72 //Dropdown Button 73 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 74 $(this).prev('.megamenu').slideToggle(900); 75 }); 76 //Menu Toggle Btn 77 $('.mobile-nav-toggler').on('click', function() { 78 $('body').addClass('mobile-menu-visible'); 79 }); 80 81 //Menu Toggle Btn 82 $('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() { 83 $('body').removeClass('mobile-menu-visible'); 84 }); 85 } 86 87 // Elements Animation 88 if($('.wow').length){ 89 var wow = new WOW({ 90 mobile: false 91 }); 92 wow.init(); 93 } 94 95 //Contact Form Validation 96 if($('#contact-form').length){ 97 $('#contact-form').validate({ 98 rules: { 99 username: { 100 required: true 101 }, 102 email: { 103 required: true, 104 email: true 105 }, 106 phone: { 107 required: true 108 }, 109 subject: { 110 required: true 111 }, 112 message: { 113 required: true 114 } 115 } 116 }); 117 } 118 119 //Fact Counter + Text Count 120 if($('.count-box').length){ 121 $('.count-box').appear(function(){ 122 123 var $t = $(this), 124 n = $t.find(".count-text").attr("data-stop"), 125 r = parseInt($t.find(".count-text").attr("data-speed"), 10); 126 127 if (!$t.hasClass("counted")) { 128 $t.addClass("counted"); 129 $({ 130 countNum: $t.find(".count-text").text() 131 }).animate({ 132 countNum: n 133 }, { 134 duration: r, 135 easing: "linear", 136 step: function() { 137 $t.find(".count-text").text(Math.floor(this.countNum)); 138 }, 139 complete: function() { 140 $t.find(".count-text").text(this.countNum); 141 } 142 }); 143 } 144 145 },{accY: 0}); 146 } 147 148 149 //LightBox / Fancybox 150 if($('.lightbox-image').length) { 151 $('.lightbox-image').fancybox({ 152 openEffect : 'fade', 153 closeEffect : 'fade', 154 helpers : { 155 media : {} 156 } 157 }); 158 } 159 160 161 //Tabs Box 162 if($('.tabs-box').length){ 163 $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) { 164 e.preventDefault(); 165 var target = $($(this).attr('data-tab')); 166 167 if ($(target).is(':visible')){ 168 return false; 169 }else{ 170 target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn'); 171 $(this).addClass('active-btn'); 172 target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0); 173 target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab'); 174 $(target).fadeIn(100); 175 $(target).addClass('active-tab'); 176 } 177 }); 178 } 179 180 181 182 //Accordion Box 183 if($('.accordion-box').length){ 184 $(".accordion-box").on('click', '.acc-btn', function() { 185 186 var outerBox = $(this).parents('.accordion-box'); 187 var target = $(this).parents('.accordion'); 188 189 if($(this).hasClass('active')!==true){ 190 $(outerBox).find('.accordion .acc-btn').removeClass('active'); 191 } 192 193 if ($(this).next('.acc-content').is(':visible')){ 194 return false;
195 }else{ 196 $(this).addClass('active'); 197 $(outerBox).children('.accordion').removeClass('active-block'); 198 $(outerBox).find('.accordion').children('.acc-content').slideUp(300); 199 target.addClass('active-block'); 200 $(this).next('.acc-content').slideDown(300); 201 } 202 }); 203 } 204 205 206 // banner-carousel 207 if ($('.banner-carousel').length) { 208 $('.banner-carousel').owlCarousel({ 209 loop:true, 210 margin:0, 211 nav:true, 212 animateOut: 'fadeOut', 213 animateIn: 'fadeIn', 214 active: true, 215 smartSpeed: 1000, 216 autoplay: 6000, 217 navText: [ '<span class="icon-9"></span>', '<span class="icon-8"></span>' ], 218 responsive:{ 219 0:{ 220 items:1 221 }, 222 600:{ 223 items:1 224 }, 225 800:{ 226 items:1 227 }, 228 1024:{ 229 items:1 230 } 231 } 232 }); 233 } 234 235 236 // single-item-carousel 237 if ($('.single-item-carousel').length) { 238 $('.single-item-carousel').owlCarousel({ 239 loop:true, 240 margin:30, 241 nav:true, 242 smartSpeed: 500, 243 autoplay: 1000, 244 navText: [ '<span class="icon-37"></span>', '<span class="icon-36"></span>' ], 245 responsive:{ 246 0:{ 247 items:1 248 }, 249 480:{ 250 items:1 251 }, 252 600:{ 253 items:1 254 }, 255 800:{ 256 items:1 257 }, 258 1200:{ 259 items:1 260 } 261 262 } 263 }); 264 } 265 266 267 // two-item-carousel 268 if ($('.two-item-carousel').length) { 269 $('.two-item-carousel').owlCarousel({ 270 loop:true, 271 margin:30, 272 nav:true, 273 smartSpeed: 500, 274 autoplay: 1000, 275 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 276 responsive:{ 277 0:{ 278 items:1 279 }, 280 480:{ 281 items:1 282 }, 283 600:{ 284 items:1 285 }, 286 800:{ 287 items:2 288 }, 289 1200:{ 290 items:2 291 } 292 293 } 294 }); 295 } 296 297 298 // three-item-carousel 299 if ($('.three-item-carousel').length) { 300 $('.three-item-carousel').owlCarousel({ 301 loop:true, 302 margin:30, 303 nav:true, 304 smartSpeed: 500, 305 autoplay: 1000, 306 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 307 responsive:{ 308 0:{ 309 items:1 310 }, 311 480:{ 312 items:1 313 }, 314 600:{ 315 items:2 316 }, 317 800:{ 318 items:2 319 }, 320 1200:{ 321 items:3 322 } 323 324 } 325 }); 326 } 327 328 329 // four-item-carousel 330 if ($('.four-item-carousel').length) { 331 $('.four-item-carousel').owlCarousel({ 332 loop:true, 333 margin:30, 334 nav:true, 335 smartSpeed: 500, 336 autoplay: 1000, 337 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 338 responsive:{ 339 0:{ 340 items:1 341 }, 342 480:{ 343 items:1 344 }, 345 600:{ 346 items:2 347 }, 348 800:{ 349 items:3 350 }, 351 1200:{ 352 items:4 353 } 354 355 } 356 }); 357 } 358 359 360 // five-item-carousel 361 if ($('.five-item-carousel').length) { 362 $('.five-item-carousel').owlCarousel({ 363 loop:true, 364 margin:30, 365 nav:true, 366 smartSpeed: 500, 367 autoplay: 1000, 368 navText: [ '<span class="fal fa-angle-left"></span>', '<span class="fal fa-angle-right"></span>' ], 369 responsive:{ 370 0:{ 371 items:1 372 }, 373 480:{ 374 items:2 375 }, 376 600:{ 377 items:3 378 }, 379 800:{ 380 items:4 381 }, 382 1200:{ 383 items:5 384 } 385 386 } 387 }); 388 } 389 390 391 //Add One Page nav 392 393 function onePageNav() { 394 if($('.scroll-nav').length) { 395 $('.scroll-nav').onePageNav(); 396 } 397 } 398 399 400 401 //nice select 402 $(document).ready(function() { 403 $('select:not(.ignore)').niceSelect(); 404 }); 405 406 //Sortable Masonary with Filters 407 function enableMasonry() { 408 if($('.sortable-masonry').length){ 409 410 var winDow = $(window); 411 // Needed variables 412 var $container=$('.sortable-masonry .items-container'); 413 var $filter=$('.filter-btns'); 414 415 $container.isotope({ 416 filter:'*', 417 masonry: { 418 columnWidth : '.masonry-item.small-column' 419 }, 420 animationOptions:{ 421 duration:500, 422 easing:'linear' 423 } 424 }); 425 426 427 // Isotope Filter 428 $filter.find('li').on('click', function(){ 429 var selector = $(this).attr('data-filter'); 430
431 try { 432 $container.isotope({ 433 filter : selector, 434 animationOptions: { 435 duration: 500, 436 easing : 'linear', 437 queue : false 438 } 439 }); 440 } catch(err) { 441 442 } 443 return false; 444 }); 445 446 447 winDow.on('resize', function(){ 448 var selector = $filter.find('li.active').attr('data-filter'); 449 450 $container.isotope({ 451 filter : selector, 452 animationOptions: { 453 duration: 500, 454 easing : 'linear', 455 queue : false 456 } 457 }); 458 }); 459 460 461 var filterItemA = $('.filter-btns li'); 462 463 filterItemA.on('click', function(){ 464 var $this = $(this); 465 if ( !$this.hasClass('active')) { 466 filterItemA.removeClass('active'); 467 $this.addClass('active'); 468 } 469 }); 470 } 471 } 472 473 enableMasonry(); 474 475 476 // Progress Bar 477 if ($('.count-bar').length) { 478 $('.count-bar').appear(function(){ 479 var el = $(this); 480 var percent = el.data('percent'); 481 $(el).css('width',percent).addClass('counted'); 482 },{accY: -50}); 483 484 } 485 486 487 //Search Popup 488 if($('#search-popup').length){ 489 490 //Show Popup 491 $('.search-toggler').on('click', function() { 492 $('#search-popup').addClass('popup-visible'); 493 }); 494 $(document).keydown(function(e){ 495 if(e.keyCode === 27) { 496 $('#search-popup').removeClass('popup-visible'); 497 } 498 }); 499 //Hide Popup 500 $('.close-search,.search-popup .overlay-layer').on('click', function() { 501 $('#search-popup').removeClass('popup-visible'); 502 }); 503 } 504 505 506 // Scroll top button 507 $('.scroll-top-inner').on("click", function () { 508 $('html, body').animate({scrollTop: 0}, 500); 509 return false; 510 }); 511 512 513 function handleScrollbar() { 514 const bHeight = $('body').height(); 515 const scrolled = $(window).innerHeight() + $(window).scrollTop(); 516 517 let percentage = ((scrolled / bHeight) * 100); 518 519 if (percentage > 100) percentage = 100; 520 521 $('.scroll-top-inner .bar-inner').css( 'width', percentage + '%'); 522 } 523 524 525 526 /* ========================================================================== 527 When document is Scrollig, do 528 ========================================================================== */ 529 530 $(window).on('scroll', function() { 531 headerStyle(); 532 handleScrollbar(); 533 if ($(window).scrollTop() > 200) { 534 $('.scroll-top-inner').addClass('visible'); 535 } else { 536 $('.scroll-top-inner').removeClass('visible'); 537 } 538 }); 539 540 541 542 /* ========================================================================== 543 When document is loaded, do 544 ========================================================================== */ 545 546 $(window).on('load', function() { 547 handlePreloader(); 548 enableMasonry(); 549 }); 550 551 552 553})(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.