$(document).ready(function() {
	// Vendor Initialize
	$('[data-aos]').attr('data-aos-once', true);
	AOS.init();

	var owl = $('.owl-carousel');
	owl.owlCarousel({
		items:4,
		loop:true,
		margin:10,
		autoplay:true,
		autoplayTimeout:3000,
		autoplayHoverPause:true
	});
	$('.play').on('click',function(){
		owl.trigger('play.owl.autoplay',[3000])
	})
	$('.stop').on('click',function(){
		owl.trigger('stop.owl.autoplay')
	})

	$('.carousel').carousel({
		interval: 2000
	})
	

	// Scroll to Div
	$('a[data-slide="slide"]').click(function(e) {
		e.preventDefault();
		$('.sidebar-overlay').trigger('click');
		var target = $(this).data('slide-target');
	    $("html, body").animate({
	        scrollTop: $(target).offset().top - 100
	    }, 600);
	})

	// Dynamic Scrolled Navbar
	function hasScrolled() {
		var navbar = $('.navbar');
		if (window.scrollY > 50) {
			navbar.addClass('scrolled');
		} else {
			navbar.removeClass('scrolled');
		}
	}
	$(window).scroll(function() {
		hasScrolled();
	});
	$(window).resize(function() {
		hasScrolled();
	});
	hasScrolled();

});
