Skip to content

Commit

Permalink
feat(rushroyale): show avatars in video boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeg committed Oct 5, 2024
1 parent a818b1c commit 606c08f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions public/views/mp/rushroyale.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@
}

.player .video {
--width: var(--p-video-width);
width: var(--p-video-width);
}

.player .video video {
background-size: cover;
background-repeat: no-repeat;
}

.badges {
position: absolute;
width: var(--p-video-width);
Expand Down Expand Up @@ -551,8 +557,12 @@
player.__setAvatar = player.setAvatar;
player.setAvatar = function (url) {
if (QueryString.get('avatar') === '0') return;
this.__setAvatar(url);
this.dom.rank_node.style.backgroundImage = `url(${url})`; // TODO Should validate
// TODO Should validate that url is safe for string interpolation
this.dom.video.style.backgroundImage = `url(${url})`;
this.dom.rank_node.style.backgroundImage = `url(${url})`;

// we're not calling the original avatar, because we don't want to show it the avatars in the play field
// this.__setAvatar(url);
};

player.onGameStart = function () {
Expand Down

0 comments on commit 606c08f

Please sign in to comment.