affichage de la partie
This commit is contained in:
parent
1571094ed5
commit
ce81438c48
4 changed files with 13 additions and 1 deletions
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
|
||||
<script src="https://cdn.socket.io/4.5.4/socket.io.min.js"></script>
|
||||
<script src="src/game.js?v=3"></script>
|
||||
<script src="src/game.js?v=4"></script>
|
||||
<script>
|
||||
// small bootstrap: fetch initial game state and wire socket updates
|
||||
(function(){
|
||||
|
|
|
|||
|
|
@ -97,11 +97,13 @@ function renderBoardFromState(state, asWhite = null) {
|
|||
}
|
||||
}
|
||||
container.appendChild(boardEl);
|
||||
// (previously: overlay/drawing code removed per user request)
|
||||
// ensure player color display is in sync
|
||||
try{ const pc = document.getElementById('player-color'); if(pc && window && window.myColor) pc.textContent = 'Couleur: ' + window.myColor; }catch(e){}
|
||||
console.log('renderBoardFromState: board appended (w=' + w + ', h=' + h + ')');
|
||||
}
|
||||
|
||||
|
||||
function setMeta(text) { q('#meta').textContent = text; }
|
||||
|
||||
function renderPlayersList(gameObj){
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ function renderBoardFromState(state) {
|
|||
const container = q('#board-container');
|
||||
if(!container){ console.error('renderBoardFromState: #board-container not found'); return; }
|
||||
console.log('renderBoardFromState called, state present?', !!state);
|
||||
// clear previous board and overlays
|
||||
container.innerHTML = '';
|
||||
removeExistingOverlay(container);
|
||||
const boardEl = document.createElement('div');
|
||||
boardEl.className = 'board';
|
||||
|
||||
|
|
@ -67,9 +69,11 @@ function renderBoardFromState(state) {
|
|||
}
|
||||
}
|
||||
container.appendChild(boardEl);
|
||||
// (previously: overlay/drawing code removed per user request)
|
||||
console.log('renderBoardFromState: board appended (w=' + w + ', h=' + h + ')');
|
||||
}
|
||||
|
||||
|
||||
function setMeta(text) { q('#meta').textContent = text; }
|
||||
|
||||
q('#create-only')?.addEventListener('click', async () => {
|
||||
|
|
|
|||
|
|
@ -22,3 +22,9 @@ main{padding:16px}
|
|||
|
||||
/* Ensure selected cells have no visual effect (display-only mode) */
|
||||
.cell.selected{outline: none !important; box-shadow: none !important; border-color: inherit !important; background: inherit !important}
|
||||
|
||||
/* Overlay for drawings (arrows/circles) */
|
||||
.board-overlay-wrapper{position:relative;width:100%;height:100%;}
|
||||
.board-overlay{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:auto;z-index:30}
|
||||
.overlay-controls button{background:rgba(255,255,255,0.9);border:1px solid #ccc;padding:6px 8px;border-radius:4px;cursor:pointer}
|
||||
.overlay-controls button:hover{filter:brightness(0.95)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue