(function ($) { // background color when scroll var initScrollNav = function () { var scroll = $(window).scrollTop(); if (scroll >= 200) { $('.navbar.fixed-top').addClass("bg-black"); } else { $('.navbar.fixed-top').removeClass("bg-black"); } } $(window).scroll(function () { initScrollNav(); }); // init Chocolat light box var initChocolat = function () { Chocolat(document.querySelectorAll('.image-link'), { imageSize: 'contain', loop: true, }) } "use strict"; window.addEventListener("load", (event) => { //isotope $('.isotope-container').isotope({ // options itemSelector: '.item', layoutMode: 'masonry', }); // Initialize Isotope var $container = $('.isotope-container').isotope({ // options itemSelector: '.item', layoutMode: 'masonry', }); //active button $('.filter-button').click(function () { $('.filter-button').removeClass('active'); $(this).addClass('active'); }); // Filter items on button click $('.filter-button').click(function () { var filterValue = $(this).attr('data-filter'); if (filterValue === '*') { // Show all items $container.isotope({ filter: '*' }); } else { // Show filtered items $container.isotope({ filter: filterValue }); } }); }); $(document).ready(function () { initChocolat(); /* Video */ var $videoSrc; $('.play-btn').click(function () { $videoSrc = $(this).data("src"); }); $('#myModal').on('shown.bs.modal', function (e) { $("#video").attr('src', $videoSrc + "?autoplay=1&modestbranding=1&showinfo=0"); }) $('#myModal').on('hide.bs.modal', function (e) { $("#video").attr('src', $videoSrc); }) $(".user-items .search-item").click(function () { $(".search-box").toggleClass('active'); $(".search-box .search-input").focus(); }); $(".close-button").click(function () { $(".search-box").toggleClass('active'); }); // ------------------------------------------------------------------------------ // // Swiper // ------------------------------------------------------------------------------ // var swiper = new Swiper(".product-swiper", { slidesPerView: 3, spaceBetween: 20, navigation: { nextEl: ".icon-arrow-right", prevEl: ".icon-arrow-left", }, pagination: { el: ".swiper-pagination", clickable: true, }, breakpoints: { 0: { slidesPerView: 1, spaceBetween: 20, }, 901: { slidesPerView: 2, spaceBetween: 10, }, 1280: { slidesPerView: 3, spaceBetween: 5, }, }, }); var swiper = new Swiper(".testimonial-swiper", { loop: true, pagination: { el: ".swiper-pagination", clickable: true, }, }); // product single page var thumb_slider = new Swiper(".product-thumbnail-slider", { autoplay: true, loop: true, spaceBetween: 8, slidesPerView: 4, freeMode: true, watchSlidesProgress: true, }); var large_slider = new Swiper(".product-large-slider", { autoplay: true, loop: true, spaceBetween: 10, effect: 'fade', thumbs: { swiper: thumb_slider, }, }); new DateTimePickerComponent.DatePicker('select-arrival-date'); new DateTimePickerComponent.DatePicker('select-departure-date'); }); // End of a document })(jQuery);