épurer l'interface
This commit is contained in:
parent
cb0ba5eae2
commit
c36a19fb2a
3 changed files with 11 additions and 25 deletions
|
|
@ -7,22 +7,12 @@
|
|||
</head>
|
||||
<body>
|
||||
<h2>ChessNut — Partie</h2>
|
||||
<div>Room: <strong id="roomId">-</strong> Player: <strong id="playerId">-</strong></div>
|
||||
<div>Room: <strong id="roomId">-</strong>
|
||||
<div style="display:flex;gap:20px;align-items:flex-start">
|
||||
<div>
|
||||
<div>Fen: <span id="fen">-</span></div>
|
||||
<div>Joueurs:
|
||||
<ul id="players"></ul>
|
||||
<div id="board" style="width:1000px;height:1000px;display:grid;grid-template-columns:repeat(8,1fr);border:1px solid #333"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="board" style="width:360px;height:360px;display:grid;grid-template-columns:repeat(8,1fr);border:1px solid #333"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Événements</h3>
|
||||
<div id="log">Logs...</div>
|
||||
<div style="margin-top:10px"><a href="/">Retour à la page principale</a></div>
|
||||
|
||||
<script src="https://cdn.socket.io/4.7.2/socket.io.min.js"></script>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -2,24 +2,19 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>ChessNut - Test client</title>
|
||||
<title>ChessNut</title>
|
||||
<style>body{font-family:Arial;margin:20px} input,button{padding:6px;margin:4px} #log{white-space:pre-wrap; border:1px solid #ddd;padding:8px;height:300px;overflow:auto}</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>ChessNut - Client de test</h2>
|
||||
<h2>ChessNut</h2>
|
||||
<div>
|
||||
<div>
|
||||
<button id="create">Créer une room</button>
|
||||
Room ID: <input id="roomId" placeholder="ex: ab12cd34" />
|
||||
</div>
|
||||
<button id="join">Rejoindre</button>
|
||||
Room ID: <input id="roomId" placeholder="ex: ab12cd34" />
|
||||
</div>
|
||||
|
||||
<div style="margin-top:12px">
|
||||
<label>Votre playerId (optionnel): <input id="playerId" placeholder="laisser vide pour générer" /></label>
|
||||
</div>
|
||||
|
||||
<p>Après création ou connexion, vous serez redirigé·e vers la page de <strong>salle d'attente</strong> dédiée.</p>
|
||||
|
||||
|
||||
<script src="https://cdn.socket.io/4.7.2/socket.io.min.js"></script>
|
||||
<script>
|
||||
function log(...args){ console.log(...args); }
|
||||
|
|
@ -49,7 +44,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
const playerId = document.getElementById('playerId').value.trim() || '';
|
||||
const playerIdEl = document.getElementById('playerId');
|
||||
const playerId = (playerIdEl && playerIdEl.value) ? playerIdEl.value.trim() : '';
|
||||
// redirect to waiting page; playerId optional
|
||||
const qs = `?roomId=${encodeURIComponent(roomId)}${playerId?`&playerId=${encodeURIComponent(playerId)}`:''}`;
|
||||
window.location.href = '/waiting.html' + qs;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div>Room: <strong id="roomId">-</strong></div>
|
||||
<div>Status: <strong id="status">-</strong></div>
|
||||
<div>Joueurs: <strong id="playerCount">0/2</strong></div>
|
||||
<div>Hôte: <strong id="hostLabel">-</strong> <span id="youAreHost" style="display:none;color:green;font-weight:bold;margin-left:8px">(Vous êtes l'hôte)</span></div>
|
||||
<div><span id="youAreHost" style="display:none;font-weight:bold">Vous êtes l'hôte</span></div>
|
||||
</div>
|
||||
<div style="margin-top:8px">
|
||||
<button id="startBtn" style="display:none">Commencer la partie</button>
|
||||
|
|
|
|||
Loading…
Reference in a new issue