diff --git a/server/index.js b/server/index.js index 2edf4b0..3ce7d60 100644 --- a/server/index.js +++ b/server/index.js @@ -32,7 +32,7 @@ function getGameHistory(){ console.log(testDoudizhuData); }); - fs.readFile("./sample_data/sample_leduc_holdem-test.json", (err, data) => { + fs.readFile("./sample_data/sample_leduc_holdem.json", (err, data) => { if (err) throw err; testLeducHoldemData = JSON.parse(data); console.log(testLeducHoldemData); diff --git a/server/sample_data/sample_doudizhu.json b/server/sample_data/sample_doudizhu.json index cfa93f1..f5a1e86 100644 --- a/server/sample_data/sample_doudizhu.json +++ b/server/sample_data/sample_doudizhu.json @@ -269,11 +269,11 @@ "probability": 0.5 }, { - "move": "S7 H7", + "move": "CT DT", "probability": 0.1 }, { - "move": "HA CA", + "move": "RJ BJ", "probability": 0.05 } ] diff --git a/src/assets/doudizhu.scss b/src/assets/doudizhu.scss index c849213..1e01a4c 100644 --- a/src/assets/doudizhu.scss +++ b/src/assets/doudizhu.scss @@ -168,11 +168,15 @@ .played-card-area { width: 100%; position: relative; - transform: translateY(25px); + //transform: translateY(25px); + + .playingCards ul.hand { + margin-bottom: 0; + } .non-card { height: 138px; - transform: translateY(-25px); + //transform: translateY(-25px); } } } diff --git a/src/assets/gameview.scss b/src/assets/gameview.scss index 4f5738a..c9b98f2 100644 --- a/src/assets/gameview.scss +++ b/src/assets/gameview.scss @@ -1,9 +1,15 @@ .game-controller { - width: 500px; + width: 100%; padding: 20px; .el-row { margin-bottom: 10px; } + + .status-button { + margin-left: 5px; + margin-right: 5px; + width: 125px; + } } .doudizhu-view-container { @@ -82,7 +88,7 @@ } .non-card.hide { visibility: hidden; - transition: visibility 0.1s, opacity 0.05s; + transition: visibility 0.2s, opacity 0.15s; opacity: 0; pointer-events:none; } diff --git a/src/components/GameBoard/DoudizhuGameBoard.js b/src/components/GameBoard/DoudizhuGameBoard.js index d231416..09cfc8c 100644 --- a/src/components/GameBoard/DoudizhuGameBoard.js +++ b/src/components/GameBoard/DoudizhuGameBoard.js @@ -2,6 +2,7 @@ import React from 'react'; import { translateCardData, millisecond2Second, computeHandCardsWidth } from '../../utils' import '../../assets/doudizhu.scss'; +import {fade} from "@material-ui/core"; class DoudizhuGameBoard extends React.Component { constructor(props) { @@ -97,7 +98,7 @@ class DoudizhuGameBoard extends React.Component { } componentDidUpdate(prevProps, prevState, snapshot) { - if(prevProps.turn !== this.props.turn && this.props.turn !== 0){ + if(prevProps.turn !== this.props.turn && this.props.turn !== 0 && this.props.gameStatus === "playing"){ // new turn starts this.props.runNewTurn(prevProps); } diff --git a/src/components/GameBoard/LeducHoldemGameBoard.js b/src/components/GameBoard/LeducHoldemGameBoard.js index a4ad2e4..097946e 100644 --- a/src/components/GameBoard/LeducHoldemGameBoard.js +++ b/src/components/GameBoard/LeducHoldemGameBoard.js @@ -11,7 +11,7 @@ class LeducHoldemGameBoard extends React.Component { computeHand(card) { const [rankClass, suitClass, rankText, suitText] = translateCardData(card); return ( -