adjust style for doudizhu and leduc holdem

This commit is contained in:
songyih 2020-02-24 23:53:13 -08:00
parent 3fb2273b84
commit da98395817
10 changed files with 46 additions and 29 deletions

View File

@ -73,10 +73,12 @@
.playingCards .card.back { .playingCards .card.back {
text-indent: -4000px; text-indent: -4000px;
background-color: #ccc; background-color: #ccc;
background-repeat: repeat; background-repeat: no-repeat;
background-image: url(data:image/gif;base64,R0lGODlhJAAkAJEAAOjFsezdztOKbL5QKCH5BAAAAAAALAAAAAAkACQAAAL/HC4RAqm/mmLHyHmAbczB11Ea8ombJKSgKo6Z17pXFznmS1JptiX0z3vVhpEKDoUIkoa0olGIUeZUk1RI6Yn2mh/FDAt6frOrRRTqXPpsVLYugzxaVy+YcBdnoWPZOT0E4eckQtZFZBjWoHixQFWl6Nhol6R2p1Okt5TGaEWZA6fjiMdhZgPHeWrTWGVq+jTZg1HYyAEWKLYzmyiGKoUimilz+YYryyTlg5RcDJSAbNx0Q7lMcbIGEyzTK8zVdfVaImzs/QV+prYqWWW2ObkoOApM/Em/rUlIm7fijs8a2EEKEaZ3AsMUgneEU6RcpJbZ27aGHkAO2Ors8xQH1IR0Bn5YnOtVAAA7); /* image is "Pattern 069" from http://www.squidfingers.com/patterns/ */ background-image: url("./faces/pokerback.png"); /* image is "Pattern 069" from http://www.squidfingers.com/patterns/ */
background-image: -moz-repeating-linear-gradient(34% 6% 135deg,#0F1E59, #75A1BF, #3E3E63 50%); background-size: 100% 100%;
background-image: -webkit-gradient(radial, center center, 20, center center, 80, from(#3c3), color-stop(0.4, #363), to(#030)); background-position: bottom;
/*background-image: -moz-repeating-linear-gradient(34% 6% 135deg,#0F1E59, #75A1BF, #3E3E63 50%);*/
/*background-image: -webkit-gradient(radial, center center, 20, center center, 80, from(#3c3), color-stop(0.4, #363), to(#030));*/
/* yes, it's intentional that Mozilla, Webkit, Opera and IE all will get different backgrounds ... why not? :) */ /* yes, it's intentional that Mozilla, Webkit, Opera and IE all will get different backgrounds ... why not? :) */
} }

View File

@ -3,10 +3,10 @@
.doudizhu-wrapper { .doudizhu-wrapper {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #C3CDFF; //background-color: #C3CDFF;
background-image: url("./images/table.png"); background-image: url("./images/gameboard.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 70%; background-size: 100% 125%;
background-position: bottom; background-position: bottom;
position: relative; position: relative;

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -170,6 +170,7 @@
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
font-weight: bolder;
} }
} }
.non-card.hide { .non-card.hide {
@ -262,6 +263,8 @@
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
font-weight: bolder;
color: #303133;
} }
} }
.non-card.hide { .non-card.hide {

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 KiB

View File

@ -1,8 +1,9 @@
@import url('https://fonts.googleapis.com/css?family=Arvo&display=swap');
body { body {
margin: 0; margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', color: #606266;
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', font-family: 'Rockwell', 'Arvo', monospace;
sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }

View File

@ -2,17 +2,17 @@
.leduc-holdem-wrapper { .leduc-holdem-wrapper {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #C3CDFF; //background-color: #C3CDFF;
// background-image: url("./images/table.png"); background-image: url("./images/gameboard.png");
// background-repeat: no-repeat; background-repeat: no-repeat;
// background-size: 100% 70%; background-size: 100% 132%;
// background-position: bottom; background-position: bottom;
position: relative; position: relative;
.played-card-area { .played-card-area {
font-size: 12px; font-size: 12px;
width: 40%; width: 40%;
margin-left: 90%; margin-left: 65%;
position: relative; position: relative;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -78,7 +78,9 @@
text-align: center; text-align: center;
} }
.bet-value { .bet-value {
color: whitesmoke;
position: relative; position: relative;
text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87);
top: -120px; top: -120px;
left: 120px; left: 120px;
font-weight: bold; font-weight: bold;
@ -94,6 +96,13 @@
.pile-placeholder{ .pile-placeholder{
width: 24px; width: 24px;
margin-top: 0; margin-top: 0;
.token-img {
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.87);
-moz-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.87);
-webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.87);
-o-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.87);
border-radius: 15px;
}
} }
div { div {
position: relative; position: relative;
@ -156,10 +165,12 @@
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
font-size: 20px; span.round-number {
font-weight: bold; font-size: 20px;
text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87); font-weight: bold;
color: #F2F6FC; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87);
color: #F2F6FC;
}
} }
.playingCards { .playingCards {
transform: translate(3px, 10px); transform: translate(3px, 10px);

View File

@ -79,7 +79,7 @@ class LeducHoldemGameBoard extends React.Component {
if (value !== 0) { if (value !== 0) {
let grandChild = []; let grandChild = [];
for (let j = 0; j < value; j++) { for (let j = 0; j < value; j++) {
grandChild.push(<div key={key + '_' + j}><img src={require('../../assets/images/Tokens/Token_' + key + '.png')} height="100%" width="100%" /></div>); grandChild.push(<div key={key + '_' + j}><img className={"token-img"} src={require('../../assets/images/Tokens/Token_' + key + '.png')} height="100%" width="100%" alt={"taken"}/></div>);
} }
let subElement = React.createElement("div", { className: "pile-placeholder", key: key+'_'+value}, grandChild); let subElement = React.createElement("div", { className: "pile-placeholder", key: key+'_'+value}, grandChild);
child.push(subElement); child.push(subElement);
@ -160,7 +160,7 @@ class LeducHoldemGameBoard extends React.Component {
<span className="bet-value">{`Bet: ${this.props.pot[bottomIdx]}`}</span> <span className="bet-value">{`Bet: ${this.props.pot[bottomIdx]}`}</span>
{this.computeTokenImage(this.props.pot[bottomIdx])} {this.computeTokenImage(this.props.pot[bottomIdx])}
</div> </div>
{bottomIdx >= 0 ? <div className="player-hand">{this.computeHand(this.props.hands[bottomIdx])}</div> : <div className="player-hand-placeholder"><span>Waiting...</span></div>} {bottomIdx >= 0 ? <div className="player-hand">{this.computeHand(this.props.hands[bottomIdx])}</div> : <div className="player-hand-placeholder"><span style={{"color": "white"}}>Waiting...</span></div>}
</div> </div>
</div> </div>
<div id={"top-player"}> <div id={"top-player"}>
@ -170,7 +170,7 @@ class LeducHoldemGameBoard extends React.Component {
<span className="bet-value">{`Bet: ${this.props.pot[topIdx]}`}</span> <span className="bet-value">{`Bet: ${this.props.pot[topIdx]}`}</span>
{this.computeTokenImage(this.props.pot[topIdx])} {this.computeTokenImage(this.props.pot[topIdx])}
</div> </div>
{topIdx >= 0 ? <div className="player-hand">{this.computeHand(this.props.hands[topIdx])}</div> : <div className="player-hand-placeholder"><span>Waiting...</span></div>} {topIdx >= 0 ? <div className="player-hand">{this.computeHand(this.props.hands[topIdx])}</div> : <div className="player-hand-placeholder"><span style={{"color": "white"}}>Waiting...</span></div>}
</div> </div>
<div className="played-card-area"> <div className="played-card-area">
{topIdx >= 0 ? this.playerDecisionArea(topIdx) : ""} {topIdx >= 0 ? this.playerDecisionArea(topIdx) : ""}
@ -178,7 +178,7 @@ class LeducHoldemGameBoard extends React.Component {
</div> </div>
<div id={"public-card-area"}> <div id={"public-card-area"}>
<div className={"info-area"}> <div className={"info-area"}>
<span>{`Round: ${this.props.round+1}`}</span> <span className={"round-number"}>{`Round: ${this.props.round+1}`}</span>
{this.displayPublicCard()} {this.displayPublicCard()}
</div> </div>
</div> </div>

View File

@ -272,7 +272,7 @@ class DoudizhuGameView extends React.Component {
computeProbabilityItem(idx){ computeProbabilityItem(idx){
if(this.state.gameInfo.gameStatus !== "ready" && this.state.gameInfo.turn < this.moveHistory.length){ if(this.state.gameInfo.gameStatus !== "ready" && this.state.gameInfo.turn < this.moveHistory.length){
let style = {}; let style = {};
style["backgroundColor"] = this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ? `rgba(130, 151, 255 , ${this.moveHistory[this.state.gameInfo.turn].probabilities[idx].probability})` : "#bdbdbd"; style["backgroundColor"] = this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ? `rgba(63, 81, 181, ${this.moveHistory[this.state.gameInfo.turn].probabilities[idx].probability})` : "#bdbdbd";
return ( return (
<div className={"playing"} style={style}> <div className={"playing"} style={style}>
<div className="probability-move"> <div className="probability-move">
@ -284,7 +284,7 @@ class DoudizhuGameView extends React.Component {
</div> </div>
{this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ? {this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ?
<div className={"non-card"}> <div className={"non-card"}>
<span>{this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ? `Probability: ${(this.moveHistory[this.state.gameInfo.turn].probabilities[idx].probability * 100).toFixed(2)}%` : ""}</span> <span>{this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ? `Probability ${(this.moveHistory[this.state.gameInfo.turn].probabilities[idx].probability * 100).toFixed(2)}%` : ""}</span>
</div> </div>
: :
"" ""
@ -426,7 +426,7 @@ class DoudizhuGameView extends React.Component {
<Divider orientation="vertical" /> <Divider orientation="vertical" />
</Layout.Col> </Layout.Col>
<Layout.Col span="3" style={{"height": "51px", "lineHeight": "51px", "marginLeft": "-1px", "marginRight": "-1px"}}> <Layout.Col span="3" style={{"height": "51px", "lineHeight": "51px", "marginLeft": "-1px", "marginRight": "-1px"}}>
<div style={{"textAlign": "center"}}>{`Turn: ${this.state.gameInfo.turn}`}</div> <div style={{"textAlign": "center"}}>{`Turn ${this.state.gameInfo.turn}`}</div>
</Layout.Col> </Layout.Col>
<Layout.Col span="1" style={{"height": "100%", "width": "1px"}}> <Layout.Col span="1" style={{"height": "100%", "width": "1px"}}>
<Divider orientation="vertical" /> <Divider orientation="vertical" />

View File

@ -272,7 +272,7 @@ class LeducHoldemGameView extends React.Component {
</div> </div>
{currentMove !== null ? {currentMove !== null ?
(<div className={"non-card"}> (<div className={"non-card"}>
<span>{`Probability: ${(currentMove.probabilities[idx].probability * 100).toFixed(2)}%`}</span> <span>{`Probability ${(currentMove.probabilities[idx].probability * 100).toFixed(2)}%`}</span>
</div>) : ""} </div>) : ""}
</div> </div>
) )
@ -420,7 +420,7 @@ class LeducHoldemGameView extends React.Component {
<Divider orientation="vertical" /> <Divider orientation="vertical" />
</Layout.Col> </Layout.Col>
<Layout.Col span="3" style={{"height": "51px", "lineHeight": "51px", "marginLeft": "-1px", "marginRight": "-1px"}}> <Layout.Col span="3" style={{"height": "51px", "lineHeight": "51px", "marginLeft": "-1px", "marginRight": "-1px"}}>
<div style={{"textAlign": "center"}}>{`Turn: ${this.state.gameInfo.turn}`}</div> <div style={{"textAlign": "center"}}>{`Turn ${this.state.gameInfo.turn}`}</div>
</Layout.Col> </Layout.Col>
<Layout.Col span="1" style={{"height": "100%", "width": "1px"}}> <Layout.Col span="1" style={{"height": "100%", "width": "1px"}}>
<Divider orientation="vertical" /> <Divider orientation="vertical" />