+
+
+ ${this.renderSmallActionCard(
+ translateText("main.solo"),
+ this.openSinglePlayerModal,
+ "bg-sky-600",
+ )}
+
+
+
+ ${this.renderSmallActionCard(
+ translateText("main.create"),
+ this.openHostLobby,
+ "bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)]",
+ )}
+ ${this.renderSmallActionCard(
+ translateText("mode_selector.ranked_title"),
+ this.openRankedMenu,
+ "bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)]",
+ )}
+ ${this.renderSmallActionCard(
+ translateText("main.join"),
+ this.openJoinLobby,
+ "bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)]",
+ )}
+
- ${ffa
- ? html`
- ${this.renderLobbyCard(ffa, this.getLobbyTitle(ffa))}
+
+ ${special
+ ? html`
+ ${this.renderSpecialLobbyCard(special)}
`
- : nothing}
- ${teams
- ? this.renderLobbyCard(teams, this.getLobbyTitle(teams))
- : nothing}
- ${special ? this.renderSpecialLobbyCard(special) : nothing}
-
- ${this.renderQuickActionsSection()}
-
- `;
- }
+ : ffa
+ ? html`
+ ${this.renderLobbyCard(ffa, this.getLobbyTitle(ffa))}
+
`
+ : nothing}
- private renderSpecialLobbyCard(lobby: PublicGameInfo) {
- const subtitle = this.getLobbyTitle(lobby);
- const mainTitle = translateText("mode_selector.special_title");
- const titleContent = subtitle
- ? html`
-
${mainTitle}
-
- ${subtitle}
-
- `
- : mainTitle;
- return this.renderLobbyCard(lobby, titleContent);
- }
+
+
+ ${special && ffa
+ ? html`
+ ${this.renderLobbyCard(ffa, this.getLobbyTitle(ffa))}
+
`
+ : nothing}
+ ${teams
+ ? html`
+ ${this.renderLobbyCard(teams, this.getLobbyTitle(teams))}
+
`
+ : nothing}
+
- private renderSoloButton() {
- const title = translateText("main.solo");
- return html`
-
- `;
- }
+
+
+ ${special ? this.renderSpecialLobbyCard(special) : nothing}
+
+
+ ${ffa
+ ? this.renderLobbyCard(ffa, this.getLobbyTitle(ffa))
+ : nothing}
+
+
+ ${teams
+ ? this.renderLobbyCard(teams, this.getLobbyTitle(teams))
+ : nothing}
+
+
-
${this.renderSoloButton()}
-
+
+
${this.renderSmallActionCard(
- translateText("mode_selector.ranked_title"),
- this.openRankedMenu,
+ translateText("main.solo"),
+ this.openSinglePlayerModal,
+ "bg-sky-600",
)}
+
+
+
${this.renderSmallActionCard(
translateText("main.create"),
this.openHostLobby,
+ "bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)]",
+ )}
+ ${this.renderSmallActionCard(
+ translateText("mode_selector.ranked_title"),
+ this.openRankedMenu,
+ "bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)]",
)}
${this.renderSmallActionCard(
translateText("main.join"),
this.openJoinLobby,
+ "bg-[color-mix(in_oklab,var(--frenchBlue)_75%,black)]",
)}
`;
}
+ private renderSpecialLobbyCard(lobby: PublicGameInfo) {
+ return this.renderLobbyCard(lobby, this.getLobbyTitle(lobby));
+ }
+
private openRankedMenu = () => {
if (!this.validateUsername()) return;
window.showPage?.("page-ranked");
@@ -181,11 +247,15 @@ export class GameModeSelector extends LitElement {
(document.querySelector("join-lobby-modal") as JoinLobbyModal)?.open();
};
- private renderSmallActionCard(title: string, onClick: () => void) {
+ private renderSmallActionCard(
+ title: string,
+ onClick: () => void,
+ bgClass: string = CARD_BG,
+ ) {
return html`
@@ -198,6 +268,11 @@ export class GameModeSelector extends LitElement {
) {
const mapType = lobby.gameConfig!.gameMap as GameMapType;
const mapImageSrc = terrainMapFileLoader.getMapData(mapType).webpPath;
+ const aspectRatio = this.mapAspectRatios.get(mapType);
+ // Use object-contain for extreme aspect ratios (e.g. Amazon River ~20:1) so
+ // the full map is visible instead of being cropped by object-cover.
+ const useContain =
+ aspectRatio !== undefined && (aspectRatio > 4 || aspectRatio < 0.25);
const timeRemaining = lobby.startsAt
? Math.max(
0,
@@ -208,12 +283,14 @@ export class GameModeSelector extends LitElement {
: undefined;
let timeDisplay: string = "";
+ let timeDisplayUppercase = false;
if (timeRemaining === undefined) {
- timeDisplay = "-s";
+ timeDisplay = renderDuration(this.defaultLobbyTime);
} else if (timeRemaining > 0) {
timeDisplay = renderDuration(timeRemaining);
} else {
timeDisplay = translateText("public_lobby.starting_game");
+ timeDisplayUppercase = true;
}
const mapName = getMapName(lobby.gameConfig?.gameMap);
@@ -229,59 +306,78 @@ export class GameModeSelector extends LitElement {
return html`