minor UI changes

This commit is contained in:
2026-11-02 21:24:20 +03:00
parent 802968df3d
commit 153dc74ff6
+30 -37
View File
@@ -128,11 +128,11 @@ export default function ShipPlacementScreen({
prev.map((s) =>
s.id === ship.id
? {
...s,
x: rot.x,
y: rot.y,
orientation: rot.orientation,
}
...s,
x: rot.x,
y: rot.y,
orientation: rot.orientation,
}
: s
)
)
@@ -235,12 +235,12 @@ export default function ShipPlacementScreen({
prev.map((s) =>
s.id === drag.ship.id
? {
...s,
placed: true,
x: drag.candidate.x,
y: drag.candidate.y,
orientation: drag.candidate.orientation,
}
...s,
placed: true,
x: drag.candidate.x,
y: drag.candidate.y,
orientation: drag.candidate.orientation,
}
: s
)
)
@@ -250,12 +250,12 @@ export default function ShipPlacementScreen({
prev.map((s) =>
s.id === drag.ship.id
? {
...s,
placed: false,
x: 0,
y: 0,
orientation: false,
}
...s,
placed: false,
x: 0,
y: 0,
orientation: false,
}
: s
)
)
@@ -313,11 +313,9 @@ export default function ShipPlacementScreen({
return (
<div className="placement-screen-layout">
{opponentReady && (
<div className="placement-opponent-badge">
Соперник готов к бою!
</div>
)}
<div className="placement-opponent-badge">
{opponentReady ? "Соперник готов к бою!" : "Соперник расставляет корабли..."}
</div>
<div className="placement-container">
{/* Левая половина: игровое поле 10x10 с линейками и кнопками под ним */}
@@ -421,28 +419,23 @@ export default function ShipPlacementScreen({
{/* Парящий под курсором корабль при перетаскивании */}
{activeDrag && (
<div
className={`floating-drag-ship ${
activeDrag.orientation ? 'vertical' : 'horizontal'
}`}
className={`floating-drag-ship ${activeDrag.orientation ? 'vertical' : 'horizontal'
}`}
style={{
left: `${
activeDrag.currentPos.x -
left: `${activeDrag.currentPos.x -
(!activeDrag.orientation ? activeDrag.segIndex * 33 + 15 : 15)
}px`,
top: `${
activeDrag.currentPos.y -
}px`,
top: `${activeDrag.currentPos.y -
(activeDrag.orientation ? activeDrag.segIndex * 33 + 15 : 15)
}px`,
width: `${
!activeDrag.orientation
}px`,
width: `${!activeDrag.orientation
? activeDrag.ship.size * 30 + (activeDrag.ship.size - 1) * 3
: 30
}px`,
height: `${
activeDrag.orientation
}px`,
height: `${activeDrag.orientation
? activeDrag.ship.size * 30 + (activeDrag.ship.size - 1) * 3
: 30
}px`,
}px`,
}}
>
{Array.from({ length: activeDrag.ship.size }).map((_, segIdx) => (