
// fixed-header

window.addEventListener("scroll", function () {
    const header = document.querySelector(".main-hdr-area");

    if (window.scrollY >= 100) {
        header.classList.add("fixed-hdr");
    } else {
        header.classList.remove("fixed-hdr");
    }
});

// fixed-header


// home-page-bnr-slider

$(document).ready(function () {
    $(".hero-sldier").owlCarousel({
        items: 1,
        margin: 0,
        loop: true,
        autoplay: false,
        autoplayTimeout: 5000,
        animateOut: 'fadeOut',
        dots: false,
        nav: true,
        navText: [
            "<i class='fas fa-arrow-left'></i>",
            "<i class='fas fa-arrow-right'></i>"
        ]
    });
});


// home-page-bnr-slider


// testi-slider
$('.tesi-slider').owlCarousel({
    loop: true,
    margin: 10,
    nav: false,
    dots: true,
    autoplay: true,
    navText: [
        "<i class='fas fa-arrow-left'></i>",
        "<i class='fas fa-arrow-right'></i>"
    ],
    responsive: {
        0: {
            items: 1
        },
        600: {
            items: 2
        },
        1000: {
            items: 2
        }
    }
})

// testi-slider

// video

document.addEventListener("DOMContentLoaded", function () {
    const poster = document.getElementById("poster");
    const iframe = document.getElementById("main-video");

    if (!poster || !iframe) return;

    poster.addEventListener("click", function () {
        iframe.src = "https://www.youtube.com/embed/D-Xi7-8X_mM?autoplay=1&rel=0";
        iframe.style.display = "block";
        poster.style.display = "none";
    });
});

// video

// team-slider
$('.team-slider').owlCarousel({
    loop: true,
    margin: 0,
    nav: false,
    dots: true,
    // autoplay: true,
    navText: [
        "<i class='fas fa-arrow-left'></i>",
        "<i class='fas fa-arrow-right'></i>"
    ],
    responsive: {
        0: {
            items: 1
        },
        600: {
            items: 2
        },
        1000: {
            items: 3
        }
    }
})

// team-slider


// aboot-page-bg-slow-hide-anmi


window.addEventListener('scroll', function () {
    const art = document.getElementById('aboutArt');
    if (!art) return;

    const rect = art.getBoundingClientRect();
    const windowHeight = window.innerHeight;

    let opacity = 1 - (window.scrollY / 800);

    if (opacity < 0) opacity = 0;
    if (opacity > 1) opacity = 1;

    art.style.opacity = opacity;
});





// aboot-page-bg-slow-hide-anmi

// brand-slider-about

$(document).ready(function () {
    var owl = $('.brand-slider');
    owl.owlCarousel({
        items: 5,
        loop: true,
        margin: 0,
        autoplay: true,
        slideTransition: 'linear',
        autoplayTimeout: 1500,
        autoplaySpeed: 2500,
        autoplayHoverPause: true

    });

});
// brand-slider-about





