// source --> https://lstractorusa.com/wp-content/themes/weicks-media-base-theme/js/custom-scripts.js 
// ==============================
// *
// *  Custom scripts
// *  Weicks Media
// *
// ===============================

$(document).ready(function () {
    console.log("... DY ...");
});

// ===== Mobile Hamburger Menu Toggle Function =====
$(document).ready(function () {
    var $hamburger = $("button.hamburger");
    $hamburger.on("click", function () {
        $(this).toggleClass("is-active");
        $("#primary-menu").toggleClass("mobile-active");
    });
});

//====== Multi-Level Sub-Menu Drop Down Toggle =========
$(document).ready(function () {
    $("ul#primary-menu li a").on("click", function (e) {
        $(this).parent().parent().find(".sub-menu").hide();
        $(this).next("ul").toggle();
        e.stopPropagation();
    });
});

//====== Remove Author/Username on Frontend =========
$(document).ready(function () {
    $(".meta-author").remove();
});

// ======= Home Offers Carousel
$(document).ready(function () {
    $(".offers-carousel").slick({
        arrows: true,
        slidesToShow: 4,
        autoplay: true,
        autoplaySpeed: 3000,
        responsive: [
            {
                breakpoint: 1400,
                settings: {
                    slidesToShow: 3,
                },
            },
            {
                breakpoint: 992,
                settings: {
                    slidesToShow: 2,
                },
            },
            {
                breakpoint: 768,
                settings: {
                    slidesToShow: 1,
                },
            },
        ],
    });
});

// ======= Home Testimonials Carousel
$(document).ready(function () {
    $(".testimonials-carousel").slick({
        arrows: true,
        slidesToShow: 1,
        autoplay: false,
        autoplaySpeed: 6000,
        pauseOnHover: true,
        pauseOnFocus: true
    });

    //Stop autoplay scroll after slide is clicked
    $('.testimonials-carousel').on('click', function() {
        $(this).slick('slickPause');
        $(this).slick('slickSetOption', 'autoplay', false, true);
    });
});