$(function () {
    //メニューアイコンクリック
    $('.nav-button').click(function () {
        $(this).toggleClass('active');

        if ($(this).hasClass('active')) {
            $('.gnav').addClass('active');
        } else {
            $('.gnav').removeClass('active');
        }

    });

    //メニュー内を閉じておく
    $('.gnav a[href]').click(function () {
        $('.gnav').removeClass('active');
        $('.nav-button').removeClass('active');

    });
});

/* Swiper */
const swiper = new Swiper('.swiper', {
    // Optional parameters
    slidesPerView: 1,
    spaceBetween: 30,
    loop: true,

    autoplay: {
        delay: 4000,
        disableOnInteraction: false,
    },

    breakpoints: {
        640: {
            slidesPerView: 2,
        },
        1024: {
            slidesPerView: 3,
        },
    },

    // If we need pagination
    pagination: {
        el: '.swiper-pagination',
    },

    // Navigation arrows
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },

    // And if we need scrollbar
    scrollbar: {
        el: '.swiper-scrollbar',
    },
});