From 227863d3934b5eb951282016b653b3a3db0d34d3 Mon Sep 17 00:00:00 2001 From: Songyi Huang Date: Wed, 12 Feb 2020 21:13:05 -0800 Subject: [PATCH] changed layout for doudizhu --- src/assets/gameview.scss | 26 ++++++++++-- src/view/DoudizhuGameView.js | 82 +++++++++++++++++++++--------------- 2 files changed, 70 insertions(+), 38 deletions(-) diff --git a/src/assets/gameview.scss b/src/assets/gameview.scss index c9b98f2..89fa983 100644 --- a/src/assets/gameview.scss +++ b/src/assets/gameview.scss @@ -1,8 +1,12 @@ .game-controller { - width: 100%; - padding: 20px; - .el-row { - margin-bottom: 10px; + //width: calc(100% - 20px*2); + //padding: 20px; + //.el-row { + // margin-bottom: 10px; + //} + .game-controller-paper { + margin: 5px; + padding: 2px 10px; } .status-button { @@ -10,6 +14,16 @@ margin-right: 5px; width: 125px; } + + .form-label-left { + float: left; + text-align: right; + font-size: 14px; + line-height: 1; + padding: 11px 12px 11px 0; + box-sizing: border-box; + width: 80px; + } } .doudizhu-view-container { @@ -32,6 +46,10 @@ .probability-player { height: calc(72px - 16px*2); padding: 16px; + + span { + vertical-align: middle; + } } .probability-table { diff --git a/src/view/DoudizhuGameView.js b/src/view/DoudizhuGameView.js index 877d862..415997f 100644 --- a/src/view/DoudizhuGameView.js +++ b/src/view/DoudizhuGameView.js @@ -336,7 +336,14 @@ class DoudizhuGameView extends React.Component { -
Current: 0
+
+ { + this.state.gameInfo.playerInfo.length > 0 ? + Current Player: {this.state.gameInfo.currentPlayer}
Role: {this.state.gameInfo.playerInfo[this.state.gameInfo.currentPlayer].role}
+ : + Waiting... + } +
@@ -353,12 +360,10 @@ class DoudizhuGameView extends React.Component {
- - - {/**/} - - - + + + +
- - - - -
- Game Speed
-
- - {this.changeGameSpeed(newVal)}} - aria-labelledby="discrete-slider-custom" - step={1} - min={-3} - max={3} - track={false} - valueLabelDisplay="off" - marks={gameSpeedMarks} - /> - -
- - - {`Current Player: ${this.state.gameInfo.currentPlayer} , Consideration Time: ${this.state.gameInfo.considerationTime}, Turn: ${this.state.gameInfo.turn}`} - - + + + + + +
{`Turn: ${this.state.gameInfo.turn}`}
+
+ + + + +
+ +
+ {this.changeGameSpeed(newVal)}} + aria-labelledby="discrete-slider-custom" + step={1} + min={-3} + max={3} + track={false} + valueLabelDisplay="off" + marks={gameSpeedMarks} + /> +
+
+
+ + + {/**/} + {/* */} + {/* {`Current Player: ${this.state.gameInfo.currentPlayer} , Consideration Time: ${this.state.gameInfo.considerationTime}, Turn: ${this.state.gameInfo.turn}`}*/} + {/* */} + {/**/}
)