(function ($) {
    "use strict";
    $(document).ready(function ($) {
        // SlickNav
        $('.main-menu-wrap').slicknav({

        });
        
        // Dropdown-menu Arro icon effect
        if ($.fn.siblings) {
            jQuery('.drop-menu').siblings('a').addClass('sub-siblings');

        }

        // Hero area Slider Carousel
        if ($.fn.owlCarousel) {
            jQuery("#factory-slides").owlCarousel({
                items: 1,
                loop: true,
                autoplay: true,
                dots: false,
                mouseDrag: false,
                nav: true,
                animation: true,
                autoplayTimeout: 5000,
                navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
            });
        }

        // Partners Logo area Carousel
        if ($.fn.owlCarousel) {
            $(".partners-logos").owlCarousel({
                loop: true,
                autoplay: true,
                dots: false,
                nav: false,
                autoplayTimeout: 5000,
                navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
                responsive: {
                    0: {
                        items: 1
                    },
                    600: {
                        items: 3
                    },
                    1000: {
                        items: 5
                    }
                }
            });
        }

        if ($.fn.isotope) {
            var factory_project = $(".factory-project-categories li");
            factory_project.on('click', function () {
                factory_project.removeClass("active");
                $(this).addClass("active");
                var selector = $(this).attr("data-filter");
                $(".all-projects-isotope").isotope({
                    filter: selector,
                    animationOptions: {
                        duration: 750,
                        easing: "linear",
                        queue: false,
                    }
                });
            });
        }
    });

    // site preloader -- also uncomment the div in the header and the css style for #preloader
    $(window).on('load', function () {
        $('.loader').fadeOut('slow', function () {
            $(this).remove();
        });

        jQuery(".preloader-wrap").fadeOut(1000, function () {
            $(this).remove();
        });

    });
})(jQuery);