in progress: major changes to gameboard styling
This commit is contained in:
@@ -4,8 +4,8 @@
|
|||||||
.card-row {
|
.card-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
margin: 1rem;
|
margin: 1rem 0;
|
||||||
width: 80vw;
|
width: 55vw;
|
||||||
|
|
||||||
.card-row-top-bar {
|
.card-row-top-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,11 +1,29 @@
|
|||||||
.gameboard-rows {
|
.gameboard {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: row nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
background-color: rgb(57, 57, 65);
|
background-color: rgb(57, 57, 65);
|
||||||
width: 90vw;
|
width: 100%;
|
||||||
padding: 1rem 1rem 4rem;
|
|
||||||
|
section {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gameboard-left {
|
||||||
|
min-width: 50vw;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gameboard-right {
|
||||||
|
min-width: 35vw;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.round-marker {
|
.round-marker {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
|
|||||||
@@ -86,15 +86,19 @@ export default function Gameboard({ state, setState }: StateProps) {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
setView(
|
setView(
|
||||||
<div className="gameboard-rows">
|
<div className="gameboard">
|
||||||
<h1 className="round-marker">Round: {state.round}</h1>
|
<section className="gameboard-left">
|
||||||
<Nobles state={state} setState={setState} />
|
<h1 className="round-marker">Round: {state.round}</h1>
|
||||||
<CardRow tier={3} state={state} setState={setState} />
|
<Nobles state={state} setState={setState} />
|
||||||
<CardRow tier={2} state={state} setState={setState} />
|
<CardRow tier={3} state={state} setState={setState} />
|
||||||
<CardRow tier={1} state={state} setState={setState} />
|
<CardRow tier={2} state={state} setState={setState} />
|
||||||
<SelectionView state={state} setState={setState} />
|
<CardRow tier={1} state={state} setState={setState} />
|
||||||
<AvailableChips state={state} setState={setState} liftSelection={liftSelection} />
|
</section>
|
||||||
<AllPlayers state={state} setState={setState} />
|
<section className="gameboard-right">
|
||||||
|
<SelectionView state={state} setState={setState} />
|
||||||
|
<AvailableChips state={state} setState={setState} liftSelection={liftSelection} />
|
||||||
|
<AllPlayers state={state} setState={setState} />
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,17 @@
|
|||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
background-color: rgb(212, 196, 152);
|
background-color: rgb(212, 196, 152);
|
||||||
color: black;
|
color: black;
|
||||||
padding: 1.5rem 0;
|
padding: 1rem 0;
|
||||||
width: 65vw;
|
min-width: 55vw;
|
||||||
|
|
||||||
.noble-header {
|
.nobles-topbar {
|
||||||
position: relative;
|
display: flex;
|
||||||
bottom: 1rem;
|
flex-flow: row nowrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: baseline;
|
||||||
|
> * {
|
||||||
|
margin: 0 1rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.all-nobles {
|
.all-nobles {
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ import { v4 } from "uuid";
|
|||||||
import { NobleData, ResourceCost } from "../../util/types";
|
import { NobleData, ResourceCost } from "../../util/types";
|
||||||
import { StateProps } from "../../util/propTypes";
|
import { StateProps } from "../../util/propTypes";
|
||||||
import "../Nobles/Nobles.scss"
|
import "../Nobles/Nobles.scss"
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function Nobles({ state }: StateProps) {
|
export default function Nobles({ state }: StateProps) {
|
||||||
|
const [collapsed, setCollapsed] = useState(true);
|
||||||
|
|
||||||
if (!state.gameboard.nobles.length) {
|
if (!state.gameboard.nobles.length) {
|
||||||
return (
|
return (
|
||||||
<div className="nobles-panel">
|
<div className="nobles-panel">
|
||||||
@@ -15,8 +18,11 @@ export default function Nobles({ state }: StateProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="nobles-panel">
|
<div className="nobles-panel">
|
||||||
<strong className="noble-header">NOBLES: 3 points each</strong>
|
<div className="nobles-topbar">
|
||||||
<div className="all-nobles">
|
<strong className="nobles-header">NOBLES</strong>
|
||||||
|
<button onClick={() => setCollapsed(!collapsed)}>{collapsed ? "Show" : "Hide"}</button>
|
||||||
|
</div>
|
||||||
|
<div className={collapsed ? "hidden" : "all-nobles"}>
|
||||||
{
|
{
|
||||||
state && state.gameboard.nobles.map((noble: NobleData) => {
|
state && state.gameboard.nobles.map((noble: NobleData) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
.all-players {
|
.all-players {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
min-width: 80vw;
|
max-width: 80vw;
|
||||||
|
padding: 0 2rem;
|
||||||
background-color: rgb(237, 213, 156);
|
background-color: rgb(237, 213, 156);
|
||||||
color: black;
|
color: black;
|
||||||
|
|
||||||
.player-ui {
|
.player-ui {
|
||||||
|
width: 30vw;
|
||||||
p {
|
p {
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,13 +52,12 @@ export default function Player({ player, state, setState }: PlayerProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="player-ui" key={v4()}>
|
<div className={dynamic && dynamic.turnActive ? 'player-ui' : 'hidden'} key={v4()}>
|
||||||
<p className="subheader">Name: {player.name} {player.starter && "(round starter)"}</p>
|
<p className="subheader">Name: {player.name} {player.starter && "(round starter)"}</p>
|
||||||
|
|
||||||
{/* Dynamic data from state */}
|
{/* Dynamic data from state */}
|
||||||
<section className="turn-and-action-based">
|
<section className="turn-and-action-based">
|
||||||
<p>Score: {dynamic && dynamic.points}</p>
|
<p>Score: {dynamic && dynamic.points}</p>
|
||||||
<p>{dynamic?.turnActive ? "It's your turn!" : "..."}</p>
|
|
||||||
|
|
||||||
{/* Player actions */}
|
{/* Player actions */}
|
||||||
<button
|
<button
|
||||||
@@ -78,12 +77,9 @@ export default function Player({ player, state, setState }: PlayerProps) {
|
|||||||
onClick={() => handleClick(2)}>
|
onClick={() => handleClick(2)}>
|
||||||
Reserve Card
|
Reserve Card
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className="resources">
|
<section className="resources">
|
||||||
<p className="subheader">{dynamic?.name}'s Resources</p>
|
|
||||||
|
|
||||||
<div className="player-chips">
|
<div className="player-chips">
|
||||||
<p>Chips:</p>
|
<p>Chips:</p>
|
||||||
<div className="player-chips-enum">
|
<div className="player-chips-enum">
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
.available-chips {
|
.available-chips {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row wrap;
|
||||||
background-color: rgb(236, 238, 186);
|
max-width: 50%;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
color: black;
|
color: black;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ export default function SelectionView({ state, setState }: StateProps) {
|
|||||||
const [view, setView] = useState(<></>);
|
const [view, setView] = useState(<></>);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setCurrentPlayer(useCurrentPlayer(state));
|
||||||
|
|
||||||
setView(() => {
|
setView(() => {
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case (actionTypes[0].active):
|
case (actionTypes[0].active):
|
||||||
@@ -36,9 +38,7 @@ export default function SelectionView({ state, setState }: StateProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}, [state, setState])
|
||||||
setCurrentPlayer(useCurrentPlayer(state));
|
|
||||||
}, [state, state.actions, setState])
|
|
||||||
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
max-width: 1280px;
|
width: 99vw;
|
||||||
margin: 0 auto;
|
margin: 0 0.5vw;
|
||||||
padding: 2rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user