|
|
|
@ -32,25 +32,16 @@
|
|
|
|
|
|
|
|
|
|
<div class="col-4 d-flex align-items-center justify-content-center px-0">
|
|
|
|
|
<button>Next</button>
|
|
|
|
|
</div><div class="col-4 d-flex align-items-center justify-content-center px-0">
|
|
|
|
|
<p>Temps restant : </p>
|
|
|
|
|
<?php
|
|
|
|
|
$end_time = $dateDebut->modify('+'. $_SESSION['tpsMaxPartie'] .'seconds');
|
|
|
|
|
$now = new DateTime();
|
|
|
|
|
$interval = $now->diff($end_time);
|
|
|
|
|
$remaining_seconds = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s;
|
|
|
|
|
?>
|
|
|
|
|
<div id="countdown"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="col-1 d-flex align-items-center justify-content-end px-0">
|
|
|
|
|
<a class="material-icons pl-0" id="backArrow"
|
|
|
|
|
href="index.php?action=goToEnigme&ordre=<?php
|
|
|
|
|
if ($enigme->getOrdre() == 1)
|
|
|
|
|
{
|
|
|
|
|
echo $enigme->getOrdre();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo $enigme->getOrdre() - 1;
|
|
|
|
|
}?>"
|
|
|
|
|
style="font-size: 40px; color: white">< </a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-1 d-flex align-items-center px-0">
|
|
|
|
|
<a class="material-icons pl-0" id="nextArrow"
|
|
|
|
|
href="index.php?action=goToEnigme&ordre=<?php echo $enigme->getOrdre() + 1; ?>"
|
|
|
|
|
style="font-size: 40px; color: white"> ></a>
|
|
|
|
|
</div> -->
|
|
|
|
|
<button style="background-color: transparent; border: none; outline: none;" onclick="displayHelp()"
|
|
|
|
|
class="col d-flex align-items-center">
|
|
|
|
|
<div class="col text-right px-2">
|
|
|
|
@ -190,6 +181,27 @@
|
|
|
|
|
xhr.send("code=" + editor.getValue() + "&index=" + index + "&enigmeId=" + enigmeId);
|
|
|
|
|
}
|
|
|
|
|
document.getElementById ('editor').addEventListener('input', saveCode);
|
|
|
|
|
|
|
|
|
|
var seconds = <?php echo $remaining_seconds; ?>;
|
|
|
|
|
function countdown() {;
|
|
|
|
|
var days = Math.floor(seconds/24/60/60);
|
|
|
|
|
var hoursLeft = Math.floor((seconds) - (days*86400));
|
|
|
|
|
var hours = Math.floor(hoursLeft/3600);
|
|
|
|
|
var minutesLeft = Math.floor((hoursLeft) - (hours*3600));
|
|
|
|
|
var minutes = Math.floor(minutesLeft/60);
|
|
|
|
|
var remainingSeconds = seconds % 60;
|
|
|
|
|
if (remainingSeconds < 10) {
|
|
|
|
|
remainingSeconds = "0" + remainingSeconds;
|
|
|
|
|
}
|
|
|
|
|
document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes";
|
|
|
|
|
if (seconds == 0) {
|
|
|
|
|
clearInterval(countdown);
|
|
|
|
|
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame'
|
|
|
|
|
} else {
|
|
|
|
|
seconds--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var countdownTimer = setInterval('countdown()', 1000);
|
|
|
|
|
</script>
|
|
|
|
|
<?php
|
|
|
|
|
echo '<script src="View/src/JS/' . $enigme->getNom() . '.js"></script>';
|
|
|
|
|