jQuery.event.special.touchstart = {
    setup: function(_, ns, handle) {
        this.addEventListener("touchstart", handle, {
            passive: !ns.includes("noPreventDefault")
        });
    }
};
jQuery.event.special.touchmove = {
    setup: function(_, ns, handle) {
        this.addEventListener("touchmove", handle, {
            passive: !ns.includes("noPreventDefault")
        });
    }
};
jQuery.event.special.wheel = {
    setup: function(_, ns, handle) {
        this.addEventListener("wheel", handle, {
            passive: true
        });
    }
};
jQuery.event.special.mousewheel = {
    setup: function(_, ns, handle) {
        this.addEventListener("mousewheel", handle, {
            passive: true
        });
    }
};

jQuery(document).ready(function($) {
    $(function() {
        AOS.init({
            offset: 40,
            duration: 700,
            easing: "ease-out-quad",
            once: !0
        });
        window.addEventListener('load', AOS.refresh);
    });
    $('.nav-item.dropdown .dropdown .dropdown-toggle').on('click', function(e) {
        e.stopPropagation();
    });
});
window.addEventListener('load', function() {
    AOS.init();
});
$(document).ready(function() {
    // Function to check if URL has parameter thank-you with value true
    function checkURLParameter() {
        const urlParams = new URLSearchParams(window.location.search);
        return urlParams.has('thank-you') && urlParams.get('thank-you') === 'true';
    }

    // If URL parameter is found, open the modal
    if (checkURLParameter()) {
        $('#thank_you').modal('show');
    }

    $("button[data-bs-target='#view_sample']").each(function() {
        $(this).on('click', function() {
            var modal_image = $(".modal#view_sample .modal-body img");
            var pathIndex = modal_image.attr('src').lastIndexOf('/');
            var path = modal_image.attr('src').substring(0, pathIndex + 1);
            modal_image.attr('src', path + $(this).attr("data-image") + ".gif");
        });
    });
});