mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-14 06:58:00 +00:00
fix side counters
This commit is contained in:
@@ -56,11 +56,11 @@ const CommanderDamageButton = styled.button<{
|
|||||||
}}
|
}}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const CommanderDamageTextContainer = styled.p<{
|
const CommanderDamageTextContainer = styled.div<{
|
||||||
rotation: number;
|
rotation: number;
|
||||||
}>`
|
}>`
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 25%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
@@ -78,11 +78,7 @@ const CommanderDamageTextContainer = styled.p<{
|
|||||||
props.rotation === Rotation.Side
|
props.rotation === Rotation.Side
|
||||||
) {
|
) {
|
||||||
return css`
|
return css`
|
||||||
rotate: 180deg;
|
rotate: 270deg;
|
||||||
text-orientation: sideways;
|
|
||||||
writing-mode: vertical-lr;
|
|
||||||
height: 1rem;
|
|
||||||
width: auto;
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -52,27 +52,6 @@ const Counters = ({
|
|||||||
<CountersWrapper>
|
<CountersWrapper>
|
||||||
<CountersGrid gridTemplateAreas={gridAreas}>
|
<CountersGrid gridTemplateAreas={gridAreas}>
|
||||||
{players.map((player) => {
|
{players.map((player) => {
|
||||||
if (
|
|
||||||
player.settings.rotation === 90 ||
|
|
||||||
player.settings.rotation === 270
|
|
||||||
) {
|
|
||||||
return (
|
|
||||||
<GridItemContainer
|
|
||||||
key={player.index}
|
|
||||||
gridArea={`player${player.index}`}
|
|
||||||
>
|
|
||||||
<LifeCounter
|
|
||||||
backgroundColor={player.color}
|
|
||||||
player={player}
|
|
||||||
opponents={players.filter(
|
|
||||||
(opponent) => opponent.index !== player.index
|
|
||||||
)}
|
|
||||||
onPlayerChange={onPlayerChange}
|
|
||||||
resetCurrentGame={resetCurrentGame}
|
|
||||||
/>
|
|
||||||
</GridItemContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<GridItemContainer
|
<GridItemContainer
|
||||||
key={player.index}
|
key={player.index}
|
||||||
@@ -91,9 +70,6 @@ const Counters = ({
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</CountersGrid>
|
</CountersGrid>
|
||||||
{/* <S.SettingsButtonContainer>
|
|
||||||
<SettingsButton onClick={() => {}} rotation={0} />
|
|
||||||
</S.SettingsButtonContainer> */}
|
|
||||||
</CountersWrapper>
|
</CountersWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ const presetColors = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const getRotation = (index: number, gridAreas: GridTemplateAreas): Rotation => {
|
const getRotation = (index: number, gridAreas: GridTemplateAreas): Rotation => {
|
||||||
if (gridAreas === GridTemplateAreas.OnePlayerLandscape && index === 1) {
|
if (gridAreas === GridTemplateAreas.OnePlayerLandscape && index === 0) {
|
||||||
return Rotation.Normal;
|
return Rotation.Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gridAreas === GridTemplateAreas.OnePlayerPortrait && index === 1) {
|
if (gridAreas === GridTemplateAreas.OnePlayerPortrait && index === 0) {
|
||||||
return Rotation.Side;
|
return Rotation.Side;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user