<?php
/**
 *
 * @package Slider Premium
 */
?>
<?php $showContent = get_theme_mod('slider_section_show_content', 'on'); ?>
<div class="slider_section" id="slider">
	<div class="owl-slider">
		<div id="carousel" class="owl-carousel">
		<?php
			$args = array( 'post_type' => 'slider', 'orderby'   => 'id', 'order' => 'DESC',);
			if(!empty($pageId)){
				$args['page_id'] = absint($pageId);

			}
			$text = '';
			$query = new WP_Query($args);
			if($query->have_posts()){
				while($query->have_posts()) : $query->the_post(); 
				

			if( get_theme_mod('slider_areaOpacity',true) ) {
				$slider_areaOpacity = 'opacity:'.esc_attr(get_theme_mod('slider_areaOpacity')).';';
			}
			if( get_theme_mod('slider_Tfontsize',true) ) {
				$slider_Tfontsize = 'font-size:'.esc_attr(get_theme_mod('slider_Tfontsize')).';';
			}

			$pageLink = '';
			$slider_btn_link = get_post_meta($post->ID,'slider_btn_link',false);
			$sliderBtnTxt = get_post_meta($post->ID,'sliderBtnTxt',false);
			if(!empty($slider_btn_link) && is_array($slider_btn_link)){
				$pageLink = esc_url(get_permalink($slider_btn_link[0]));
			}
			if(!empty($sliderBtnTxt) && is_array($sliderBtnTxt)){
				$pageLinkTxt = $sliderBtnTxt[0];
			}else{
				$pageLinkTxt = 'Start Free Trial';
			}

				?>
			<div class="item">
				<div class="slider_gradiant"></div> 
				<?php 
					if(has_post_thumbnail()){
						$total_slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(),'full');	
						echo '<img class="slide-mainimg" alt="'. esc_html(get_the_title()) .'" src="'.esc_url($total_slider_image[0]).'">';
				}?>

			<?php
			if($showContent == 'on'){
				?>
				<div class="slider_content " data-wow-duration="1s">
					<div class="title wow bounceInDown">
						<?php echo (get_the_title()); ?>
					</div>
					<div class="sub-title wow bounceInLeft">
						<?php echo (get_the_content()); ?>
					</div>
					<?php 
					if(!empty($pageLink)){ ?>
						<div class="slide-btna">
							<div class="btn5">	
								<a href="<?php echo $pageLink; ?>">
									<?php echo($pageLinkTxt); ?> 
								</a>
							</div>
						</div>
					<?php }?>
				</div>
				<?php }?>

				<?php if( get_theme_mod('mslider_wave_display','show' ) == 'show') :
							?>
				<svg width="100%" height="100%" id="svg" viewBox="0 0 1440 500" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150"><path d="M 0,500 C 0,500 0,250 0,250 C 96.66410256410259,285.0769230769231 193.32820512820518,320.15384615384613 274,309 C 354.6717948717948,297.84615384615387 419.35128205128194,240.46153846153848 493,234 C 566.6487179487181,227.53846153846152 649.2666666666669,271.99999999999994 733,285 C 816.7333333333331,298.00000000000006 901.5820512820512,279.53846153846155 985,252 C 1068.4179487179488,224.46153846153842 1150.4051282051282,187.84615384615387 1226,186 C 1301.5948717948718,184.15384615384613 1370.797435897436,217.07692307692307 1440,250 C 1440,250 1440,500 1440,500 Z" stroke="none" stroke-width="0"  class="transition-all duration-300 ease-in-out delay-150 path-0"></path>
				</svg>
				<?php endif ?>
			</div>
					<?php
				endwhile;
			}else{ 
				for($i=0;$i<6;$i++){?>
			<div class="item">
				<div class="slider_gradiant"></div>
					<?php echo '<img class="slide-mainimg" alt="Slider" src="'. esc_html(get_template_directory_uri()) .'/images/slider1.jpg">';?>

				<?php if($showContent == 'on'){?>
			
				<div class="slider_content" data-wow-duration="1s">
					<div class="title wow bounceInDown">YOUR DREAM VACATION </div>
					<div class="sub-title wow bounceInLeft"> We believe that designing products and services in close partnership with our clients is the only way to have a real impact on their business.</div>
					<div class="slide-btna ">
						<div class="btn5">
							<a href="#">
								<?php _e( 'Contact Us', 'luzuk-premium' ); ?>
							</a>
						</div>
					</div>
				</div>
				<?php }?>
				<?php if( get_theme_mod('mslider_wave_display','show' ) == 'show') : ?>
				<svg width="100%" height="100%" id="svg" viewBox="0 0 1440 500" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150"><path d="M 0,500 C 0,500 0,250 0,250 C 96.66410256410259,285.0769230769231 193.32820512820518,320.15384615384613 274,309 C 354.6717948717948,297.84615384615387 419.35128205128194,240.46153846153848 493,234 C 566.6487179487181,227.53846153846152 649.2666666666669,271.99999999999994 733,285 C 816.7333333333331,298.00000000000006 901.5820512820512,279.53846153846155 985,252 C 1068.4179487179488,224.46153846153842 1150.4051282051282,187.84615384615387 1226,186 C 1301.5948717948718,184.15384615384613 1370.797435897436,217.07692307692307 1440,250 C 1440,250 1440,500 1440,500 Z" stroke="none" stroke-width="0"  class="transition-all duration-300 ease-in-out delay-150 path-0"></path>
				</svg>
				<?php endif ?>
			</div>
				<?php }
			}?>
		</div>

	</div>
</div>

