<?php
/**
 * Template Name: Template Home 2020
 */
get_header( 'simple' ); ?>

<div class="simple-layout-wrapper">
    <div class="simple-header">
        <div class="simple-logo-wrapper">
            <a href="<?php echo get_field( 'logo_url' ); ?>">
                <?php $LogoImg = get_field( 'logo' ); ?>
                <img src="<?php echo $LogoImg; ?>" alt="" />
            </a>
        </div>


        <div class="simple-menu">
            <div class="simple-burger"></div>
            <ul>
                <?php
                $menuItems = get_field( 'menu' );
                foreach ($menuItems as $item) { ?>
                    <li><a href="<?php echo $item['link']?>"><?php echo $item['label']?></a></li>
                <?php } ?>
            </ul>
        </div>
    </div>

    <div class="slider-simple">
        <?php
        $slider = get_field( 'slider', get_the_ID() );
        $slider_settings = get_field( 'slider_settings', get_the_ID() );

        // echo '<pre>';
        // print_r( $slider );
        // echo '</pre>';
        ?>
        <div class="simple-slider-wrapper" data-loop="<?php echo $slider_settings['continuous_loop']; ?>" data-interval="<?php echo $slider_settings['slide_interval']; ?>">
                    <?php
                    foreach ( $slider as $slide ) { ?>
                        <div>
                            <?php echo ( empty( $slide['link'] ) ? '' : '<a href="' . $slide['link'] . '">' ); ?>
                                <div class="simple-inner-slide" style="background-image: url( '<?php echo $slide['image']['url']; ?>' );">
                                    <div class="dummy-helper"></div><img src="<?php echo ( empty( $slide['mobile_image'] ) ? $slide['image']['url'] : $slide['mobile_image']['url'] ); ?>" alt="">
                                </div>
                            <?php echo ( empty( $slide['link'] ) ? '' : '</a>' ); ?>
                        </div>
                    <?php }
                    
                    ?>

        </div>
    </div>



    <div class="simple-footer">
        <?php $footer_image = get_field( 'footer_image' ); 
        echo '<img src="' . $footer_image['url'] . '" />';
        ?>
    </div>

</div>

<?php get_footer( 'simple' );