petite modif style file attente
continuous-integration/drone/push Build is failing Details

ServeurDeTest
nathan boileau 2 years ago
parent 81594f7146
commit 1b011b5a33

@ -1,49 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scripted</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0"
/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css" integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js" integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
<link rel="stylesheet" href="./View/src/CSS/Main2.css" />
<link rel="stylesheet" href="./View/src/CSS/FirstTest.css">
</head>
<body>
</head>
<body>
<div>
<div id="imgMain" style="background: #050E15;">
<div class="grid">
<div class="m-3">
<a class="btn" href="index.php?action=quitQueue">
<span>Quitter</span>
</a>
</div>
<div class="row">
<h2 class="text-center mt-3 mr-5" style="color: #00CCFF; font-weight: 1000;font-style: italic;">SCRIPT</h2>
<h2 class="text-center ml-5" style="color: #D400D4; font-weight:bold ; font-size:4em;font-style: italic;">RUSH</h2>
<h2 class="text-center mt-3 pr-5" style="color: #00CCFF; font-weight: 1000;font-style: italic;">SCRIPT</h2>
<h2 class="text-center pl-5" style="color: #D400D4; font-weight:bold ; font-size:4em;font-style: italic;">RUSH</h2>
</div>
<div class="row pt-5">
<div class="row pt-5 m-0">
<h3 class="text-center" id="waiting">Waiting for Coders...</h3>
</div>
<div class="row d-flex ">
<div class="row d-flex m-0">
<div class="col d-flex flex-column align-items-center">
<div style="background-color: red; height: 75px; width: 75px;"></div>
<p class="pt-3" id="player1">Player 1</p>
@ -61,19 +51,20 @@
<p class="pt-3" id="player4">Player 4</p>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
</body>
<script>
function checkIsReady() {
console.log("checkIsReady");
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=waiting', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
xhr.onload = function() {
console.log(xhr.responseText);
if (xhr.responseText == "1") {
window.location.href = 'http://82.165.180.114/Scripted/index.php?action=goToGame&idPartie=' + <?php echo $_SESSION['idPartie'] ?> + '&index=1'
@ -81,13 +72,14 @@
};
xhr.send(null);
}
function getPlayer() {
console.log("getPlayer");
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersPseudo', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
xhr.onload = function() {
var players = JSON.parse(xhr.responseText);
if (players[0] != null) {
document.getElementById("player1").innerHTML = players[0];
@ -105,9 +97,11 @@
xhr.send(null);
}
window.addEventListener("load", waiting);
function waiting(){
function waiting() {
var countdownTimer = setInterval('checkIsReady()', 1000);
setInterval('getPlayer()', 500);
}
</script>
</script>
</html>

@ -21,7 +21,7 @@
<h2 class="text-center mt-3 pr-5" style="color: #00CCFF; font-weight: 1000; font-style: italic;">SCRIPT</h2>
<h2 class="text-center pl-5" style="color: #D400D4; font-weight:bold; font-size:4em; font-style: italic;">RUSH</h2>
</div>
<div class="row pt-5 m-0">
<div class="row pt-5 px-3 m-0">
<p class="text-center">Bienvenue dans le mode <b>ScriptRush</b> ! Tu es ici dans le mode multijoueur de <b>Scripted</b>.
Dans ce mode, tu vas pouvoir affronter d'autres joueurs et tenter de gagner le plus de points possible.
Pour cela, tu vas devoir résoudre le plus d'énigme de possible en un temps imparti.

@ -5,8 +5,7 @@
<title>Scripted</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
</head>
<body>
@ -22,7 +21,7 @@
<p>Votre score est de : <?php echo $points ?> points.</p>
<p>Temps restant avant la fin de la partie :</p>
<?php
$end_time = $dateDebut->modify('+'. $_SESSION['tpsMaxPartie'] .'seconds');
$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;
@ -37,7 +36,7 @@
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getGameEtat', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
xhr.onload = function() {
if (xhr.responseText == "2") {
window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame'
}
@ -45,13 +44,14 @@
xhr.send(null);
}
var seconds = <?php echo $remaining_seconds; ?>;
function countdown() {
checkIsEnd();
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 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;
@ -67,12 +67,10 @@
var countdownTimer = setInterval('countdown()', 1000);
</script>
<!-- Bootstrap JavaScript Libraries -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js"
integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous">
</script>
</body>

Loading…
Cancel
Save