<video autoplay muted loop class="video">
    <source src="video/fond.mp4" type="video/mp4">
</video>

<div class='container'>
<a href="index.php?action=play" class="retour" >&lt; Retour</a>

<h1>Choisissez le personnage de votre adversaire !</h1>

<div class="flex-ligne">

    <?php

    $perso = $MonManager->getPerso($_GET['perso']);

    echo '<div class="perso-selected selected">';
    echo '<img src="' . $perso->getImg() . '" alt="">';
    echo '<div class="infos-perso-selected">';
    echo '<h2>' . $perso->getName() . '</h2>';
    echo '<p>Attaque</p>';
    echo '<div class=flex-ligne>';
    echo '<progress value="' . $perso->getAtk() . '" max="100"></progress>';
    echo '<p class="info-progress">' . $perso->getAtk() . '/100</p>';
    echo '</div>';
    echo '<p>PV</p>';
    echo '<div class=flex-ligne>';
    echo '<progress value="' . $perso->getPv() . '" max="200"></progress>';
    echo '<p class="info-progress">'.$perso->getPv().'/200</p>';
    echo '</div>';
    echo '</div>';
    echo '</div>';
    ?>

    <p class="vs">VS</p>
    
    <div class="perso-selected">
    
        <img src="img/persos/perso0.png" id='img-perso-selected' alt="">
    
        <div class="infos-perso-selected">
            <h2 id="nom-perso-selected">???</h2>
            <p>Attaque</p>
            <div class=flex-ligne>
                <progress id="attaque-perso-selected" value="20" max="100"></progress>
                <p id="atk-progress-bar" class="info-progress">??/100</p>
            </div>
            <p>PV</p>
            
            <div class=flex-ligne>
                <progress id="pv-perso-selected" value="200" max="200"></progress>
                <p id="pv-progress-bar" class="info-progress">??/200</p>
            </div>
        </div>
    
    </div>
</div>

<div class="container-persos">
<?php

$persos = $MonManager->getList();

foreach ($persos as $perso){
    if ($perso->getId() != $_GET['perso']){
    echo '<a href="index.php?action=combat&perso='.$_GET['perso'].'&adv='.$perso->getId().'" class="perso">';
    echo '<div class="carre-perso">';
    }
    else{
        echo '<a href="#" class="pers">';
    echo '<div class="taken">';
    }
    echo '<img id="img-perso" src="' . $perso->getImg() . '" alt="' . $perso->getName() . '"/>';
    echo '<p class="hidden" id="name-perso">' . $perso->getName() . '</p>';
    echo '<p class="hidden" id="atk-perso">' . $perso->getAtk() . '</p>';
    echo '<p class="hidden" id="pv-perso">' . $perso->getPv() . '</p>';
    echo '</div>';
    echo '</a>';
}
?>

</div>

</div>