1/** 2Core script to handle the entire theme and core functions 3**/ 4var BeautyZone = function(){ 5 /* Search Bar ============ */ 6 siteUrl = ''; 7 8 var screenWidth = $( window ).width(); 9 10 var homeSearch = function() { 11 'use strict'; 12 /* top search in header on click function */ 13 var quikSearch = jQuery("#quik-search-btn"); 14 var quikSearchRemove = jQuery("#quik-search-remove"); 15 16 quikSearch.on('click',function() { 17 jQuery('.dlab-quik-search').animate({'width': '100%' }); 18 jQuery('.dlab-quik-search').delay(500).css({'left': '0' }); 19 }); 20 21 quikSearchRemove.on('click',function() { 22 jQuery('.dlab-quik-search').animate({'width': '0%' , 'right': '0' }); 23 jQuery('.dlab-quik-search').css({'left': 'auto' }); 24 }); 25 /* top search in header on click function End*/ 26 } 27 28 var cartButton = function(){ 29 $(".item-close").on('click',function(){ 30 $(this).closest(".cart-item").hide('500'); 31 }); 32 $('.cart-btn').unbind().on('click',function(){ 33 $(".cart-list").slideToggle('slow'); 34 }) 35 36 } 37 38 39 /* One Page Layout ============ */ 40 var onePageLayout = function() { 41 'use strict'; 42 var headerHeight = parseInt($('.onepage').css('height'), 10); 43 $(".scroll").unbind().on('click',function(event) 44 { 45 event.preventDefault(); 46 47 if (this.hash !== "") { 48 var hash = this.hash; 49 var seactionPosition = $(hash).offset().top; 50 var headerHeight = parseInt($('.onepage').css('height'), 10); 51 52 53 $('body').scrollspy({target: ".navbar", offset: headerHeight+2}); 54 55 var scrollTopPosition = seactionPosition - (headerHeight); 56 57 $('html, body').animate({ 58 scrollTop: scrollTopPosition 59 }, 800, function(){ 60 61 }); 62 } 63 }); 64 $('body').scrollspy({target: ".navbar", offset: headerHeight + 2}); 65 } 66 67 /* Header Height ============ */ 68 var handleResizeElement = function(){ 69 $('.header').css('height',''); 70 var headerHeight = $('.header').height(); 71 $('.header').css('height', headerHeight); 72 } 73 74 /* Load File ============ */ 75 var dzTheme = function(){ 76 'use strict'; 77 var loadingImage = '<img src="images/loading.gif">'; 78 jQuery('.dzload').each(function(){ 79 var dzsrc = siteUrl + $(this).attr('dzsrc'); 80 //jQuery(this).html(loadingImage); 81 jQuery(this).hide(function(){ 82 jQuery(this).load(dzsrc, function(){ 83 jQuery(this).fadeIn('slow'); 84 }); 85 }) 86 87 }); 88 //alert(screenWidth); 89 if(screenWidth < 991) 90 { 91 if($('.mo-left .header-nav').children('div').length == 0){ 92 var logoData = jQuery('<div>').append($('.mo-left .logo-header').clone()).html(); 93 jQuery('.mo-left .header-nav').prepend(logoData); 94 jQuery('.mo-left .header-nav .logo-header > a > img').attr('src','images/logo.png'); 95 jQuery('.mo-left.lw .header-nav .logo-header > a > img').attr('src','images/logo-white.png'); 96 } 97 }else{ 98 jQuery('.mo-left .header-nav div').empty(); 99 jQuery('.mo-left.lw .header-nav div').empty(); 100 } 101 102 if(screenWidth <= 991 ){ 103 jQuery('.navbar-nav > li > a, .sub-menu > li > a').unbind().on('click', function(e){ 104 //e.preventDefault(); 105 if(jQuery(this).parent().hasClass('open')) 106 { 107 jQuery(this).parent().removeClass('open'); 108 } 109 else{ 110 jQuery(this).parent().parent().find('li').removeClass('open'); 111 jQuery(this).parent().addClass('open'); 112 } 113 }); 114 } 115 } 116 117 /* Magnific Popup ============ */ 118 var MagnificPopup = function(){ 119 'use strict'; 120 /* magnificPopup function */ 121 if(jQuery('.mfp-gallery').length) { 122 jQuery('.mfp-gallery').magnificPopup({ 123 delegate: '.mfp-link', 124 type: 'image', 125 tLoading: 'Loading image #%curr%...', 126 mainClass: 'mfp-img-mobile', 127 gallery: { 128 enabled: true, 129 navigateByImgClick: true, 130 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 131 }, 132 image: { 133 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 134 titleSrc: function(item) { 135 return item.el.attr('title') + '<small></small>'; 136 } 137 } 138 }); 139 } 140 /* magnificPopup function end */ 141 142 /* magnificPopup for paly video function */ 143 if(jQuery('.video').length) { 144 jQuery('.video').magnificPopup({ 145 type: 'iframe', 146 iframe: { 147 markup: '<div class="mfp-iframe-scaler">'+ 148 '<div class="mfp-close"></div>'+ 149 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ 150 '<div class="mfp-title">Some caption</div>'+ 151 '</div>' 152 }, 153 callbacks: { 154 markupParse: function(template, values, item) { 155 values.title = item.el.attr('title'); 156 } 157 } 158 }); 159 } 160 /* magnificPopup for paly video function end*/ 161 if(jQuery('.popup-youtube, .popup-vimeo, .popup-gmaps').length) { 162 $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 163 disableOn: 700, 164 type: 'iframe', 165 mainClass: 'mfp-fade', 166 removalDelay: 160, 167 preloader: false, 168
169 fixedContentPos: false 170 }); 171 } 172 } 173 174 175 /* Scroll To Top ============ */ 176 var scrollTop = function (){ 177 'use strict'; 178 var scrollTop = jQuery("button.scroltop"); 179 /* page scroll top on click function */ 180 scrollTop.on('click',function() { 181 jQuery("html, body").animate({ 182 scrollTop: 0 183 }, 1000); 184 return false; 185 }) 186 187 jQuery(window).bind("scroll", function() { 188 var scroll = jQuery(window).scrollTop(); 189 if (scroll > 900) { 190 jQuery("button.scroltop").fadeIn(1000); 191 } else { 192 jQuery("button.scroltop").fadeOut(1000); 193 } 194 }); 195 /* page scroll top on click function end*/ 196 } 197 198 /* handle Accordian ============ */ 199 var handleAccordian = function(){ 200 /* accodin open close icon change */ 201 jQuery('#accordion').on('hidden.bs.collapse', function(e){ 202 jQuery(e.target) 203 .prev('.panel-heading') 204 .find("i.indicator") 205 .toggleClass('glyphicon-minus glyphicon-plus'); 206 }); 207 jQuery('#accordion').on('shown.bs.collapse', function(e){ 208 jQuery(e.target) 209 .prev('.panel-heading') 210 .find("i.indicator") 211 .toggleClass('glyphicon-minus glyphicon-plus'); 212 }); 213 /* accodin open close icon change end */ 214 } 215 216 /* handle Placeholder ============ */ 217 var handlePlaceholder = function(){ 218 /* input placeholder for ie9 & ie8 & ie7 */ 219 jQuery.support.placeholder = ('placeholder' in document.createElement('input')); 220 /* input placeholder for ie9 & ie8 & ie7 end*/ 221 222 /*fix for IE7 and IE8 */ 223 if (!jQuery.support.placeholder) { 224 jQuery("[placeholder]").focus(function () { 225 if (jQuery(this).val() == jQuery(this).attr("placeholder")) jQuery(this).val(""); 226 }).blur(function () { 227 if (jQuery(this).val() == "") jQuery(this).val(jQuery(this).attr("placeholder")); 228 }).blur(); 229 230 jQuery("[placeholder]").parents("form").submit(function () { 231 jQuery(this).find('[placeholder]').each(function() { 232 if (jQuery(this).val() == jQuery(this).attr("placeholder")) { 233 jQuery(this).val(""); 234 } 235 }); 236 }); 237 } 238 /*fix for IE7 and IE8 end */ 239 } 240 241 /* Equal Height ============ */ 242 var equalHeight = function(container) { 243 244 if(jQuery(container).length == 0) 245 { 246 return false 247 } 248 249 var currentTallest = 0, 250 currentRowStart = 0, 251 rowDivs = new Array(), 252 $el, topPosition = 0; 253 254 $(container).each(function() { 255 $el = $(this); 256 $($el).height('auto') 257 topPostion = $el.position().top; 258 259 if (currentRowStart != topPostion) { 260 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 261 rowDivs[currentDiv].height(currentTallest); 262 } 263 rowDivs.length = 0; // empty the array 264 currentRowStart = topPostion; 265 currentTallest = $el.height(); 266 rowDivs.push($el); 267 } else { 268 rowDivs.push($el); 269 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 270 } 271 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 272 rowDivs[currentDiv].height(currentTallest); 273 } 274 }); 275 276 277 /* 278 279 var currentTallest = 0, 280 currentRowStart = 0, 281 rowDivs = new Array(), 282 $el, topPosition = 0; 283 284 $(container).each(function() { 285 $el = $(this); 286 $($el).height('auto') 287 topPostion = $el.position().top; 288 289 if (currentRowStart != topPostion) { 290 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 291 rowDivs[currentDiv].height(currentTallest); 292 } 293 rowDivs.length = 0; // empty the array 294 currentRowStart = topPostion; 295 currentTallest = $el.height(); 296 rowDivs.push($el); 297 } else { 298 rowDivs.push($el); 299 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 300 } 301 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 302 rowDivs[currentDiv].height(currentTallest); 303 } 304 }); 305 306 */ 307 } 308 309 /* Footer Align ============ */ 310 var footerAlign = function() { 311 'use strict'; 312 jQuery('.site-footer').css('display', 'block'); 313 jQuery('.site-footer').css('height', 'auto'); 314 var footerHeight = jQuery('.site-footer').outerHeight(); 315 if(screenWidth > 1280){ 316 jQuery('.footer-fixed > .page-wraper').css('padding-bottom', footerHeight); 317 } 318 jQuery('.site-footer').css('height', footerHeight); 319 } 320 321 /* File Input ============ */ 322 var fileInput = function(){ 323 'use strict'; 324 /* Input type file jQuery */ 325 jQuery(document).on('change', '.btn-file :file', function() { 326 var input = jQuery(this); 327 var numFiles = input.get(0).files ? input.get(0).files.length : 1; 328 var label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); 329 input.trigger('fileselect', [numFiles, label]); 330 }); 331 332 jQuery('.btn-file :file').on('fileselect', function(event, numFiles, label) { 333 input = jQuery(this).parents('.input-group').find(':text'); 334 var log = numFiles > 10 ? numFiles + ' files selected' : label; 335 336 if (input.length) { 337 input.val(log); 338 } else { 339 if (log) alert(log); 340 } 341 }); 342 /* Input type file jQuery end*/ 343 } 344 345 /* Header Fixed ============ */ 346 var headerFix = function(){ 347 'use strict'; 348 /* Main navigation fixed on top when scroll down function custom */ 349 jQuery(window).bind('scroll', function () { 350 if(jQuery('.sticky-header').length) 351 { 352 var menu = jQuery('.sticky-header'); 353 if ($(window).scrollTop() > menu.offset().top) { 354 menu.addClass('is-fixed'); 355 } else { 356 menu.removeClass('is-fixed'); 357 } 358 } 359 }); 360 /* Main navigation fixed on top when scroll down function custom end*/ 361 } 362 363 /* Masonry Box ============ */ 364 var masonryBox = function(){ 365 'use strict'; 366 /* masonry by = bootstrap-select.min.js */ 367 if(jQuery('#masonry, .masonry').length) 368 { 369 var self = $("#masonry, .masonry"); 370 if(jQuery('.card-container').length) 371 { 372 self.imagesLoaded(function () { 373 self.masonry({ 374 gutterWidth: 15, 375 isAnimated: true, 376 itemSelector: ".card-container" 377 });
378 }); 379 } 380 } 381 if(jQuery('.filters').length) 382 { 383 jQuery(".filters").on('click','li',function(e) { 384 e.preventDefault(); 385 var filter = $(this).attr("data-filter"); 386 self.masonryFilter({ 387 filter: function () { 388 if (!filter) return true; 389 //return $(this).attr("data-filter") == filter; 390 return $(this).hasClass(filter); 391 } 392 }); 393 }); 394 } 395 /* masonry by = bootstrap-select.min.js end */ 396 } 397 398 399 /* Set Div Height ============ */ 400 var setDivHeight = function(){ 401 'use strict'; 402 var allHeights = []; 403 jQuery('.dzseth > div, .dzseth .img-cover, .dzseth .seth').each(function(e){ 404 allHeights.push(jQuery(this).height()); 405 }) 406 407 jQuery('.dzseth > div, .dzseth .img-cover, .dzseth .seth').each(function(e){ 408 var maxHeight = Math.max.apply(Math,allHeights); 409 jQuery(this).css('height',maxHeight); 410 }) 411 412 allHeights = []; 413 /* Removice */ 414 //var screenWidth = $( window ).width(); 415 if(screenWidth < 991) 416 { 417 jQuery('.dzseth > div, .dzseth .img-cover, .dzseth .seth').each(function(e){ 418 jQuery(this).css('height',''); 419 }) 420 } 421 } 422 423 /* Counter Number ============ */ 424 var counter = function(){ 425 if(jQuery('.counter').length) 426 { 427 jQuery('.counter').counterUp({ 428 delay: 10, 429 time: 3000 430 }); 431 } 432 } 433 434 /* Video Popup ============ */ 435 var handleVideo = function(){ 436 /* Video responsive function */ 437 jQuery('iframe[src*="youtube.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>'); 438 jQuery('iframe[src*="vimeo.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>'); 439 /* Video responsive function end */ 440 } 441 442 /* Gallery Filter ============ */ 443 var handleFilterMasonary = function(){ 444 /* gallery filter activation = jquery.mixitup.min.js */ 445 if (jQuery('#image-gallery-mix').length) { 446 jQuery('.gallery-filter').find('li').each(function () { 447 $(this).addClass('filter'); 448 }); 449 jQuery('#image-gallery-mix').mixItUp(); 450 }; 451 if(jQuery('.gallery-filter.masonary').length){ 452 jQuery('.gallery-filter.masonary').on('click','span', function(){ 453 var selector = $(this).parent().attr('data-filter'); 454 jQuery('.gallery-filter.masonary span').parent().removeClass('active'); 455 jQuery(this).parent().addClass('active'); 456 jQuery('#image-gallery-isotope').isotope({ filter: selector }); 457 return false; 458 }); 459 } 460 /* gallery filter activation = jquery.mixitup.min.js */ 461 } 462 463 /* handle Bootstrap Select ============ */ 464 var handleBootstrapSelect = function(){ 465 /* Bootstrap Select box function by = bootstrap-select.min.js */ 466 if (jQuery('select').length) { 467 jQuery('select').selectpicker(); 468 } 469 /* Bootstrap Select box function by = bootstrap-select.min.js end*/ 470 } 471 472 /* handle Bootstrap Touch Spin ============ */ 473 var handleBootstrapTouchSpin = function(){ 474 if(jQuery("input[name='demo_vertical2']").length) { 475 jQuery("input[name='demo_vertical2']").TouchSpin({ 476 verticalbuttons: true, 477 verticalupclass: 'ti-plus', 478 verticaldownclass: 'ti-minus' 479 }); 480 } 481 482 } 483 /* Resizebanner ============ */ 484 var handleBannerResize = function(){ 485 $(".full-height").css("height", $(window).height()); 486 } 487 488 /* Countdown ============ */ 489 var handleCountDown = function(WebsiteLaunchDate){ 490 /* Time Countr Down Js */ 491 if($(".countdown").length) 492 { 493 $('.countdown').countdown({date: WebsiteLaunchDate+' 23:5'}, function() { 494 $('.countdown').text('we are live'); 495 }); 496 } 497 /* Time Countr Down Js End */ 498 } 499 500 /* Content Scroll ============ */ 501 var handleCustomScroll = function(){ 502 /* all available option parameters with their default values */ 503 if($(".content-scroll").length) 504 { 505 $(".content-scroll").mCustomScrollbar({ 506 setWidth:false, 507 setHeight:false, 508 axis:"y" 509 }); 510 } 511 } 512 513 /* WOW ANIMATION ============ */ 514 var wow_animation = function(){ 515 if($('.wow').length > 0) 516 { 517 var wow = new WOW( 518 { 519 boxClass: 'wow', // animated element css class (default is wow) 520 animateClass: 'animated', // animation css class (default is animated) 521 offset: 50, // distance to the element when triggering the animation (default is 0) 522 mobile: false // trigger animations on mobile devices (true is default) 523 }); 524 wow.init(); 525 } 526 } 527 528 /* Left Menu ============ */ 529 var handleSideBarMenu = function(){ 530 $('.openbtn').on('click',function(e){
531 e.preventDefault(); 532 if($('#mySidenav').length > 0) 533 { 534 document.getElementById("mySidenav").style.left = "0"; 535 } 536 537 if($('#mySidenav1').length > 0) 538 { 539 document.getElementById("mySidenav1").style.right = "0"; 540 } 541 542 }) 543 544 $('.closebtn').on('click',function(e){ 545 e.preventDefault(); 546 if($('#mySidenav').length > 0) 547 { 548 document.getElementById("mySidenav").style.left = "-300px"; 549 } 550 551 if($('#mySidenav1').length > 0) 552 { 553 document.getElementById("mySidenav1").style.right = "-820px"; 554 } 555 }) 556 } 557 558 /* Range ============ */ 559 var priceslider = function(){ 560 561 if($(".price-slide, .price-slide-2").length > 0 ) { 562 $("#slider-range,#slider-range-2").slider({ 563 range: true, 564 min: 300, 565 max: 4000, 566 values: [0, 5000], 567 slide: function(event, ui) { 568 var min = ui.values[0], 569 max = ui.values[1]; 570 $('#' + this.id).prev().val("$" + min + " - $" + max); 571 } 572 }); 573 } 574 } 575 576 /* BGEFFECT ============ */ 577 var handleBGElements = function(){ 578 579 if(screenWidth > 1023) 580 { 581 if(jQuery('.bgeffect').length) 582 { 583 var s = skrollr.init({ 584 edgeStrategy: 'set', 585 easing: { 586 WTF: Math.random, 587 inverted: function(p) { 588 return 1-p; 589 } 590 } 591 }); 592 } 593 } 594 } 595 596 var boxHover = function(){ 597 598 jQuery('.box-hover').on('mouseenter',function(){ 599 jQuery('.box-hover').removeClass('active'); 600 jQuery(this).addClass('active'); 601 602 }) 603 } 604 605 var reposition = function (){ 606 'use strict'; 607 var modal = jQuery(this), 608 dialog = modal.find('.modal-dialog'); 609 modal.css('display', 'block'); 610 611 /* Dividing by two centers the modal exactly, but dividing by three 612 or four works better for larger screens. */ 613 dialog.css("margin-top", Math.max(0, (jQuery(window).height() - dialog.height()) / 2)); 614 } 615 616 var handleResize = function (){ 617 618 /* Reposition when the window is resized */ 619 jQuery(window).on('resize', function() { 620 jQuery('.modal:visible').each(reposition); 621 if(jQuery('.equal-wraper').length){ 622 equalHeight('.equal-wraper .equal-col'); 623 } 624 footerAlign(); 625 }); 626 } 627 628 var handlePlaceholderAnimation = function() 629 { 630 if(jQuery('.dezPlaceAni').length) 631 { 632 633 $('input, textarea').focus(function(){ 634 $(this).parents('.form-group').addClass('focused'); 635 }); 636 637 $('input, textarea').blur(function(){ 638 var inputValue = $(this).val(); 639 if ( inputValue == "" ) { 640 $(this).removeClass('filled'); 641 $(this).parents('.form-group').removeClass('focused'); 642 } else { 643 $(this).addClass('filled'); 644 } 645 }) 646 } 647 } 648 649 var handleSupport = function(){ 650 var support = '<a href="#" class="#"><i class="ti-shopping-cart"></i><span>CALL US</span></a><a href="#" class="bt-support-now theme-btn"><i class="ti-headphone-alt"></i><span>Support</span></a><!-- Go to --><script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5b221c5e31b4e54b"></script>'; 651 jQuery('body').append(support); 652 } 653 654 /* Website Launch Date */ 655 var WebsiteLaunchDate = new Date(); 656 monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
656November", "December"]; 657 WebsiteLaunchDate.setMonth(WebsiteLaunchDate.getMonth() + 1); 658 WebsiteLaunchDate = WebsiteLaunchDate.getDate() + " " + monthNames[WebsiteLaunchDate.getMonth()] + " " + WebsiteLaunchDate.getFullYear(); 659 /* Website Launch Date END */ 660 661 662 /* Function ============ */ 663 return { 664 init:function(){ 665 boxHover(); 666 wow_animation(); 667 priceslider(); 668 onePageLayout(); 669 dzTheme(); 670 handleResizeElement(); 671 homeSearch(); 672 MagnificPopup(); 673 handleAccordian(); 674 scrollTop(); 675 handlePlaceholder(); 676 handlePlaceholderAnimation(); 677 footerAlign(); 678 fileInput(); 679 headerFix(); 680 setDivHeight(); 681 handleVideo(); 682 handleCountDown(WebsiteLaunchDate); 683 handleCustomScroll(); 684 handleSideBarMenu(); 685 cartButton(); 686 handleBannerResize(); 687 handleResize(); 688 jQuery('.modal').on('show.bs.modal', reposition); 689 }, 690 691 load:function(){ 692 handleBGElements(); 693 handleBootstrapSelect(); 694 handleBootstrapTouchSpin(); 695 equalHeight('.equal-wraper .equal-col'); 696 counter(); 697 masonryBox(); 698 handleSupport(); 699 }, 700 701 resize:function(){ 702 screenWidth = $(window).width(); 703 dzTheme(); 704 handleSideBarMenu(); 705 setDivHeight(); 706 handleResizeElement(); 707 } 708 } 709 710}(); 711 712/* Document.ready Start */ 713jQuery(document).ready(function() { 714 715 BeautyZone.init(); 716 717 jQuery('.navicon').on('click',function(){ 718 $(this).toggleClass('open'); 719 }); 720}); 721/* Document.ready END */ 722 723/* Window Load START */ 724jQuery(window).on("load", function (e) { 725 BeautyZone.load(); 726 setTimeout(function(){ 727 jQuery('#loading-area').remove(); 728 }, 0); 729}); 730/* Window Load END */ 731/* Window Resize START */ 732jQuery(window).on('resize',function () { 733 'use strict'; 734 BeautyZone.resize(); 735}); 736/* Window Resize END */
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.