/**
* dz-carousel.js File
*
* @package     W3Construct
* @author      W3ITEXPERTS
* @copyright   Copyright (c) 2023, W3Construct
* @link        http://w3construct-wordpress.wprdx.come/demo/
* @since       W3Construct 1.0.1
*/	
	
	

/* Swiper Testimonial */
function handleTestimonialSlider(){	
	
	/* Testimonial Swiper */
	if(jQuery('.testimonial-swiper').length > 0){
		var swiper3 = new Swiper('.testimonial-swiper', {
			speed: 1500,
			slidesPerView: 3,
			spaceBetween: 30,
			autoplay: {
			   delay: 3000,
			},
			pagination: {
				el: '.swiper-pagination1',
				clickable: true,
				renderBullet: function (index, className) {
				  return '<span class="' + className + '">' + (index + 1) + '</span>';
				},
			},
			breakpoints: {
				1191: {
					slidesPerView: 3,
				},
				691: {
					slidesPerView: 2,
				},
				320: {
					slidesPerView: 1,
				},
			}
		});
	}
	
	function handlePortfolioSlider() {
		/* Swiper Portfolio */
		if(jQuery('.swiper-portfolio').length > 0){
			var swiper2 = new Swiper('.swiper-portfolio', {
				slidesPerView: 4,
				spaceBetween: 0,
				speed: 1500,
				loop:true,
				autoplay: {
				   delay: 3000,
				},
				navigation: {
					nextEl: '.swiper-button-next2',
					prevEl: '.swiper-button-prev2',
				},
				breakpoints: {
					1280: {
						slidesPerView: 4,
					},
					991: {
						slidesPerView: 3,
					},
					591: {
						slidesPerView: 2,
					},
					320: {
						slidesPerView: 1,
					},
				}
			});
		}
			
	}
	
	
	/* Testimonial Swiper 2 */
	if(jQuery('.testimonial-swiper2').length > 0){
		var testimonialswiper2 = new Swiper('.testimonial-swiper2', {
			speed: 1500,
			slidesPerView: 2,
			spaceBetween: 0,
			autoplay: {
			   delay: 3000,
			},
			pagination: {
				el: '.swiper-pagination1',
				clickable: true,
				renderBullet: function (index, className) {
				  return '<span class="' + className + '">' + (index + 1) + '</span>';
				},
			},
			breakpoints: {
				1200: {
					slidesPerView: 2,
				},
				320: {
					slidesPerView: 1,
				},
			}
		});
	}

}

/* main-silder-swiper */
function handleMainSlider(){
	/* main-silder-swiper */
	if(jQuery('.main-silder-swiper').length > 0){
		var swiper = new Swiper('.main-silder-swiper', {
			speed: 1000,
			effect: "fade",
			loop:true,
			autoplay: {
			   delay: 3000,
			},
			pagination: {
				el: '.swiper-pagination',
				clickable: true,
				renderBullet: function (index, className) {
				  return '<span class="' + className + '">' + (index + 1) + '</span>';
				},
			},
			navigation: {
				nextEl: '.swiper-button-next1',
				prevEl: '.swiper-button-prev1',
			},
		});
	}
	
}


/* Swiper Team */
function handleTeamSlider(){
	/* Team Swiper */
	if(jQuery('.team-swiper').length > 0){
		var swiper4 = new Swiper('.team-swiper', {
			speed: 1500,
			slidesPerView: 4,
			spaceBetween: 30,
			loop:true,
			autoplay: {
			   delay: 3000,
			},
			pagination: {
				el: '.swiper-pagination2',
				clickable: true,
				renderBullet: function (index, className) {
				  return '<span class="' + className + '">' + (index + 1) + '</span>';
				},
			},
			breakpoints: {
				1191: {
					slidesPerView: 4,
				},
				991: {
					slidesPerView: 3,
				},
				591: {
					slidesPerView: 2,
				},
				320: {
					slidesPerView: 1,
				},
			}
		});
	}
	
}


