<?php /* Template Name: Front Page Template */get_header(); 
include get_template_directory() . '/inc/menus/menu.php';
?>
	<?php
        // This will automatically trigger the modal if there are jobs/bids
        if (get_transient('active_jobs_bids')) {
            wp_enqueue_script('bootstrap');
            wp_enqueue_style('bootstrap');
        }
    ?>
		<main role="main">
		 <?php
        include get_template_directory() . '/inc/slides/carousel-slides.php';
        ?>

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

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

				<?php the_content(); ?>

	</article>
			<!-- /article -->

		<?php endwhile; ?>

		<?php else: ?>

			<!-- article -->
			<article>

				<h2><?php _e( 'Sorry, nothing to display.', 'kipya' ); ?></h2>

			</article>
			<!-- /article -->

		<?php endif; ?>
		</section>
		<span class="clear">
			<?php edit_post_link(); ?>
    </main> <!-- Main Area !-->

<script>
    // Set default interval (global)
    const carousel = document.querySelector('#carouselExampleFade');
    const bsCarousel = new bootstrap.Carousel(carousel, {
        interval: 3000, // 3 seconds
        ride: 'carousel'
    });

    // Optionally adjust delay for specific slides dynamically
    const carouselItems = carousel.querySelectorAll('.carousel-item');
    carouselItems.forEach((item, index) => {
        if (index === 1) { // For the second slide
            item.dataset.bsInterval = "5000"; // 5 seconds delay
        }
    });
</script>
<?php get_footer(); ?>

