<?php
/**
 * The template for displaying main header banner
 *
 * @package Oginer
 */
 
$banner_title_top = get_theme_mod( 'oginer_banner_title_top', __( 'Fully Responsive Template', 'oginer' ) );
$banner_title = get_theme_mod( 'oginer_banner_title', __( 'This is a free responsive landing page made with the Bootstrap framework.', 'oginer' ) );
$banner_description = get_theme_mod( 'oginer_banner_description' );
$banner_url = get_theme_mod( 'oginer_banner_url', '#' );
$banner_url_title = get_theme_mod( 'oginer_banner_url_title', __( 'Learn more', 'oginer' ) );
$banner_url_2 = get_theme_mod( 'oginer_banner_url_2', '#' );
$banner_url_title_2 = get_theme_mod( 'oginer_banner_url_title_2', __( 'PURCHASES NOW', 'oginer' ) );
$banner_phone = get_theme_mod( 'oginer_banner_phone', get_template_directory_uri().'/img/header-imgapp.png' );
$banner_text_position = get_theme_mod( 'oginer_banner_text_position', 'center' );
?>

<div class="header-overlay">
	<div class="container">
		<div class="row">
			<?php if ( $banner_text_position == 'center' || $banner_text_position == 'text' ) {
				$class_left = 'col-md-8 col-md-offset-2 col-sm-12 text-center';
				$class_right = 'col-md-10 col-md-offset-1 text-center hidden-xs';
			} else {
				$class_left = 'col-md-7 col-sm-12';
				$class_right = 'col-lg-4 col-lg-offset-1 col-md-5 col-md-offset-0 col-sm-8 col-sm-offset-2 hidden-xs';
			} ?>
			<div class="<?php echo esc_attr( $class_left ); ?>">
				<div class="header-text">
					<?php if ( $banner_title_top != '' ) { ?>
					<h3><?php echo esc_html( $banner_title_top ); ?></h3>
					<?php } ?>
					<?php if ( $banner_title != '' ) { ?>
					<h2><?php echo esc_html( $banner_title ); ?></h2>
					<?php } ?>
					<?php if ( $banner_description != '' ) { ?>
					<p><?php echo esc_html( $banner_description ); ?></p>
					<?php } ?>
				</div>
				<div class="button-box">
					<?php if ( $banner_url != '' ) { ?>
					<a href="<?php echo esc_url( $banner_url ); ?>" class="btn btn-primary text-uppercase mw-animation" data-os-animation="fadeInLeft"><?php echo esc_html( $banner_url_title ); ?></a>
					<?php } ?>
					<?php if ( $banner_url_2 != '' ) { ?>
					<a href="<?php echo esc_url( $banner_url_2 ); ?>" class="btn text-uppercase mw-animation" data-os-animation="fadeInRight"><?php echo esc_html( $banner_url_title_2 ); ?></a>
					<?php } ?>
				</div>
			</div>
			<?php if ( $banner_phone != '' && $banner_text_position != 'text') { 
			$banner_phone_id = attachment_url_to_postid( $banner_phone );
			$alt = get_post_meta( $banner_phone_id, '_wp_attachment_image_alt', true );
			?>
			<div class="<?php echo esc_attr( $class_right ); ?>">
				<div class="header-phone-img">
					<img src="<?php echo esc_url( $banner_phone ); ?>" alt="<?php echo esc_attr( $alt ); ?>">
				</div>
			</div>
			<?php } ?>
		</div>
	</div>
</div>