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:
parent
68b40be8ec
commit
4eab9a899b
2 changed files with 11 additions and 3 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue