<?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>
	
const VisitManager = {
  get(name) {
    const value = `; ${document.cookie}`;
    const parts = value.split(`; ${name}=`);
    if (parts.length === 2) return parts.pop().split(';').shift();
  },

  set(name, value, days) {
    const date = new Date();
    date.setTime(date.getTime() + (days * 864e5)); // 864e5 is ms in a day
    document.cookie = `${name}=${value}; expires=${date.toUTCString()}; path=/; SameSite=Lax`;
  }
};

// Logic execution
document.addEventListener('DOMContentLoaded', () => {
  if (!VisitManager.get('website-visits')) {
    setTimeout(() => {
      console.log('Showing UIkit Modal');
      if (typeof UIkit !== 'undefined') {
        UIkit.modal('#news').show();
      }
    }, 1000);

    VisitManager.set('website-visits', '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(); ?>
