added finaly version for player list crash

This commit is contained in:
Kostya
2024-02-08 22:38:34 +03:00
parent 285692ef3f
commit ed9368cf6c
2 changed files with 48 additions and 16 deletions

View File

@@ -228,11 +228,17 @@
.user-bid-crash { .user-bid-crash {
display: flex; display: flex;
justify-content: center; justify-content: center;
font-size: 20px;
align-items: center; align-items: center;
grid-area: bid; grid-area: bid;
} }
.user-bid-crash h2 {
color: #848484;
font-weight: 700;
font-family: 'Montserrat';
font-size: 24px;
}
.user-bid-crash img { .user-bid-crash img {
margin: 5px 0 0 5px; margin: 5px 0 0 5px;
} }
@@ -247,6 +253,43 @@
font-size: 20px; font-size: 20px;
} }
.wingame__win-bid-crash {
color: #28BD49 !important;
}
.ingame-crash {
color: #61647F;
font-family: 'Montserrat';
font-weight: 700;
font-size: 12px;
background: #22252F;
box-shadow: 0px 4px 4px 0px #00000040;
border-radius: 5px;
width: 70px;
height: 24px;
}
.lostgame-crash {
color: #fff;
font-weight: 700;
font-family: 'Montserrat';
background: #EF4847;
box-shadow: 0px 4px 4px 0px #00000040;
border-radius: 5px;
margin-left: -26px;
padding: 4px;
}
.wingame-crash {
box-shadow: 0px 4px 4px 0px #00000040;
font-family: 'Montserrat';
font-weight: 700;
color: #28BD49;
border: 1px solid #28BD49;
border-radius: 5px;
padding: 6px;
}
.ratio { .ratio {
position: relative; position: relative;
left: 50%; left: 50%;

View File

@@ -33,7 +33,7 @@
<h2>{{ textError }}</h2> <h2>{{ textError }}</h2>
</div> </div>
<div class="crash-game-window__btn-start"> <div class="crash-game-window__btn-start">
<button v-if="startGame && crashObject.Status !== 'WaitingForPlayers'" @click="clickClaimDep" class="claim-btn-crash__prize">Забрать {{ getUserPrize.toFixed(2) }} АР</button> <button v-if="startGame && crashObject.Status !== 'WaitingForPlayers'" @click="clickClaimDep" class="claim-btn-crash__prize">Забрать</button>
<button v-if="startGame && crashObject.Status === 'WaitingForPlayers'" class="waiting-btn-crash">Ожидание игроков...</button> <button v-if="startGame && crashObject.Status === 'WaitingForPlayers'" class="waiting-btn-crash">Ожидание игроков...</button>
<button v-if="!startGame" :disabled="offBtn" @click="clickPlayBtn" :class="{ 'animate-start-btn': ErrorClick }">Начать игру</button> <button v-if="!startGame" :disabled="offBtn" @click="clickPlayBtn" :class="{ 'animate-start-btn': ErrorClick }">Начать игру</button>
</div> </div>
@@ -59,11 +59,12 @@
<h2>{{ player.UserName }}</h2> <h2>{{ player.UserName }}</h2>
</div> </div>
<div class="user-bid-crash"> <div class="user-bid-crash">
<h2>{{ player.Bid }}</h2> <h2 v-if="player.WinningMoney >= 1" class="wingame__win-bid-crash">{{ player.WinningMoney.toFixed(2) }}</h2>
<h2 v-else>{{ player.Bid }}</h2>
<img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png"> <img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png">
</div> </div>
<div class="user-game-status-crash"> <div class="user-game-status-crash">
<h2 class="ingame-crash" v-if="crashObject.Status === 'WaitingForPlayers' && player.WinningX <= 0 || crashObject.Status === 'InGame' && player.WinningX <= 0">В&nbsp;игре</h2> <h2 class="ingame-crash" v-if="crashObject.Status === 'WaitingForPlayers' && player.WinningX <= 1 || crashObject.Status === 'InGame' && player.WinningX <= 0">В&nbsp;игре</h2>
<h2 class="lostgame-crash" v-if="crashObject.Status === 'GameEnd' && player.WinningX <= 0">Проиграл</h2> <h2 class="lostgame-crash" v-if="crashObject.Status === 'GameEnd' && player.WinningX <= 0">Проиграл</h2>
<h2 class="wingame-crash" v-if="player.WinningX >= 1">{{ player.WinningX.toFixed(2) }}x</h2> <h2 class="wingame-crash" v-if="player.WinningX >= 1">{{ player.WinningX.toFixed(2) }}x</h2>
</div> </div>
@@ -109,18 +110,6 @@ export default {
offBtn: false offBtn: false
} }
}, },
computed: {
getUserPrize() {
const currentUser = this.crashObject.Players.find(player => player.UserName === GetCookie('SpUserName'));
if (currentUser && currentUser.UserGameState !== 'Win') {
return currentUser.Bid * this.crashObject.CurrentX
}
else {
return 0
}
}
},
setup() { setup() {
return { v$: useVuelidate() } return { v$: useVuelidate() }
}, },