Fix Subtraction Game bugs

Update background color transition to fade instead of blink.
Change the minimum value for n to 2.
Debug and fix issues with the reset functionality not fully clearing the game state.
This commit is contained in:
gpt-engineer-app[bot] 2025-08-22 10:48:11 +00:00
parent 68b40be8ec
commit 4eab9a899b
2 changed files with 11 additions and 3 deletions

View file

@ -302,6 +302,9 @@ const BulgarianSolitaire: React.FC<BulgarianSolitaireProps> = ({ showSocialShare
pauseRef.current = false;
setIsPaused(false);
setIsPlaying(false);
setDraggedBox(null);
setLastUsedColumn(null);
setSelectedBoxForMove(null);
const newBoxes: Box[] = [];
for (let i = 0; i < totalBoxes; i++) {
@ -365,7 +368,7 @@ const BulgarianSolitaire: React.FC<BulgarianSolitaireProps> = ({ showSocialShare
<Slider
value={[n]}
onValueChange={(value) => setN(value[0])}
min={3}
min={2}
max={45}
step={1}
className="w-32"
@ -440,7 +443,7 @@ const BulgarianSolitaire: React.FC<BulgarianSolitaireProps> = ({ showSocialShare
highlightedBoxes.has(boxId)
? 'bg-red-500 text-white shadow-lg scale-110'
: 'bg-primary text-primary-foreground hover:bg-primary/80'
} ${isAnimating && highlightedBoxes.has(boxId) ? 'animate-pulse' : ''}`}
} ${isAnimating && highlightedBoxes.has(boxId) ? 'animate-[fade-red_1.6s_ease-in-out_infinite]' : ''}`}
title="Drag to move or double-click to move to last-used column"
>
</div>