![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/app/design/frontend/Cnc/default/Magento_Theme/web/js/ |
/** * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @author Benoit Alix <[email protected]> * @copyright Copyright (c) 2019 Kaliop Digital Commerce (https://digitalcommerce.kaliop.com/) */ define([ "jquery", "tools", "slick", ], function ($, tools) { "use strict"; $(function () { var slideshows = { /** * Constructor */ init: function(){ this.defaultSlideshow(); this.mobileSlideshow(); this.keyFiguresSlideshow(); this.modalMobileSlideshow(); this.manufacturersSlideshow(); this.viewedProductsGrid(); this.brandFiltersSlideshow(); this.industriesSlideshow(); }, /** * Default Slideshow - 1 Slide Mobile / 3 Slide Desktop */ defaultSlideshow: function() { var defaultSlideshowContainer = $('[data-slideshow]'); if(defaultSlideshowContainer.length > 0 ){ defaultSlideshowContainer.slick({ arrows: true, slidesToShow: 3, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 2 } }, { breakpoint: 767, settings: { slidesToShow: 1 } } ] }) } }, /** * Default Slideshow Mobile Only - 1 Slide */ mobileSlideshow: function() { var mobileSlideshowContainer = $('[data-slideshow-mobile]'); if(mobileSlideshowContainer.length > 0 && tools.windowWidth < tools.md ){ mobileSlideshowContainer.slick({ arrows: true, slidesToShow: 1, slidesToScroll: 1 }) } }, /** * Custom Slideshow Mobile Only - Two Items Per Slide */ keyFiguresSlideshow: function() { var mobileSlideshowCustomContainer = $('[data-slideshow-mobile-custom]'); if(mobileSlideshowCustomContainer.length > 0 && tools.windowWidth < tools.md ){ mobileSlideshowCustomContainer.slick({ arrows: true, slidesToShow: 1, slidesToScroll: 1, rows: 2 }) } }, /** * Custom Slideshow Mobile Only - Two Items Per Slide */ modalMobileSlideshow: function() { $(document).on('ajax:addToCart:modal:opened', function() { var modalSlideshowContainer = $('.block.crosssell .product-items'); if(modalSlideshowContainer.length > 0){ modalSlideshowContainer.slick({ arrows: true, slidesToShow: 4, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3 } }, { breakpoint: 768, settings: { slidesToShow: 1 } } ] }) } }) }, /** * Manufacturers Slideshow */ manufacturersSlideshow: function() { var manufacturersContainer = $('[data-manufacturers-slideshow]'); if(manufacturersContainer.length > 0 && tools.windowWidth < tools.md ){ manufacturersContainer.slick({ arrows: true, slidesToShow: 2, slidesToScroll: 2, }) } }, /** * Cross Sell + Viewed Product Grid Slideshow */ viewedProductsGrid: function() { var productItems = $('.block-viewed-products-grid .product-items, .products-crosssell .product-items'); if(productItems.length > 0 ){ productItems.slick({ arrows: true, slidesToShow: 6, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 4 } }, { breakpoint: 767, settings: { slidesToShow: 3 } }, { breakpoint: 680, settings: { slidesToShow: 2 } }, { breakpoint: 560, settings: { slidesToShow: 1 } } ] }) } }, /** * Amasty Shop by brand filters */ brandFiltersSlideshow: function() { var brandFilterLettersBox = $('[data-brands-filter]'); if(brandFilterLettersBox.length > 0 && tools.windowWidth < tools.md ){ brandFilterLettersBox.slick({ arrows: true, slidesToShow: 8, slidesToScroll: 5, infinite: false, }) } }, /** * CsBlock Industries services slideshow */ industriesSlideshow: function() { var element = $('.industries-service-slideshow'), listItem = $('.list-container__item'); // Set first slideshow item active $('.list-container__item:first-child').addClass('is-active'); if(element.length > 0 ){ element.slick({ arrows: false, slidesToShow: 1, slidesToScroll: 1, infinite: false, fade: true, cssEase: 'linear', autoplay: false, speed: 100, }) } $('.industries-service-slideshow-nav > li').on('mouseover', function() { element.slick('slickGoTo',$(this).index()); listItem.removeClass('is-active'); $(this).addClass('is-active'); }) $('.industries-service-slideshow-nav').on('mouseleave', function() { element.slick('slickGoTo',$(this).index(1)); listItem.removeClass('is-active'); $('.list-container__item:first-child').addClass('is-active'); }) }, }; slideshows.init(); }); });