<?php

/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_categories
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

use Joomla\CMS\Helper\ModuleHelper;

defined('_JEXEC') or die;
$moduleclass_sfx = $params->get('moduleclass_sfx', '');
?>
<div id="categories-module-<?php echo $module->id; ?>" class="categories-module categories-module<?php echo $moduleclass_sfx; ?> mod-slide" data-aos="fade-up" data-aos-delay="400">
  <div class="owl-carousel">
    <?php require ModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'grid') . '_items'); ?>
  </div>
</div>


<script>
(function($){
  jQuery(document).ready(function($) {
    $("#categories-module-<?php echo $module->id; ?> .owl-carousel").owlCarousel({
      addClassActive: true,
      items: 4,
      margin: 32,
      loop: true,
      nav : false,
      dots: true,
      slideTransition: 'linear',
      autoplayHoverPause: true,
      responsive : {
        // breakpoint from 0 up
        0 : {
          items: 1
        },

        // breakpoint from 480 up
        480 : {
          items: 2,
          margin: 16
        },

        // breakpoint from 768 up
        768 : {
          items: 2
        },

        // breakpoint from 992 up
        992 : {
          items: 3,
        },

        // breakpoint from 1440 up
        1440 : {
          items: 4
        }
      }
    });
  });
})(jQuery);
</script>