<?php 
	use Magento\Framework\App\Action\Action;
	$category_load = $block->getCategory();
	$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
		$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
	if($category_load && strtotime($block->getConfig('end_date')) >= strtotime($block->getCurrentTime())){ 
		$image = 'new_products_content_widget_grid';
	$background = '';
	if($this->getConfig('background_image')){ 
		$path = $this->getConfig('background_image');
		$imageUrl = $storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).$path;
		$background = "style='background-image: url(".$imageUrl.");'";
	}
	$deal_image = '';
	if($this->getConfig('deal_image')){
		$path = $this->getConfig('deal_image');
		$imageUrl = $storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).$path;
		$deal_image = '<img src="'.$imageUrl.'" alt=""/>';
	}
?>
<div class="super-deal-banner" <?php echo $background ?>> 
		<div class="container">
			<div class="super-deal-banner-content <?php if($this->getConfig('deal_image')){?>row center_vertical<?php }?>">
				<?php if($this->getConfig('deal_image')){?>
					<div class="col-md-6">
						<?php echo $deal_image ?>
					</div>
				<?php }?>
				<div class="col-countdown <?php if($this->getConfig('deal_image')){?>col-md-6<?php }?>">
					<div class="supper-deal-title">
						<?php if($this->getConfig('sub_title')){?><h5 class="sub-title-deal"><?php echo $block->getConfig('sub_title');?></h5><?php }?>
						<?php if($this->getConfig('title_deal')){?><h2 class="title-deal"><?php echo $block->getConfig('title_deal');?></h2><?php }?>
						<?php if($this->getConfig('description_deal')){?><p class="short-des"><?php echo $block->getConfig('description_deal');?></p><?php }?>
					</div>
					<div class="super-deal-countdown" data-date="<?php echo $block->getConfig('end_date');?>"></div>
					<p class="button-view"><a href="<?php echo $category_load->getUrl();?>" class="view-all-deal btn" data-hover="<?php echo __('View All Deals') ?>"><span><?php echo __('View All Deals') ?></span></a></p>
				</div>
			</div> 
		</div>
		
</div>
<script>
    require([
        'jquery',
        'rokanthemes/timecircles'
    ], function ($) {
		$( document ).ready(function() {
			if($('.super-deal-countdown').length>0){
				$(".super-deal-countdown").TimeCircles({
					fg_width: 0.01,
					bg_width: 1.2,
					text_size: 0.07,
					circle_bg_color: "#ffffff",
					time: {
						Days: {
							show: true,
							text: "Days",
							color: "#f9bc02"
						},
						Hours: {
							show: true,
							text: "Hours",
							color: "#f9bc02"
						},
						Minutes: {
							show: true,
							text: "Mins",
							color: "#f9bc02"
						},
						Seconds: {
							show: true,
							text: "Secs",
							color: "#f9bc02"
						}
					}
				}); 
			}
		});
    });
</script>
<?php } ?>