<?php

$args = array(
		'class'=>'',
		'title'=>'',
		'margin'=>'',
		'image'=>'',
		'link_url'=>'',
		'link_target'=>'',			
		'featyretype'=>'',
		'animate'=>'',				
);

$html = "";

extract(shortcode_atts($args, $atts));

	if(is_numeric($image)) {
		$bauen_image = wp_get_attachment_url( $image );
		$bauen_title = get_the_title( $image );
	} else {
		$bauen_image = $image;
		$bauen_title = $image;
	}		
	
    if($animate == "yes"){ 
    $bauen_animate_start = '<div class="animate-box" data-animate-effect="fadeInUp">';
    $bauen_animate_end = '</div>';
    } else {
	$bauen_animate_start="";
	$bauen_animate_end="";		
	}		

	$html .='<div class="sec-image '.esc_attr($class).'"';
			if($margin != '') { $html .='style="margin:'.$margin.';"';} 
	$html .='>';
	    if(is_numeric($image)) {
		$html .=''.$bauen_animate_start.''; 	
			if($featyretype == "st2"){	
				$html .='<div class="about">';
					$html .='<div class="about-img">';
						$html .='<div class="img"><img src="'.esc_url($bauen_image).'" alt="'.esc_attr($bauen_title).'" class="img-fluid"/></div>';				
						if($title != '') {	$html .='<div class="about-img-2 about-buro">'.esc_html($title).'</div>'; }
					$html .='</div>';
				$html .='</div>';
			} 
			else {
				if($link_url != '') {	
					$html .='<a href="'.esc_url($link_url).'"';
						if($link_target != '') { $html .='target="'.esc_attr($link_target).'"';}						
					$html .='>';
				}	
				$html .='<img src="'.esc_url($bauen_image).'" alt="'.esc_attr($bauen_title).'" class="img-responsive"/>';
				if($link_url != '') {
					$html .='</a>';
				}	
			}	
		$html .=''.$bauen_animate_end.''; 	
		}
	$html .='</div>';

echo $html;