<?php
/*
Template Name: Equipe
*/
get_header(); ?>

<div class="container">
    <div class="row">
        <div class="col-lg-12 accroche">
            <!--<h1>notre<br><span class="couleurRose">équipe</span><div class="barre"></div><span class="bxllie">deligraph</h1>--><?php 
            $titreDelaPage = get_field('titre_de_la_page');
            if(!empty($titreDelaPage)){
                echo $titreDelaPage;
            }else{
            ?>
            <h1>délicieuse <br><span class="couleurRose">équipe</span><span class="barre"></span><span class="bxllie">deligraph</span></h1>
            <?php
            }
            ?>
        </div>
    </div>
</div>

<div class="container">
    <div class="row deligraph">
        <div class="offset-lg-4 col-lg-8"><div class="circleTop"></div></div>
        <div class="offset-lg-4 col-lg-8"><h2>Deligraph</h2></div>
        <div class="col-12"><div class="barre"></div></div>
        <div class="col-12 contenu">
            <div class="row">
            <?php echo get_field('deligraph_-_equipe');?>
            </div>
        </div>
    </div>
    <div class="row deligraph valeur">
        <div class="col-lg-12"><div class="circleTop"></div></div>
        <div class="col-lg-8"><h2>Nos valeurs</h2></div>
        <div class="col-12"><div class="barre"></div></div>
        <div class="col-12 contenu">
            <div class="row">
            <?php echo get_field('nos_valeurs');?>
            </div>
        </div>
    </div>
    <div class="row deligraph vision">
        <div class="offset-lg-4 col-lg-8"><div class="circleTop"></div></div>
        <div class="offset-lg-4 col-lg-8"><h2>Notre vision</h2></div>
        <div class="col-12"><div class="barre"></div></div>
        <div class="col-12 contenu">
            <div class="row">
            <?php echo get_field('notre_vision');?>
            </div>
        </div>
    </div>
    <?php 
    $couleur  = array(
        'jaune' => '#FAA400' ,
        'bleu' => '#21D5F5' ,
        'rose' => '#FA62B3', 
        'violet' => '#C14FE3',
        'vert' => '#1CC7C7'
    );
    // check if the repeater field has rows of data
    if( have_rows('notre_equipe') ):
        // loop through the rows of data
        while ( have_rows('notre_equipe') ) : the_row();
            // display a sub field value
            $decalage = get_sub_field('decalage_du_cercle');
            $couleurAcf = get_sub_field('couleur');
            $couleurIndex = $couleurAcf[0];
            $nbrcol = 12 - $decalage;
            $image = get_sub_field('photo_de_la_personne');
            //print_r($image);
            ?>
            <div class="row deligraph equipeItem <?php echo $couleurAcf[0]; ?>">
                <div class="offset-lg-<?php echo $decalage;?> col-lg-<?php echo $nbrcol;?>"><div style="background-color:<?php echo $couleur[$couleurIndex];?>" class="circleTop"></div></div>
                <div class="offset-lg-<?php echo $decalage;?> col-lg-<?php echo $nbrcol;?>">
                    <img class="imagePersonne" src="<?php echo $image['url'];?>" alt="<?php echo $image['alt'];?>">
                    <h2 style="color:<?php echo $couleur[$couleurIndex]; ?>"><?php echo get_sub_field('nom_de_la_personne');?></h2>
                </div>
                <div class="col-12 contenu">
                    <div class="row">
                    <?php echo get_sub_field('description_de_la_personne');?>
                    </div>
                </div>
            </div>
            <?php
        endwhile;
    else :
        // no rows found
    endif;
    ?>
     <div class="row deligraph">
        <div class="col-lg-12"><div class="circleTop"></div></div>
        <div class="col-lg-8"><h2>Et bientôt vous ?</h2></div>
        <div class="col-12"><div class="barre"></div></div>
        <div class="col-12 contenu">
            <div class="row">
            <?php echo get_field('bientot_vous');?>
            </div>
        </div>
    </div>
    <div class="row">
    <div class="col-12">
    <div class="circleEnd"></div>
    </div>
    </div>
</div>



<?php get_footer(); ?>