<?php
/**
 * Template Name: Page - Coming Soon
 */

get_header('comingsoon');

global $post, $restorator_options;

$restorator_custom_divider 			= $restorator_options['custom_divider']['url'];
$restorator_custom_divider_width 	= isset( $restorator_options['custom_divider_width'] ) ? $restorator_options['custom_divider_width'] : '48';
$restorator_coming_soon_subtitle 	= get_post_meta( $post->ID, 'restorator_coming_soon_subtitle', true );
$restorator_coming_soon_title 		= get_post_meta( $post->ID, 'restorator_coming_soon_title', true );
$restorator_coming_soon_descr 		= get_post_meta( $post->ID, 'restorator_coming_soon_descr', true );
$restorator_coming_soon_email 		= get_post_meta( $post->ID, 'restorator_coming_soon_email', true );

$restorator_coming_soon_bg_styles = $restorator_coming_soon_bg_image = $restorator_coming_soon_bg_image_repeat = $restorator_coming_soon_bg_color = $restorator_coming_soon_bg_attachment = $restorator_coming_soon_bg_position = $restorator_coming_soon_bg_cover = $restorator_coming_soon_text_color = '';
$restorator_coming_soon_bg_image 	= get_post_meta( $post->ID, 'restorator_coming_soon_bg_image', true );

if ( $restorator_coming_soon_bg_image ) {
	if ( is_numeric( $restorator_coming_soon_bg_image ) ) {
		$restorator_coming_soon_bg_image = wp_get_attachment_image_src( $restorator_coming_soon_bg_image, 'full' );
		$restorator_coming_soon_bg_image = $restorator_coming_soon_bg_image[0];
	}
}

$restorator_coming_soon_bg_image_repeat 	= get_post_meta( $post->ID, 'restorator_coming_soon_bg_repeat', true );
$restorator_coming_soon_bg_color 			= get_post_meta( $post->ID, 'restorator_coming_soon_bg_color', true );
$restorator_coming_soon_bg_attachment 		= get_post_meta( $post->ID, 'restorator_coming_soon_bg_attachment', true );
$restorator_coming_soon_bg_position 		= get_post_meta( $post->ID, 'restorator_coming_soon_bg_position', true );
$restorator_coming_soon_bg_cover 			= get_post_meta( $post->ID, 'restorator_coming_soon_bg_full', true );

if( isset( $restorator_coming_soon_bg_image ) && $restorator_coming_soon_bg_image != '' ) {
	$restorator_coming_soon_bg_styles .= 'background-image: url('. $restorator_coming_soon_bg_image .');';
	if( isset( $restorator_coming_soon_bg_image_repeat ) && $restorator_coming_soon_bg_image_repeat != '' ) {
		$restorator_coming_soon_bg_styles .= 'background-repeat: '. $restorator_coming_soon_bg_image_repeat .';';
	}
	if( isset( $restorator_coming_soon_bg_attachment ) && $restorator_coming_soon_bg_attachment != '' ) {
		$restorator_coming_soon_bg_styles .= 'background-attachment: '. $restorator_coming_soon_bg_attachment .';';
	}
	if( isset( $restorator_coming_soon_bg_position ) && $restorator_coming_soon_bg_position != '' ) {
		$restorator_coming_soon_bg_styles .= 'background-position: '. $restorator_coming_soon_bg_position .';';
	}
	if( isset( $restorator_coming_soon_bg_cover ) && $restorator_coming_soon_bg_cover != '' ) {
		$restorator_coming_soon_bg_styles .= 'background-size: '. $restorator_coming_soon_bg_cover .';';
		$restorator_coming_soon_bg_styles .= '-moz-background-size: '. $restorator_coming_soon_bg_cover .';';
		$restorator_coming_soon_bg_styles .= '-webkit-background-size: '. $restorator_coming_soon_bg_cover .';';
		$restorator_coming_soon_bg_styles .= '-o-background-size: '. $restorator_coming_soon_bg_cover .';';
		$restorator_coming_soon_bg_styles .= '-ms-background-size: '. $restorator_coming_soon_bg_cover .';';
	}
}

if( isset( $restorator_coming_soon_bg_color ) && $restorator_coming_soon_bg_color != '' ) {
	$restorator_coming_soon_bg_styles .= 'background-color: '. $restorator_coming_soon_bg_color .';';
}
?>
		
		<div class="coming_soon_wrapper text-center" style="<?php echo esc_html( $restorator_coming_soon_bg_styles ); ?>">
			<div class="container">
				<div class="text-center">
					<div class="divider_active">
						<?php if( isset( $restorator_custom_divider ) && !empty( $restorator_custom_divider ) ){ ?>
							<img src="<?php echo esc_url( $restorator_custom_divider ); ?>" alt="" style="width:<?php echo esc_attr( $restorator_custom_divider_width ); ?>px !important;" />
						<?php } else { ?>
							<span class="bg_primary" style="width:<?php echo esc_attr( $restorator_custom_divider_width ); ?>px !important;"></span>
						<?php } ?>
					</div>
					<h4><?php echo esc_html( $restorator_coming_soon_subtitle ); ?></h4>
					<div class="divider_active">
						<?php if( isset( $restorator_custom_divider ) && !empty( $restorator_custom_divider ) ){ ?>
							<img src="<?php echo esc_url( $restorator_custom_divider ); ?>" alt="" style="width:<?php echo esc_attr( $restorator_custom_divider_width ); ?>px !important;" />
						<?php } else { ?>
							<span class="bg_primary" style="width:<?php echo esc_attr( $restorator_custom_divider_width ); ?>px !important;"></span>
						<?php } ?>
					</div>
				</div>
				<h1><?php echo esc_html( $restorator_coming_soon_title ); ?></h1>
				<h6><?php echo esc_html( $restorator_coming_soon_descr ) . ' <a href="mailto:' . esc_html( $restorator_coming_soon_email ) . '">' . esc_html( $restorator_coming_soon_email ) . '</a>'; ?></h6>
				
				<!-- COUNTDOWN -->
				<ul class="countdown">
					<i></i>
					<li>
						<span class="days">00</span>
						<p class="days_ref"><?php echo esc_attr__('days', 'restorator'); ?></p>
					</li>
					<li>
						<span class="hours">00</span>
						<p class="hours_ref"><?php echo esc_attr__('hours', 'restorator'); ?></p>
					</li>
					<li>
						<span class="minutes">00</span>
						<p class="minutes_ref"><?php echo esc_attr__('minutes', 'restorator'); ?></p>
					</li>
					<li>
						<span class="seconds">00</span>
						<p class="seconds_ref"><?php echo esc_attr__('seconds', 'restorator'); ?></p>
					</li>
				</ul><!-- //COUNTDOWN -->
			</div>
		</div>

<?php get_footer('comingsoon'); ?>