<?php
/*
Template Name:Home 3
*/
?>
<?php get_header();
global $post;
	setup_postdata( $post );
?>
<?php $gallery =  get_field('gallery'); ?>
		<script>
				var effects= [];
				<?php
				$counter = 0;
				foreach($gallery as $gallery_item){
				?>
				effects.push('<?php echo $gallery_item['animation'];?>');				
				<?php $counter++;}?>				
		  </script>
	<div class="slides-container2">		
  <div id="slides">
    <div class="slides-container">
		  <?php if($gallery): ?>
		    <?php
				$counter = 0;
				foreach($gallery as $gallery_item):
				?>						
				<?php if($counter%2==0)		
						echo '<div class="slide-left">';
					  else
						echo '<div class="slide-right">';
					   
						?>
						<?php if($gallery_item['image']){
							$image = wp_get_attachment_image_src(  $gallery_item['image'], 'home3-slider' ); 							
							echo '<img src="'.$image[0].'" width="1024" height="682" alt="slide">';
							}
						?>
					<div class="slide-patt"></div>
					<?php if(!$gallery_item['disable_text']):?>
					<div class="row">
						<div class="container">
							<div class="slider-text span6" id="<?php echo $counter;?>" style="opacity: 0;">
							  <h2 class="slider-heading"><?php echo $gallery_item['big_title'];?></h2>
							  <h4><?php echo $gallery_item['small_title'];?></h4>
							  <p><?php echo $gallery_item['desc'];?></p>
							  <a href="<?php echo $gallery_item['link'];?>" class="slide-btn capitalize">read more</a>
							</div>

						  </div>
					</div>
					<?php endif;?>
					<?php $counter++;?>
				</div>
			<?php endforeach ;
					endif;	
			?>
			</div>	
    		<nav class="slides-navigation">
				<a href="#" class="prev"><i class="icon-angle-left icon-3x"></i></a>
				<a href="#" class="next"><i class="icon-angle-right icon-3x"></i></a>
		  	</nav>
    </div>
		</div>

  </div>
<?php get_footer();?>
