<?php get_header(); ?>


<?php
//from shorline brewing, just export ACF fields from there, and import to new site.
if( get_field('display') ) { ?>
   			<div id="news" class="uk-modal" uk-modal>
			    <div class="uk-modal-dialog ">
						<button class="uk-modal-close-outside" type="button" uk-close></button>
						<div class="black-bg uk-text-center uk-padding">
							<div class="">
								<img src="<?php the_field('event_image'); ?>" />
								
								<?php 
								$link = get_field('event_url');
								if( $link ): ?>
									<a class="teal-btn" href="<?php echo esc_url( $link ); ?>" target="_blank">Buy Tickets Now!</a>
								<?php endif; ?>
								
							</div>
						</div>
			    </div>
			</div>
<?php } ?>


<script>
	
function setCookie(cname, cvalue, exdays) {
  var d = new Date();
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
  var expires = "expires="+ d.toUTCString();
  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');
  for(var i = 0; i <ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
}	

	
if(getCookie('website-visists') == '') {
		setTimeout(function(){
						console.log('Show UiKit Modal Popup');
						UIkit.modal('#news').show();
					 }, 1000);
		setCookie('website-visists', '1', 7);
	
}	

</script>


<div class="uk-cover-container uk-text-center banner">
    <canvas width="" height="600"></canvas>

	<img uk-img="data-src:<?php echo get_template_directory_uri(); ?>/images/banner.jpg" data-width data-height uk-cover>


	<div class="uk-position-cover uk-text-center uk-container uk-flex uk-flex-center uk-flex-middle">
        <div>
           test
        </div>
    </div>
</div>



<div class="uk-container">
	<main role="main">
			<section>

			<?php if (have_posts()): while (have_posts()) : the_post(); ?>

				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

					<?php the_content(); ?>

					<br class="clear">

					<?php edit_post_link( __('Edit this page'), '', '', 0, 'post-edit-link uk-label uk-float-right' ); ?>

				</article>

			<?php endwhile; ?><?php endif; ?>

			</section>
	</main>
</div>
<?php get_footer(); ?>
