diff --git a/src/assets/cards.css b/src/assets/cards.css index b26659e..196b1cf 100644 --- a/src/assets/cards.css +++ b/src/assets/cards.css @@ -73,10 +73,12 @@ .playingCards .card.back { text-indent: -4000px; background-color: #ccc; - background-repeat: 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: -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)); + background-repeat: no-repeat; + background-image: url("./faces/pokerback.png"); /* image is "Pattern 069" from http://www.squidfingers.com/patterns/ */ + background-size: 100% 100%; + 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? :) */ } diff --git a/src/assets/doudizhu.scss b/src/assets/doudizhu.scss index 70d2d59..c045ca9 100644 --- a/src/assets/doudizhu.scss +++ b/src/assets/doudizhu.scss @@ -3,10 +3,10 @@ .doudizhu-wrapper { width: 100%; height: 100%; - background-color: #C3CDFF; - background-image: url("./images/table.png"); + //background-color: #C3CDFF; + background-image: url("./images/gameboard.png"); background-repeat: no-repeat; - background-size: 100% 70%; + background-size: 100% 125%; background-position: bottom; position: relative; diff --git a/src/assets/faces/pokerback.png b/src/assets/faces/pokerback.png new file mode 100644 index 0000000..d2d87a0 Binary files /dev/null and b/src/assets/faces/pokerback.png differ diff --git a/src/assets/gameview.scss b/src/assets/gameview.scss index 593e761..e69d890 100644 --- a/src/assets/gameview.scss +++ b/src/assets/gameview.scss @@ -170,6 +170,7 @@ vertical-align: middle; text-align: center; font-size: 16px; + font-weight: bolder; } } .non-card.hide { @@ -262,6 +263,8 @@ vertical-align: middle; text-align: center; font-size: 16px; + font-weight: bolder; + color: #303133; } } .non-card.hide { diff --git a/src/assets/images/Tokens/Token_1.png b/src/assets/images/Tokens/Token_1.png new file mode 100644 index 0000000..fbfd15e Binary files /dev/null and b/src/assets/images/Tokens/Token_1.png differ diff --git a/src/assets/images/Tokens/Token_10.png b/src/assets/images/Tokens/Token_10.png new file mode 100644 index 0000000..6e0b617 Binary files /dev/null and b/src/assets/images/Tokens/Token_10.png differ diff --git a/src/assets/images/Tokens/Token_100.png b/src/assets/images/Tokens/Token_100.png new file mode 100644 index 0000000..c32c414 Binary files /dev/null and b/src/assets/images/Tokens/Token_100.png differ diff --git a/src/assets/images/Tokens/Token_25.png b/src/assets/images/Tokens/Token_25.png new file mode 100644 index 0000000..068f94c Binary files /dev/null and b/src/assets/images/Tokens/Token_25.png differ diff --git a/src/assets/images/Tokens/Token_5.png b/src/assets/images/Tokens/Token_5.png new file mode 100644 index 0000000..6a22bec Binary files /dev/null and b/src/assets/images/Tokens/Token_5.png differ diff --git a/src/assets/images/gameboard.png b/src/assets/images/gameboard.png new file mode 100644 index 0000000..8522165 Binary files /dev/null and b/src/assets/images/gameboard.png differ diff --git a/src/assets/index.css b/src/assets/index.css index 50e6bfe..bbad0b7 100644 --- a/src/assets/index.css +++ b/src/assets/index.css @@ -1,8 +1,9 @@ +@import url('https://fonts.googleapis.com/css?family=Arvo&display=swap'); + body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; + color: #606266; + font-family: 'Rockwell', 'Arvo', monospace; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } diff --git a/src/assets/leducholdem.scss b/src/assets/leducholdem.scss index 767ff96..f0b8573 100644 --- a/src/assets/leducholdem.scss +++ b/src/assets/leducholdem.scss @@ -2,16 +2,17 @@ .leduc-holdem-wrapper { width: 100%; height: 100%; - background-color: #C3CDFF; - // background-image: url("./images/table.png"); - // background-repeat: no-repeat; - // background-size: 100% 70%; - // background-position: bottom; + //background-color: #C3CDFF; + background-image: url("./images/gameboard.png"); + background-repeat: no-repeat; + background-size: 100% 132%; + background-position: bottom; position: relative; .played-card-area { font-size: 12px; - width: 100%; + width: 40%; + margin-left: 65%; position: relative; display: flex; justify-content: center; @@ -76,18 +77,51 @@ white-space: pre; text-align: center; } + .bet-value { + color: whitesmoke; + position: relative; + text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87); + top: -120px; + left: 120px; + font-weight: bold; + } + .token-container{ + position: relative; + top: -115px; + left: 120px; + width: 120px; + height: 80px; + display: flex; + flex-direction: row; + .pile-placeholder{ + width: 24px; + 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 { + position: relative; + margin-top: -15px; + } + .pile-placeholder > :first-child { margin-top: 0 !important;} + } } .player-main-area { background-color: initial; - width: 380px; + width: 300px; height: 130px; position: relative; .player-hand { position: absolute; top: 15px; - left: 56px; + left: 65px; padding-left: 20px; margin-left: 130px; width: 75px; @@ -107,14 +141,14 @@ #top-player { position: absolute; top: 10px; - left: 50%; + left: 40%; margin-left: -190px; } #bottom-player { position: absolute; bottom: 10px; - left: 50%; + left: 40%; margin-left: -190px; } @@ -131,10 +165,12 @@ display: table-cell; vertical-align: middle; text-align: center; - font-size: 20px; - font-weight: bold; - text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87); - color: #F2F6FC; + span.round-number { + font-size: 20px; + font-weight: bold; + text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87); + color: #F2F6FC; + } } .playingCards { transform: translate(3px, 10px); diff --git a/src/components/GameBoard/LeducHoldemGameBoard.js b/src/components/GameBoard/LeducHoldemGameBoard.js index 262b8c5..ba4fff9 100644 --- a/src/components/GameBoard/LeducHoldemGameBoard.js +++ b/src/components/GameBoard/LeducHoldemGameBoard.js @@ -49,13 +49,45 @@ class LeducHoldemGameBoard extends React.Component { ) } - + computeActionImage(action) { if (action.length > 0) { return } } + computeTokenImage(bet) { + const values = [100, 25, 10, 5, 1]; + let tokens = { + 100: 0, + 25: 0, + 10: 0, + 5: 0, + 1: 0, + } + let i = 0; + while (bet !== 0 && i < values.length) { + if (bet >= values[i]) { + bet -= values[i]; + tokens[values[i]]++; + } else { + i++; + } + } + let child = []; + for (let [key, value] of Object.entries(tokens)) { + if (value !== 0) { + let grandChild = []; + for (let j = 0; j < value; j++) { + grandChild.push(
); + } + let subElement = React.createElement("div", { className: "pile-placeholder", key: key+'_'+value}, grandChild); + child.push(subElement); + } + } + return React.createElement("div", { className: "token-container" }, child); + } + computeHand(card) { const [rankClass, suitClass, rankText, suitText] = translateCardData(card); return ( @@ -125,18 +157,20 @@ class LeducHoldemGameBoard extends React.Component {