/* Swiper Client */
function handleClientSlider(){
	/* Clients Swiper */
	if(jQuery('.clients-swiper').length > 0){
		var swiper5 = new Swiper('.clients-swiper', {
			speed: 1500,
			parallax: true,
			slidesPerView: 4,
			spaceBetween: 30,
			autoplay: {
			   delay: 3000,
			},
			loop:true,
			navigation: {
				nextEl: '.swiper-button-next5',
				prevEl: '.swiper-button-prev5',
			},
			breakpoints: {
				1191: {
					slidesPerView: 6,
				},
				991: {
					slidesPerView: 5,
				},
				691: {
					slidesPerView: 4,
				},
				591: {
					slidesPerView: 3,
				},
				320: {
					slidesPerView: 2,
				},
			}
		});
	}
	
}

/* Swiper Blog */
function handleBlogSlider(){
	/* Blog Swiper */
	if(jQuery('.blog-swiper').length > 0){
		var swiper2 = new Swiper('.blog-swiper', {
			slidesPerView: 3,
			spaceBetween: 0,
			speed: 1500,
			loop:true,
			autoplay: {
			   delay: 3000,
			},
			breakpoints: {
				1280: {
					slidesPerView: 3,
				},
				991: {
					slidesPerView: 3,
				},
				691: {
					slidesPerView: 2,
				},
				320: {
					slidesPerView: 1,
				},
			}
		});
	}	
}
function handleSwiperTestimonial2(){

	if(jQuery('.testimonial-swiper-2').length > 0){
		var swiperTestimonial2 = new Swiper('.testimonial-swiper-2', {
			speed: 1500,
			parallax: true,
			slidesPerView: 3,
			spaceBetween: 30,
			loop:true,
			autoplay: {
			   delay: 3000,
			},
			pagination: {
			  el: ".swiper-pagination",
			  clickable: true,
			},
			navigation: {
				nextEl: '.swiper-button-next3',
				prevEl: '.swiper-button-prev3',
			},
			breakpoints: {
				1191: {
					slidesPerView: 2,
				},
				691: {
					slidesPerView: 1,
				},
				320: {
					slidesPerView: 1,
				},
			}
		});
	}
}
function MainSilderSwiper2(){
	/* main-silder-swiper-2 */
	if(jQuery('.main-silder-swiper-2').length > 0){
		var swiper = new Swiper('.main-silder-swiper-2', {
			speed: 1500,
			parallax: true,
			loop:true,
			autoplay: {
			   delay: 3000,
			},
		});
	}
}

function handleTeamSlider2() {
	
	/* Team Swiper 2 */
	if(jQuery('.team-swiper-2').length > 0){
		var swiper4 = new Swiper('.team-swiper-2', {
			speed: 1500,
			parallax: true,
			slidesPerView: 4,
			spaceBetween: 30,
			loop:true,
			autoplay: {
			   delay: 3000,
			},
			navigation: {
				nextEl: '.swiper-button-next4',
				prevEl: '.swiper-button-prev4',
			},
			breakpoints: {
				1191: {
					slidesPerView: 4,
				},
				991: {
					slidesPerView: 3,
				},
				591: {
					slidesPerView: 2,
				},
				320: {
					slidesPerView: 1,
				},
			}
		});
	}
}

/* JavaScript Document */
jQuery(document).ready(function() {
    'use strict';	

	/* Blog Swiper */
	if(jQuery('.post-swiper').length > 0){
		var swiper2 = new Swiper('.post-swiper', {
			slidesPerView: 1,
			spaceBetween: 0,
			speed: 1500,
			loop:true,
			autoplay: {
			   delay: 3000,
			},
			navigation: {
				nextEl: '.prev-post-swiper-btn',
				prevEl: '.next-post-swiper-btn',
			},
		});
	}	
	
	
	
});
/* Document .ready END */


/* Window Load START */
jQuery(document).ready(function(){
	//handlePortfolioSlider();
	handleSwiperTestimonial2();
	MainSilderSwiper2();
	handleMainSlider();
	handleTeamSlider();
	handleTeamSlider2();
	handleClientSlider();
	handleBlogSlider();
	handleTestimonialSlider();	
});
