<?php /* Template Name: Page / O nas */ ?>
<?php get_header() ?>

    <div class="wrapper--default">
        <div class="wrapper--inner">
            <h1>
            <?php echo get_the_title() ?>
            </h1>
        </div>
    </div>

        <?php if (have_rows('sections')) : ?>
    <?php while (have_rows('sections')) : the_row(); ?>
        <?php if (get_row_layout() == 'hero_slider') : ?>
            <?php get_template_part('template-parts/sections/section-hero-slider', 'hero_slider'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'hero_section') : ?>
            <?php get_template_part('template-parts/sections/section-hero', 'hero_section'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'three_col_repeater_section') : ?>
            <?php get_template_part('template-parts/sections/section-three-col-repeater', 'three_col_repeater_section'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'two_col_section') : ?>
            <?php get_template_part('template-parts/sections/section-two-col', 'section-two-col'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'two_col_section_with_bg') : ?>
            <?php get_template_part('template-parts/sections/section-two-col-with-bg', 'section-two-col-with-bg'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'one_col_2_cta') : ?>
            <?php get_template_part('template-parts/sections/section-one-col-cta', 'section-one-col-cta'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'one_col_cta_images') : ?>
            <?php get_template_part('template-parts/sections/section-one-col-cta-images', 'section-one-col-cta-images'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'boxes_repeater_img_title_text_cta') : ?>
            <?php get_template_part('template-parts/sections/section-boxes_repeater_img_title_text_cta', 'boxes_repeater_img_title_text_cta'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'faq') : ?>
            <?php get_template_part('template-parts/sections/section-faq', 'faq'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'gallery') : ?>
            <?php get_template_part('template-parts/sections/section-gallery', 'gallery'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'hero_with_form') : ?>
            <?php get_template_part('template-parts/sections/section-hero-with-form', 'hero-with-form'); ?>
        <?php endif; ?>
        <?php if (get_row_layout() == 'wysiwyg') : ?>
            <?php get_template_part('template-parts/sections/section-wysiwyg', 'wysiwyg'); ?>
        <?php endif; ?>
    <?php endwhile; ?>
<?php endif; ?>
    
        <section class="wrapper--default">
            <div class="wrapper--inner">

                <h2 class="">Zobacz, jak wygląda proces powstawania niesamowitych ogrodów.</h2>
                <div class="mt-12 flex flex-col lg:flex lg:flex-row ld:items-start lg:justify-around">
        
                    <?php
        
                    // Check rows exists.
                    if( have_rows('movies_repeater') ):
                    
                        // Loop through rows.
                        while( have_rows('movies_repeater') ) : the_row();
                    
                            // Load sub field value.
                            $thumb = get_sub_field('movie_thumbnail');
                            $vid = get_sub_field('video_item'); ?>
        
                    <div class="max-w-xs sm:max-w-sm md:w-6/12 lg:w-6/12 m-3 cursor-pointer transform hover:opacity-95">
                        <video id="my-video2" class="video-js max-w-full w-full" controls preload="auto" width="100%"
                            height="360" poster="<?php echo $thumb ?>" data-setup="{}">
                            <source src="<?php echo $vid ?>" type="video/mp4" />
                            <p class="vjs-no-js">
                                Aby obejrzeć to video, włącz obsługę javascript, sprawdź czy posiadasz aktualną
                                przeglądarkę internetową
                                <a href="https://videojs.com/html5-video-support/" target="_blank">zobacz przegląrki, które
                                    wspierają HTML5 video</a>
                            </p>
                        </video>
                    </div>
        
                    <?php
                        // End loop.
                        endwhile;
                    
                    else :
                    endif;
        
                ?>
        
                </div>
            </div>
        </section>

        <?php get_template_part( 'partials/cta'); ?>
<?php get_footer() ?>