This commit is contained in:
sepia 2025-07-20 17:44:21 -05:00
parent 2aa8ee78a9
commit 7cbeef6482
6 changed files with 114 additions and 78 deletions

View file

@ -24,13 +24,14 @@ export function renderGameBoardHtml(
const intersectionId = `intersection-${row}-${col}`;
let stoneHtml = '';
if (stone) {
const colorClass = stone === 'black' ? 'stone-black-heart' : 'stone-white-heart';
const colorClass =
stone === 'black' ? 'stone-black-heart' : 'stone-white-heart';
stoneHtml = `<div class="${colorClass}"></div>`;
}
// Calculate top and left for absolute positioning, offset by half the intersection div size
const top = (row * 30);
const left = (col * 30);
const top = row * 30;
const left = col * 30;
// HTMX attributes for making a move
const wsAttrs = isPlayersTurn && !stone ? `ws-send="click"` : '';