// intialization plugins
$(document).ready(function () {

    //animation icon toggler of navbar
    $(`.navbar-toggler`).click(function() {
        $(`.navbar-toggler`).toggleClass(`active`);
    });

    // navbar-fixed-top
    $(function () {
        $(document).scroll(function () {
            var $nav = $(".navbar-fixed-top");
            $nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height());
        });
    });

    //Wow intit
    wow = new WOW({
        boxClass: 'wow',
        animateClass: 'animated',
        offset: 200,
        mobile: true,
        live: false
    });
    wow.init();

    //fancybox
    $("[data-fancybox]").fancybox({
        selector: '[data-fancybox="images"]',
        // loop: true
    });

    //  loader 
    // $(window).on("load", function() {
    //     $("#preloader").addClass("isdone");
    // });

});

// Swiper
$(document).ready(function () {

    //////////////////// features_swiper  ////////////////////
    var swiper = new Swiper('.features_sec .features_swiper', {
        // loop: true,
        speed: 900,
        slidesPerView: 1,
        spaceBetween: 20,
        // autoplay: {
        //     delay: 2500,
        // },
        navigation: {
            nextEl: '.features_sec .swiper-button-next',
            prevEl: '.features_sec .swiper-button-prev',
        },
        pagination: {
            el: '.features_sec .swiper-pagination',
            clickable: true
        },
        breakpoints: {
            640: {
                slidesPerView: 2,
            },
            1024: {
                slidesPerView: 3,
            },
        }
    });

    //////////////////// screens_swiper  ////////////////////
    var swiper = new Swiper('.screens_sec .screens_swiper', {
        loop: true,
        speed: 1100,
        slidesPerView: 1.5,
        spaceBetween: 15,
        centeredSlides: true,
        // simulateTouch:false,
        autoplay: {
            delay: 4000,
        },
        navigation: {
            nextEl: '.screens_sec .swiper-button-next',
            prevEl: '.screens_sec .swiper-button-prev',
        },
        pagination: {
            el: '.screens_sec .swiper-pagination',
            clickable: true
        },
        breakpoints: {
            768: {
                slidesPerView: 3,
                spaceBetween: 20,
            },
        }
    });

    //////////////////// features_swiper  ////////////////////
    var swiper = new Swiper('.feedback_sec .feedback_swiper', {
        loop: true,
        speed: 900,
        slidesPerView: 1,
        spaceBetween: 15,
        centeredSlides: true,
        // autoplay: {
        //     delay: 2500,
        // },
        navigation: {
            nextEl: '.feedback_sec .swiper-button-next',
            prevEl: '.feedback_sec .swiper-button-prev',
        },
        pagination: {
            el: '.feedback_sec .swiper-pagination',
            clickable: true
        },
        breakpoints: {
            640: {
                slidesPerView: 2,
                spaceBetween: 20,
            },
            1024: {
                slidesPerView: 3,
                spaceBetween: 20,
            },
        }
    });



    //////////////////// Swiper  ////////////////////
    // var swiper = new Swiper(' .swiper-container', {
    //     // loop: true,
    //     speed: 900,
    //     slidesPerView: 1,
    //     spaceBetween: 15,
    //     // autoplay: {
    //     //     delay: 2500,
    //     // },
    //     //In Tabs
    //     // observer: true,
    //     // observeParents: true,
    //     navigation: {
    //         nextEl: '.swiper-button-next',
    //         prevEl: '.swiper-button-prev',
    //     },
    //     pagination: {
    //         el: '.swiper-pagination',
    //         clickable: true
    //     },
    //     breakpoints: {
    //         640: {
    //             slidesPerView: 2,
    //             spaceBetween: 20,
    //         },
    //         768: {
    //             slidesPerView: 3,
    //             spaceBetween: 20,
    //         },
    //         1024: {
    //             slidesPerView: 5,
    //             spaceBetween: 20,
    //             // Prevent swiper in lg screens
    //             // allowTouchMove: false,
    //             // preventClicks: false
    //         },
    //     }
    // });

});


