Refactor Knights Puzzle layout
Move interactive to the left and add goal state image.
This commit is contained in:
parent
a335b3af6f
commit
ed4c6209d7
1 changed files with 43 additions and 22 deletions
|
|
@ -183,7 +183,9 @@ const KnightsPuzzle = ({
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{/* Yellow: Main interactive with controls */}
|
||||
{/* Interactive and Goal State side by side */}
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
{/* Left: Interactive game */}
|
||||
<Card className="bg-primary/5 border-primary/20">
|
||||
<CardContent className="pt-6">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
|
|
@ -208,6 +210,25 @@ const KnightsPuzzle = ({
|
|||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Right: Goal state */}
|
||||
<Card className="bg-green-500/5 border-green-500/20">
|
||||
<CardContent className="pt-6">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<div className="grid grid-cols-3 gap-1 border-2 border-outline rounded-lg p-4 bg-background">
|
||||
{targetBoard.map((row, rowIndex) => row.map((piece, colIndex) => <div key={`goal-${rowIndex}-${colIndex}`} className="w-16 h-16 border-2 border-outline flex items-center justify-center bg-surface">
|
||||
{renderPiece(piece)}
|
||||
</div>))}
|
||||
</div>
|
||||
|
||||
{/* Goal label */}
|
||||
<div className="text-center">
|
||||
<p className="text-sm font-medium text-green-700 dark:text-green-300">Goal State</p>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* Purple: Initial and Target positions side by side */}
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue