<?php
/**
 *
 * Frontend view
 *
 * @package halloween-panda
 * @subpackage _views
 * @since Halloween Panda 1.0.0
 */

defined( 'ABSPATH' ) or die( 'No script kiddies please!' );

if ( isset( $hp_options ) && 'yes' == $hp_options->px_hp_is_active ) : ?>

	<div id="pix-hp-container" class="pix-hp-<?php echo esc_attr( $hp_options->px_hp_display_type ); ?> pix-hp-<?php echo esc_attr( $hp_options->px_hp_display_position ); ?> <?php echo 'yes' == esc_attr( $hp_options->px_hp_is_fixed ) ? 'pix-hp-fixed' : ''; ?>" data-class="pix-hp-<?php echo esc_attr( $hp_options->px_hp_display_position ); ?>" data-image="<?php echo esc_url( PIX_HAL_PAN_URL ); ?>assets/images/icon_pumpkin_fall" data-fall="<?php echo esc_attr( $hp_options->px_hp_pumpkin_fall ); ?>" >

	</div>

<?php
elseif ( isset( $hp_options ) && 'yes' == $hp_options->px_hp_pumpkin_fall ) :
?>
	<div id="pix-hp-container" data-image="<?php echo esc_url( PIX_HAL_PAN_URL ); ?>assets/images/icon_pumpkin_fall" data-fall="<?php echo esc_attr( $hp_options->px_hp_pumpkin_fall ); ?>" />
<?php
endif;

if ( isset( $hp_options ) && 'yes' == $hp_options->px_hp_display_popup ) :
	switch ( $hp_options->px_hp_popup_type ) {
		case '2':
		case '9':
			$img_ext = '.png';
			break;
		case '10':
		case '11':
		case '12':
		case '13':
		case '14':
		case '15':
		case '16':
			$img_ext = '.gif';
			break;
		default:
			$img_ext = '.jpg';
	}
?>
	<div class="pix-halloween-pandas-popup display-on-<?php echo esc_attr( $hp_options->px_hp_popup_position ); ?>">
		<img src="<?php echo esc_url( PIX_HAL_PAN_URL . 'assets/images/popup_' . $hp_options->px_hp_popup_type . $img_ext ); ?>" alt="Halloween Pop-up" />
		<a href="#" class="px-popup-close"></a>
	</div>
<?php
endif;
