feat: continuous pulse glow when lobby is full, add horizontal offset for player list

Make the header meter pulse animation loop indefinitely (1.2s
ease-in-out) while playerCount equals maxPlayers. Stops when a
player leaves. Also add horizontal offset control for the player
list positioning.

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-20 15:15:09 -04:00
parent 4c56b7f8f9
commit 06e375ccdc
3 changed files with 14 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ const DEFAULT_MAX_PLAYERS = 8;
* @property {HTMLInputElement} textColor
* @property {HTMLInputElement} emptyColor
* @property {HTMLInputElement} offset
* @property {HTMLInputElement} offsetX
*/
/**
@@ -214,9 +215,18 @@ export class PlayerList {
const textColor = inputs.textColor.value;
const emptyColor = inputs.emptyColor.value;
const offsetY = `${parseInt(inputs.offset.value, 10) || 0}px`;
const offsetX = parseInt(inputs.offsetX?.value, 10) || 0;
container.style.transform = `translateY(calc(-50% + ${offsetY}))`;
if (pos === 'right') {
container.style.right = `${24 + offsetX}px`;
container.style.left = '';
} else {
container.style.left = `${24 + offsetX}px`;
container.style.right = '';
}
for (const slot of this._slots) {
slot.nameEl.style.fontSize = fontPx;
slot.element.querySelector('.player-slot-number').style.fontSize = fontPx;