Commit 400ae908 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: duplicate wrap variable + remove roundRect (browser compat)

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 8922b607
...@@ -61,8 +61,8 @@ export function mountGame(el, params) { ...@@ -61,8 +61,8 @@ export function mountGame(el, params) {
el.querySelector('#roll-btn').addEventListener('click', () => handleRoll(el)); el.querySelector('#roll-btn').addEventListener('click', () => handleRoll(el));
// Emotes // Emotes
const wrap = el.querySelector('#ludo-wrap'); const emoteWrap = el.querySelector('#ludo-wrap');
emoteSystem.create(wrap, (emote) => { emoteSystem.create(emoteWrap, (emote) => {
audio.play('notification'); audio.play('notification');
emoteSystem.showReceived(wrap, emote.emoji); emoteSystem.showReceived(wrap, emote.emoji);
}); });
...@@ -150,23 +150,18 @@ function drawBoard() { ...@@ -150,23 +150,18 @@ function drawBoard() {
ctx.fillStyle = '#FAFAFA'; ctx.fillStyle = '#FAFAFA';
ctx.fillRect(0, 0, boardSize, boardSize); ctx.fillRect(0, 0, boardSize, boardSize);
// Home zones — with inner white area and colored border // Home zones — with inner white area
[[0,0,0],[1,9,0],[2,9,9],[3,0,9]].forEach(([p,c,r]) => { [[0,0,0],[1,9,0],[2,9,9],[3,0,9]].forEach(([p,c,r]) => {
ctx.fillStyle = COLORS[p]; ctx.fillStyle = COLORS[p];
ctx.fillRect(c*cs, r*cs, 6*cs, 6*cs); ctx.fillRect(c*cs, r*cs, 6*cs, 6*cs);
// Inner white rounded area // Inner white area
ctx.fillStyle = '#FAFAFA'; ctx.fillStyle = '#FAFAFA';
const ins = cs*0.9; const ins = cs*0.85;
const w = 6*cs-ins*2; ctx.fillRect(c*cs+ins, r*cs+ins, 6*cs-ins*2, 6*cs-ins*2);
ctx.beginPath(); // Inner colored border
ctx.roundRect(c*cs+ins, r*cs+ins, w, w, cs*0.4);
ctx.fill();
// Inner colored border ring
ctx.strokeStyle = COLORS[p]; ctx.strokeStyle = COLORS[p];
ctx.lineWidth = 2; ctx.lineWidth = 2.5;
ctx.beginPath(); ctx.strokeRect(c*cs+ins+3, r*cs+ins+3, 6*cs-ins*2-6, 6*cs-ins*2-6);
ctx.roundRect(c*cs+ins+4, r*cs+ins+4, w-8, w-8, cs*0.3);
ctx.stroke();
}); });
// Cross paths (white) // Cross paths (white)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment