123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- // lightbox
- // let gallery = new SimpleLightbox('.gallery a', {});
- // gallery.on('show.simplelightbox', function () {
- // // do something…
- // });
- // lightbox end
- // product details carousel
- // var galleryThumbs = new Swiper('.gallery-thumbs', {
- // loop: true,
- // loopedSlides: 1,
- // spaceBetween: 10,
- // slidesPerView: 2,
- // direction: 'vertical',
- // // centeredSlides: true,
- // freeMode: true,
- // breakpoints: {
- // 0: {
- // direction: 'horizontal',
- // spaceBetween: 5,
- // slidesPerView: 4,
- // centeredSlides: true,
- // },
- // 993: {
- // direction: 'vertical',
- // spaceBetween: 15,
- // slidesPerView: 4,
- // }
- // }
- // });
- // var galleryTop = new Swiper('.gallery-main', {
- // loop: true,
- // spaceBetween: 10,
- // loopedSlides: 1,
- // centeredSlides: true,
- // freeMode: true,
- // navigation: {
- // nextEl: '.swiper-button-next',
- // prevEl: '.swiper-button-prev',
- // },
- // thumbs: {
- // swiper: galleryThumbs,
- // },
- // });
- // product details carousel end
-
- // fileter sidebar function
- // filter open button
- const filterOpenBtn = document.querySelector("#filter-button");
- // filter close button
- const filterCloseBtn = document.querySelector('.filter-close-btn');
- // filter sidebar container
- const filterContainer = document.querySelector('.filter');
- // filter open open function
- if (filterOpenBtn && filterContainer) {
- filterOpenBtn.addEventListener("click", () => {
- filterContainer.classList.add("active")
- });
- }
-
- // filter close button
- if (filterContainer && filterCloseBtn) {
- filterCloseBtn.addEventListener("click", () => {
- filterContainer.classList.remove("active")
- });
- }
- // fileter sidebar function end
- // checkout sidebar function
- // checkout open desktop button
- const checkoutProductBtnDesktop = document.querySelector('.checkout-product-btn-desktop')
- // checkout open mobile button
- const checkoutProductBtnMobile = document.querySelector('.checkout-product-btn-mobile')
- // checkout close button
- const checkoutContainerCloseBtn = document.querySelector('.cross-btn')
- // checkout container
- const checkoutContainer = document.querySelector('.checkout-container')
- // checkout open function for desktop
- if(checkoutProductBtnDesktop && checkoutContainer && filterContainer) {
- checkoutProductBtnDesktop.addEventListener('click', () => {
- // hide fillter sidebar if open
- filterContainer.classList.remove("active")
- // open checkout sidebar
- checkoutContainer.style.display = "block";
- })
- };
- // checkout open function for mobile
- if(checkoutProductBtnMobile && checkoutContainer && filterContainer) {
- checkoutProductBtnMobile.addEventListener('click', () => {
-
- // hide fillter sidebar if open
- filterContainer.classList.remove("active");
- // open checkout sidebar
- checkoutContainer.style.display = "block";
- })
- };
- // checkout close function
- if(checkoutContainerCloseBtn && checkoutContainer) {
- checkoutContainerCloseBtn.addEventListener('click', () => {
- checkoutContainer.style.display = "none"
- })
- }
- // checkout sidebar function end
-
- // all carousel
- // homepage hero banner slider home page
- const bannerSlider = new Swiper(".bannerSlider", {
- spaceBetween: 30,
- centeredSlides: true,
- autoplay: {
- delay: 2500,
- disableOnInteraction: false,
- }
- });
- // category slider home page
- const categorySlider = new Swiper('.categorySlider', {
- loop: false,
- slidesPerView: 5,
- spaceBetween: 30,
- loopedSlides: 1,
- breakpoints: {
- 0: {
- slidesPerView: 3,
- },
- 576: {
- slidesPerView: 4,
- },
- 993: {
- slidesPerView: 5,
- }
- },
- navigation: {
- nextEl: ".swiper-button-next",
- prevEl: ".swiper-button-prev",
- },
- });
- // Feture brand slider home page
- const featuredBrands = new Swiper('.featuredBrands', {
- loop: false,
- slidesPerView: 4,
- spaceBetween: 30,
- loopedSlides: 1,
- navigation: false,
- breakpoints: {
- 0: {
- slidesPerView: 2,
- },
- 576: {
- slidesPerView: 3,
- },
- 993: {
- slidesPerView: 5,
- }
- },
- });
- // Feture brand slider home page
- const trendingStories = new Swiper('.trendingStories', {
- loop: true,
- slidesPerView: 3,
- spaceBetween: 30,
- loopedSlides: 1,
- navigation: false,
- breakpoints: {
- 0: {
- slidesPerView: 1,
- },
- 576: {
- slidesPerView: 2,
- },
- 993: {
- slidesPerView: 3,
- }
- },
- navigation: {
- nextEl: ".swiper-button-next",
- prevEl: ".swiper-button-prev",
- },
- });
- // all product nav slider brand slider all product page
- const allProductNav = new Swiper('.all-product-nav-slider', {
- loop: false,
- slidesPerView: 8,
- spaceBetween: 8,
- loopedSlides: 1,
- navigation: false
- });
- // // product details page carousel
- // thumb carousel
- var productThumb = new Swiper('.productThumb', {
- loop: true,
- loopedSlides: 1,
- spaceBetween: 10,
- slidesPerView: 2,
- direction: 'vertical',
- freeMode: true,
- breakpoints: {
- 0: {
- direction: 'horizontal',
- spaceBetween: 15,
- slidesPerView: 4,
- centeredSlides: true,
- },
- 993: {
- direction: 'vertical',
- spaceBetween: 15,
- slidesPerView: 3,
- }
- }
- });
- // productSlider carousel
- var productSlider = new Swiper('.productSlider', {
- loop: true,
- spaceBetween: 10,
- loopedSlides: 1,
- centeredSlides: true,
- freeMode: true,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- disabledClass: 'disabled_swiper_button'
- },
- thumbs: {
- swiper: productThumb,
- },
- });
- // all carousel end
- // simple light box
-
- let gallery = new SimpleLightbox('.gallery a', {});
- if(gallery) {
- gallery.on('show.simplelightbox', function () {
- // do something…
- });
- }
|