Skip to content

Commit

Permalink
Merge pull request #1 from linus2code/master
Browse files Browse the repository at this point in the history
use lineBurn animation colabration with backend change
  • Loading branch information
norkator committed Oct 3, 2023
2 parents 7b5ef8a + c4aaef8 commit 2bc658b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions web-client/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@
}
}

@keyframes lineBurn {
from { width: 100% }
to { width: 0% }
}


.soundsBtn {
width: 32px;
Expand Down
12 changes: 10 additions & 2 deletions web-client/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,16 @@ Seat.prototype.setMoney = function (money) {
this.seatMoney.innerHTML = Number(money).currencyFormat(2, '.', ',') + '$';
};

Seat.prototype.setTimeBar = function (progress) {
this.seatTimeBar.style = 'width:' + progress + '%';
Seat.prototype.setTimeBar = function (time) {
// this.seatTimeBar.style = 'width:' + timeLeft + '%';
if (time > 0) {
this.seatTimeBar.style = 'width: 100%';
this.seatTimeBar.style.visibility = 'visible'
this.seatTimeBar.style.animation = 'lineBurn ' + time/1000 + 's linear forwards';
} else {
this.seatTimeBar.style.visibility = 'hidden';
this.seatTimeBar.style.animation = '';
}
};

Seat.prototype.setBetFrameVisibility = function (bool) {
Expand Down
4 changes: 3 additions & 1 deletion web-client/app/webSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,10 @@ function statusUpdate(sData) {
var pTurn = sData.playersData[i].isPlayerTurn;
var pIsFold = sData.playersData[i].isFold;
var pTimeBar = sData.playersData[i].timeBar;
var pTimeLeft = sData.playersData[i].timeLeft;
var pId = sData.playersData[i].playerId;
players[i].setTimeBar(pTimeBar);

players[i].setTimeBar(pTimeLeft);
if (Number(pId) == Number(CONNECTION_ID) && players[i].tempBet > 0) {
// Do nothing
} else {
Expand Down

0 comments on commit 2bc658b

Please sign in to comment.