From 4eab9a899b5346c31071b9fb15d0ed794458839a Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 22 Aug 2025 10:48:11 +0000 Subject: [PATCH] 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. --- src/components/BulgarianSolitaire.tsx | 7 +++++-- tailwind.config.ts | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/BulgarianSolitaire.tsx b/src/components/BulgarianSolitaire.tsx index b813a5b..1cac503 100644 --- a/src/components/BulgarianSolitaire.tsx +++ b/src/components/BulgarianSolitaire.tsx @@ -302,6 +302,9 @@ const BulgarianSolitaire: React.FC = ({ 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 = ({ showSocialShare setN(value[0])} - min={3} + min={2} max={45} step={1} className="w-32" @@ -440,7 +443,7 @@ const BulgarianSolitaire: React.FC = ({ 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" > diff --git a/tailwind.config.ts b/tailwind.config.ts index e2277b4..812f0fa 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -100,11 +100,16 @@ export default { to: { height: '0' } + }, + 'fade-red': { + '0%, 100%': { backgroundColor: 'hsl(var(--primary))' }, + '50%': { backgroundColor: 'hsl(0, 84%, 60%)' } } }, animation: { 'accordion-down': 'accordion-down 0.2s ease-out', - 'accordion-up': 'accordion-up 0.2s ease-out' + 'accordion-up': 'accordion-up 0.2s ease-out', + 'fade-red': 'fade-red 1.6s ease-in-out infinite' }, fontFamily: { 'sans': ['Lato', 'ui-sans-serif', 'system-ui', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', 'Noto Sans', 'sans-serif'],