Style adjustments

This commit is contained in:
sepia 2025-07-19 22:17:35 -05:00
parent f1d64ecdf3
commit badbe1f749
2 changed files with 74 additions and 23 deletions

View file

@ -24,13 +24,13 @@ export function renderGameBoardHtml(
const intersectionId = `intersection-${row}-${col}`;
let stoneHtml = '';
if (stone) {
const color = stone === 'black' ? 'black' : 'white';
stoneHtml = `<div style="background-color: ${color};"></div>`;
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) - 15; // 30px per grid unit, -15px to center the 30px intersection div
const left = (col * 30) - 15; // 30px per grid unit, -15px to center the 30px intersection div
const top = (row * 30);
const left = (col * 30);
// HTMX attributes for making a move
const wsAttrs = isPlayersTurn && !stone ? `ws-send="click"` : '';