beginning to define standards for chip design
This commit is contained in:
@@ -13,16 +13,21 @@ export default function Card({ data, state, setState }: CardProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" key={v4()}>
|
<div className="card" key={v4()}>
|
||||||
<div className="top-row">
|
|
||||||
<p>Counts as: {data.gemValue}</p>
|
<p>Counts as: {data.gemValue}</p>
|
||||||
<p>Point value: {data.points || 0}</p>
|
<p>Point value: {data.points || 0}</p>
|
||||||
<p>Cost:</p>
|
<p>Cost:</p>
|
||||||
|
<div className="total-card-cost">
|
||||||
{
|
{
|
||||||
Object.keys(data.resourceCost).map((key: keyof ResourceCost | string) => {
|
Object.keys(data.resourceCost).map((key: keyof ResourceCost | string) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return (data.resourceCost[key as keyof ResourceCost] > 0) && <p key={v4()}>{key}: {data.resourceCost[key as keyof ResourceCost]}</p>
|
return (data.resourceCost[key as keyof ResourceCost] > 0) && (
|
||||||
|
<p key={v4()} className={`card-cost-${key}`}>
|
||||||
|
{data.resourceCost[key as keyof ResourceCost]}
|
||||||
|
</p>
|
||||||
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
</div>
|
||||||
{ state.actions.buyCard.active &&
|
{ state.actions.buyCard.active &&
|
||||||
<button
|
<button
|
||||||
onClick={() => buyCard(state, setState, data)}
|
onClick={() => buyCard(state, setState, data)}
|
||||||
@@ -38,6 +43,5 @@ export default function Card({ data, state, setState }: CardProps) {
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
@import "../../sass/helper/mixins";
|
||||||
|
@import "../../sass/helper/placeholders";
|
||||||
|
|
||||||
.card-row {
|
.card-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
@@ -10,21 +13,36 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
|
border: 2px solid black;
|
||||||
|
> * {
|
||||||
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.total-card-cost {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
@include map-gem-values(".card-cost");
|
||||||
|
p {
|
||||||
|
@extend %chip-design;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.tier-1 {
|
.tier-1 {
|
||||||
background-color: green;
|
background-color: rgb(9, 67, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tier-2 {
|
.tier-2 {
|
||||||
background-color: yellow;
|
background-color: rgb(174, 174, 32);
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tier-3 {
|
.tier-3 {
|
||||||
background-color: blue;
|
background-color: rgb(35, 35, 167);
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
@import '../../sass/helper/mixins';
|
@import '../../sass/helper/mixins';
|
||||||
|
@import '../../sass/helper/placeholders';
|
||||||
|
|
||||||
.all-players {
|
.all-players {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -15,7 +16,11 @@
|
|||||||
.resources {
|
.resources {
|
||||||
.player-chips-enum {
|
.player-chips-enum {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
@include map-gem-values(".player-chip");
|
@include map-gem-values(".player-chip");
|
||||||
|
p {
|
||||||
|
@extend %chip-design;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,9 +93,7 @@ export default function Player({ player, state, setState }: PlayerProps) {
|
|||||||
<div className="player-chips-enum">
|
<div className="player-chips-enum">
|
||||||
{ dynamic && Object.entries(dynamic.inventory).map(([key,value]) => {
|
{ dynamic && Object.entries(dynamic.inventory).map(([key,value]) => {
|
||||||
return value > 0 && (
|
return value > 0 && (
|
||||||
<p key={v4()} className={`player-chip-${key}`}>
|
<p key={v4()} className={`player-chip-${key}`}>{value}</p>
|
||||||
{key}: {value}
|
|
||||||
</p>
|
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#{$parentClass} {
|
#{$parentClass} {
|
||||||
&-emerald {
|
&-emerald {
|
||||||
background-color: green;
|
background-color: green;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
&-diamond {
|
&-diamond {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
@@ -17,10 +18,12 @@
|
|||||||
}
|
}
|
||||||
&-ruby {
|
&-ruby {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
&-gold {
|
&-gold {
|
||||||
background-color: gold;
|
background-color: gold;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,15 @@
|
|||||||
%hidden {
|
%hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// designed to extend a "p" element
|
||||||
|
%chip-design {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 5px;
|
||||||
|
padding: 8px;
|
||||||
|
width: 1rem;
|
||||||
|
height: 1rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user