Skip to content

Commit

Permalink
Обновление очков
Browse files Browse the repository at this point in the history
  • Loading branch information
Штенгауэр Никита Дмитриевич committed Oct 29, 2023
1 parent 7ab270e commit 72804df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion MyOwnGame.Frontend/pages/lobby/lobby.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ function getCachedPlayer(player){
function updatePlayers() {
requestUpdateSession().then(() => {
session.players.forEach(player => {
let profilePane = document.querySelector(`#player-${player.id}`);
const imageUrl = `${address}/avatars/${player.avatarImage}`;
if(profilePane){
profilePane.querySelector(".player-image").style.backgroundImage = `url('${imageUrl}')`;
profilePane.querySelector(".player-name").innerHTML = player.name;
profilePane.querySelector(".player-score").innerHTML = player.score;
}

if(session.respondingPlayer &&
player.id == session.respondingPlayer.id)
setPlayerStatus(player.id, "отвечает", "rgba(240, 240, 100, 1)", "rgba(120, 120, 0, 1)");
Expand Down Expand Up @@ -276,7 +284,7 @@ function showContent(content, callback) {
if(content.type == 1){
textQuestion.querySelector(`#text-content`).textContent = content.text;
setTimeout(() => callback(), content.text.length * 200);
setAnswerText(null);

}
if(content.type == 2){
audio = new Audio(`${address}/content/${session.id}/${content.url}`);
Expand Down

0 comments on commit 72804df

Please sign in to comment.