Improve 2P Tetris preview match

Align 2P Next Piece previews to match 1P styling in Tetris.tsx by restoring consistent layout, sizing, and borders for both P1 and P2 preview blocks. Updated P1 and P2 Next Piece sections to use identical structure, padding, and typography for a unified desktop UI.

X-Lovable-Edit-ID: edt-ee763eca-490c-4169-af1e-2c648707e7bf
This commit is contained in:
gpt-engineer-app[bot]
2026-01-09 11:32:36 +00:00
+24 -20
View File
@@ -679,16 +679,18 @@ const Tetris = () => {
</div> </div>
{/* P1 Next Piece */} {/* P1 Next Piece */}
<div className="border-2 border-primary/50 p-3 bg-background/50 flex flex-col items-center justify-center min-h-[80px]"> <div className="border-2 border-primary/50 p-4 bg-background/60">
<p className="font-pixel text-[10px] text-foreground/60 mb-2">P1 NEXT</p> <p className="font-pixel text-[10px] text-foreground/50 uppercase tracking-wider mb-3">Next</p>
<div className="flex flex-col gap-0.5"> <div className="flex justify-center">
{player1.nextPiece.shape.map((row, y) => ( <div className="flex flex-col gap-1">
<div key={y} className="flex gap-0.5"> {player1.nextPiece.shape.map((row, y) => (
{row.map((val, x) => ( <div key={y} className="flex gap-1">
<div key={`${y}-${x}`} className={`w-4 h-4 ${val ? 'bg-primary box-glow' : 'bg-transparent'}`} /> {row.map((val, x) => (
))} <div key={`${y}-${x}`} className={`w-4 h-4 ${val ? 'bg-primary box-glow' : 'bg-transparent'}`} />
</div> ))}
))} </div>
))}
</div>
</div> </div>
</div> </div>
@@ -726,16 +728,18 @@ const Tetris = () => {
</div> </div>
{/* P2 Next Piece */} {/* P2 Next Piece */}
<div className="border-2 border-purple-500/50 p-3 bg-background/50 flex flex-col items-center justify-center min-h-[80px]"> <div className="border-2 border-purple-500/50 p-4 bg-background/60">
<p className="font-pixel text-[10px] text-purple-400 mb-2">P2 NEXT</p> <p className="font-pixel text-[10px] text-purple-400/70 uppercase tracking-wider mb-3">Next</p>
<div className="flex flex-col gap-0.5"> <div className="flex justify-center">
{player2.nextPiece.shape.map((row, y) => ( <div className="flex flex-col gap-1">
<div key={y} className="flex gap-0.5"> {player2.nextPiece.shape.map((row, y) => (
{row.map((val, x) => ( <div key={y} className="flex gap-1">
<div key={`${y}-${x}`} className={`w-4 h-4 ${val ? 'bg-purple-400' : 'bg-transparent'}`} style={{ boxShadow: val ? '0 0 6px hsl(280 70% 50%)' : 'none' }} /> {row.map((val, x) => (
))} <div key={`${y}-${x}`} className={`w-4 h-4 ${val ? 'bg-purple-400' : 'bg-transparent'}`} style={{ boxShadow: val ? '0 0 6px hsl(280 70% 50%)' : 'none' }} />
</div> ))}
))} </div>
))}
</div>
</div> </div>
</div> </div>
</> </>