/*------------------------------------------------------------------ * Project: Yatriiworld * Author: CN-InfoTech * URL: hthttps://themeforest.net/user/cn-infotech * Created: 02/25/2021 ------------------------------------------------------------------- */ (function($) { "use strict"; /*======== Doucument Ready Function =========*/ jQuery(document).ready(function () { //CACHE JQUERY OBJECTS $("#status").fadeOut(); $("#preloader").delay(200).fadeOut("slow"); $("body").delay(200).css({ "overflow": "visible" }); /* Init Wow Js */ new WOW().init(); }); jQuery(document).ready(() => { jQuery('.js-video-button').modalVideo({ channel: 'vimeo' }); }); // Range sliders activation $(".range-slider-ui").each(function() { var minRangeValue = $(this).attr('data-min'); var maxRangeValue = $(this).attr('data-max'); var minName = $(this).attr('data-min-name'); var maxName = $(this).attr('data-max-name'); var unit = $(this).attr('data-unit'); $(this).slider({ range: true, min: minRangeValue, max: maxRangeValue, values: [minRangeValue, maxRangeValue], slide: function(event, ui) { event = event; var currentMin = parseInt(ui.values[0], 10); var currentMax = parseInt(ui.values[1], 10); $(this).children(".min-value").text(currentMin + " " + unit); $(this).children(".max-value").text(currentMax + " " + unit); $(this).children(".current-min").val(currentMin); $(this).children(".current-max").val(currentMax); } }); }); /* ------------------------------------------------------------------------ */ /* BACK TO TOP /* ------------------------------------------------------------------------ */ $(document).on('click', '#back-to-top, .back-to-top', () => { $('html, body').animate({ scrollTop: 0 }, '500'); return false; }); $(window).on('scroll', () => { if ($(window).scrollTop() > 500) { $('#back-to-top').fadeIn(200); } else { $('#back-to-top').fadeOut(200); } }); // Slick SLider $('.slider-store').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, dots: false, fade: true, autoplay: true, asNavFor: '.slider-thumbs' }); $('.slider-thumbs').slick({ slidesToShow: 5, slidesToScroll: 1, asNavFor: '.slider-store', dots: false, arrows: true, autoplay: true, centerMode: true, focusOnSelect: true, responsive: [{ breakpoint: 800, settings: { arrows:false, } }] }); $('.review-slider').slick({ infinite: true, slidesToShow: 2, slidesToScroll: 1, arrows: false, dots: false, rows:0, autoplay: true, speed: 2000, loop:true, responsive: [{ breakpoint: 800, settings: { slidesToShow: 1 } }] }); $('.review-slider1').slick({ infinite: true, slidesToShow: 2, slidesToScroll: 1, arrows: false, dots: false, rows:0, autoplay: true, speed: 5000, loop:true, responsive: [{ breakpoint: 1100, settings: { slidesToShow: 1 } }] }); $('.about-slider').slick({ infinite: true, slidesToShow: 1, slidesToScroll: 1, arrows: false, dots: false, autoplay: true, rows:0, speed: 4000, loop:true, responsive: [{ breakpoint: 700, settings: { arrows:false } }] }); $('.side-slider').slick({ infinite: true, slidesToShow: 1, slidesToScroll: 1, arrows: false, rows:0, dots: false, autoplay: true, speed: 4000, loop:true, }); $('.attract-slider').slick({ infinite: true, slidesToShow: 8, slidesToScroll: 1, arrows: false, dots: false, speed: 2000, rows:0, autoplay: true, draggable:false, responsive: [{ breakpoint: 1000, settings: { slidesToShow: 3 } }, { breakpoint: 600, settings: { slidesToShow: 2 } }, { breakpoint: 500, settings: { slidesToShow: 2 } }] }); $('.team-slider').slick({ infinite: true, slidesToShow: 3, slidesToScroll: 1, arrows: true, dots: false, autoplay: true, speed: 1000, rows:0, loop:true, responsive: [{ breakpoint: 1000, settings: { slidesToShow: 2 } }, { breakpoint: 750, settings: { slidesToShow: 1 } }] }); $('.item-slider').slick({ infinite: true, slidesToShow: 3, slidesToScroll: 1, arrows: false, dots: false, autoplay: true, speed: 2000, rows:0, loop:true, responsive: [{ breakpoint: 1000, settings: { slidesToShow: 2 } }, { breakpoint: 750, settings: { slidesToShow: 1 } }] }); $('.shop-slider').slick({ infinite: true, slidesToShow: 4, slidesToScroll: 1, arrows: false, dots: false, autoplay: true, speed: 8000, rows:0, loop:true, responsive: [{ breakpoint: 1000, settings: { slidesToShow: 2 } }, { breakpoint: 800, settings: { slidesToShow: 2 } }, { breakpoint: 600, settings: { slidesToShow: 1 } }] }); $('.banner-slider').slick({ infinite: true, slidesToShow: 4, slidesToScroll: 1, arrows: true, dots: true, autoplay: true, speed: 2000, rows:0, cursor: false, loop:true, responsive: [{ breakpoint: 1000, settings: { slidesToShow: 2 } }, { breakpoint: 800, settings: { slidesToShow: 1 } }] }); // Slick Testimonial Slider $('.sl-testimonial-slider').slick({ slidesToShow: 1, slidesToScroll: 1, vertical: true, verticalSwiping: true, autoplay: true, Speed: 8000, rows:0, infinite: true, arrows: false, dots: false, adaptiveHeight: true }); $('.partner-slider').slick({ infinite: true, slidesToShow: 5, slidesToScroll: 1, arrows: false, dots: false, autoplay: true, speed: 2000, rows:0, loop:true, responsive: [{ breakpoint: 1000, settings: { slidesToShow: 3 } }, { breakpoint: 800, settings: { slidesToShow: 2 } }, { breakpoint: 500, settings: { slidesToShow: 1 } }] }); // burgermenu $('.menu-ham').click(function () { $('.menu').animate({right: '0px'}, 50) $('.header_sidemenu_in .overlay').addClass('show').removeClass('hide'); }); $('.close-menu').click(function () { $('.menu').animate({right: '-500px'}, 50) $('.header_sidemenu_in .overlay').addClass('hide').removeClass('show'); }); $('.header_sidemenu_in .overlay').click(function () { $('.header_sidemenu_in .overlay').addClass('hide').removeClass('show'); $('.menu').animate({right: '-500px'}, 50) }); // bubbles ----------------- var bArray = []; var sArray = [2, 4, 6, 8]; for (var i = 0; i < $('.bubbles').width(); i++) { bArray.push(i); } function randomValue(arr) { return arr[Math.floor(Math.random() * arr.length)]; } setInterval(function () { var size = randomValue(sArray); $('.bubbles').append('
'); $('.individual-bubble').animate({ 'bottom': '100%', 'opacity': '-=0.7' }, 4000, function () { $(this).remove() }); }, 350); //search categories $('a[href="#search1"]').on('click', function(event) { event.preventDefault(); $('#search1').addClass('open'); $('#search1 > form > input[type="search"]').focus(); }); $('#search1, #search1 button.close').on('click keyup', function(event) { if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { $(this).removeClass('open'); } }); /*-------------------------------------------- Wicked Picker --------------------------------------------*/ $('.set-time').wickedpicker(); $('.selector').wickedpicker({ // current time now: new Date(), // 12- or 24-hour format twentyFour: false, // CSS classes upArrow: 'wickedpicker__controls__control-up', downArrow: 'wickedpicker__controls__control-down', close: 'wickedpicker__close', hoverState: 'hover-state', // title title: 'Timepicker' }); /*-----------------------------------------------------------------------------------*/ /* COUNTDOWN /*-----------------------------------------------------------------------------------*/ $(document).ready(() => { loopcounter('coming-counter'); }); /*-----------------------------------------------------------------------------------*/ /* COUNTER UP /*-----------------------------------------------------------------------------------*/ $('.value').counterUp({ delay: 50, time: 1000 }); /*-----------------------------------------------------------------------------------*/ /* MASONRY /*-----------------------------------------------------------------------------------*/ $('.blog-main').masonry({ // options itemSelector: '.mansonry-item', }); $('.trend-box1').masonry({ // options itemSelector: '.mansonry-item1', }); // Nice Select JS $('.niceSelect').niceSelect(); $('a[href="#search1"]').on('click', function(event) { event.preventDefault(); $('#search1').addClass('open'); $('#search1 > form > input[type="search"]').focus(); }); $('#search1, #search1 button.close').on('click keyup', function(event) { if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { $(this).removeClass('open'); } }); //Do not include! This prevents the form from submitting for DEMO purposes only! })(jQuery); jQuery(window).on('resize load', () => { resize_eb_slider(); }).resize(); /** * Resize slider */ function resize_eb_slider() { let bodyheight = jQuery(this).height(); if (jQuery(window).width() > 1400) { bodyheight *= 0.90; jQuery('.slider').css('height', `${bodyheight}px`); } }