UI polish: opponent draw flash, compact house rules with suit separators, toast styling.

- Opponent draw highlight: scale + outline flash animation
- House rules reorganized: Gameplay, Jokers, Card Values, Bonuses & Penalties
- Compact inline rule descriptions with alternating suit separators (♣♦♠♥)
- Wolfpack + Four of a Kind combo note when both selected
- Toast notifications now yellow/green with charcoal text
- Brief pause after AI draw for visual feedback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Aaron D. Lee
2026-01-26 21:37:02 -05:00
parent 33e3f124ed
commit 36a71799b5
4 changed files with 278 additions and 86 deletions

View File

@@ -168,6 +168,7 @@ class GolfGame {
this.fourOfAKindCheckbox = document.getElementById('four-of-a-kind');
this.negativePairsCheckbox = document.getElementById('negative-pairs-keep-value');
this.oneEyedJacksCheckbox = document.getElementById('one-eyed-jacks');
this.wolfpackComboNote = document.getElementById('wolfpack-combo-note');
this.startGameBtn = document.getElementById('start-game-btn');
this.leaveRoomBtn = document.getElementById('leave-room-btn');
this.addCpuBtn = document.getElementById('add-cpu-btn');
@@ -249,6 +250,17 @@ class GolfGame {
this.updateDeckRecommendation(playerCount);
});
// Show combo note when wolfpack + four-of-a-kind are both selected
const updateWolfpackCombo = () => {
if (this.wolfpackCheckbox.checked && this.fourOfAKindCheckbox.checked) {
this.wolfpackComboNote.classList.remove('hidden');
} else {
this.wolfpackComboNote.classList.add('hidden');
}
};
this.wolfpackCheckbox.addEventListener('change', updateWolfpackCombo);
this.fourOfAKindCheckbox.addEventListener('change', updateWolfpackCombo);
// Toggle scoreboard collapse on mobile
const scoreboardTitle = this.scoreboard.querySelector('h4');
if (scoreboardTitle) {
@@ -932,7 +944,7 @@ class GolfGame {
// The swap animation handles showing the card at the correct position
}
// Pulse animation on deck or discard pile to show where opponent drew from
// Flash animation on deck or discard pile to show where opponent drew from
pulseDrawPile(source) {
const pile = source === 'discard' ? this.discard : this.deck;
pile.classList.remove('draw-pulse');
@@ -940,7 +952,7 @@ class GolfGame {
void pile.offsetWidth;
pile.classList.add('draw-pulse');
// Remove class after animation completes
setTimeout(() => pile.classList.remove('draw-pulse'), 600);
setTimeout(() => pile.classList.remove('draw-pulse'), 400);
}
// Fire animation for discard without swap (card goes deck -> discard)