streamlined gameboard view, proportion adjustments

This commit is contained in:
Mikayla Dobson
2022-08-26 16:58:51 -05:00
parent 25f2bb5837
commit a9a6b83500
7 changed files with 46 additions and 6 deletions

View File

@@ -64,6 +64,18 @@
color: white; color: white;
width: 25%; width: 25%;
} }
.cc-tier {
&-1 {
background-color: rgb(3, 30, 3);
}
&-2 {
background-color: rgb(80, 80, 7);
}
&-3 {
background-color: rgb(9, 9, 77);
}
}
} }
} }

View File

@@ -33,7 +33,7 @@ export default function CardRow({tier, state, setState}: CardRowProps) {
<button onClick={() => setCollapsed(!collapsed)}>{collapsed ? "Show" : "Hide"}</button> <button onClick={() => setCollapsed(!collapsed)}>{collapsed ? "Show" : "Hide"}</button>
</div> </div>
<div className={`card-row-cards-visible ${collapsed && 'hidden'}`}> <div className={`card-row-cards-visible ${collapsed && 'hidden'}`}>
<div className="card-count"> <div className={`card-count cc-tier-${tier}`}>
<p>Remaining: {state.gameboard.deck[typedTier].length}</p> <p>Remaining: {state.gameboard.deck[typedTier].length}</p>
</div> </div>
{ cards && cards.map((cardData: CardData) => { { cards && cards.map((cardData: CardData) => {

View File

@@ -0,0 +1,13 @@
.gameboard-rows {
display: flex;
flex-flow: column nowrap;
align-items: center;
background-color: rgb(57, 57, 65);
width: 90vw;
padding: 1rem 1rem 4rem;
.round-marker {
font-size: 1.5rem;
}
}

View File

@@ -87,7 +87,7 @@ export default function Gameboard({ state, setState }: StateProps) {
} else { } else {
setView( setView(
<div className="gameboard-rows"> <div className="gameboard-rows">
<strong>Round: {state.round}</strong> <h1 className="round-marker">Round: {state.round}</h1>
<Nobles state={state} setState={setState} /> <Nobles state={state} setState={setState} />
<CardRow tier={3} state={state} setState={setState} /> <CardRow tier={3} state={state} setState={setState} />
<CardRow tier={2} state={state} setState={setState} /> <CardRow tier={2} state={state} setState={setState} />

View File

@@ -3,10 +3,16 @@
.nobles-panel { .nobles-panel {
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
background-color: rgb(240, 236, 225); background-color: rgb(212, 196, 152);
color: black; color: black;
padding: 1.5rem; padding: 1.5rem 0;
width: 65vw;
.noble-header {
position: relative;
bottom: 1rem;
}
.all-nobles { .all-nobles {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
@@ -15,6 +21,13 @@
.noble-card { .noble-card {
display: inline-flex; display: inline-flex;
flex-flow: column nowrap; flex-flow: column nowrap;
align-items: center;
height: 100%;
min-width: 25%;
border-right: 1px solid black;
&:last-child {
border-right: none;
}
.mapped-noble-costs { .mapped-noble-costs {
display: flex; display: flex;

View File

@@ -15,13 +15,12 @@ export default function Nobles({ state }: StateProps) {
return ( return (
<div className="nobles-panel"> <div className="nobles-panel">
<strong>NOBLES</strong> <strong className="noble-header">NOBLES: 3 points each</strong>
<div className="all-nobles"> <div className="all-nobles">
{ {
state && state.gameboard.nobles.map((noble: NobleData) => { state && state.gameboard.nobles.map((noble: NobleData) => {
return ( return (
<div className="noble-card" key={v4()}> <div className="noble-card" key={v4()}>
<p>{noble.points} points</p>
<p>Cost:</p> <p>Cost:</p>
<div className="mapped-noble-costs"> <div className="mapped-noble-costs">
{ {

View File

@@ -3,8 +3,11 @@
.all-players { .all-players {
display: flex; display: flex;
justify-content: space-around;
min-width: 80vw;
background-color: rgb(237, 213, 156); background-color: rgb(237, 213, 156);
color: black; color: black;
.player-ui { .player-ui {
p { p {
margin: 1rem; margin: 1rem;