Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8ca162e
improve the player panel ui
abdallahbahrawi1 Sep 6, 2025
b561593
add more validations
abdallahbahrawi1 Sep 7, 2025
4bd58c2
Enhance PlayerPanel
abdallahbahrawi1 Sep 10, 2025
65fdb40
stabilize player panel size and remove the view allies button
abdallahbahrawi1 Sep 12, 2025
9c9f5ce
fix merge conflects
abdallahbahrawi1 Sep 12, 2025
0aa3896
improve palyer panel action buttons
abdallahbahrawi1 Sep 14, 2025
b571dba
Improve styling and create reusable components for player panel
abdallahbahrawi1 Sep 15, 2025
0fe923a
add a comment
abdallahbahrawi1 Sep 15, 2025
a6969c4
fixes stuff
abdallahbahrawi1 Sep 17, 2025
a5e0ae8
enhance PlayerPanel UI and fix bugs
abdallahbahrawi1 Sep 17, 2025
b338b9a
fixes bugs
abdallahbahrawi1 Sep 18, 2025
26d8108
Improve UI text contrast
abdallahbahrawi1 Sep 19, 2025
95cc749
improve the styling
abdallahbahrawi1 Sep 21, 2025
21ddf24
improve styling
abdallahbahrawi1 Sep 21, 2025
0210644
improve players panel
abdallahbahrawi1 Sep 21, 2025
4b53eb1
Improve PlayerPanel readability and UI appearance
abdallahbahrawi1 Sep 25, 2025
6471aae
remove trust label and added better traitor indicator
abdallahbahrawi1 Sep 26, 2025
b35c6d0
add player type tag for nations and bots, show relation pill for nati…
abdallahbahrawi1 Sep 27, 2025
8ff09f9
fixes few bugs
abdallahbahrawi1 Sep 27, 2025
3c24022
make the traitor ring more glowing
abdallahbahrawi1 Sep 27, 2025
ae2d904
Merge branch 'main' into Improve-Player-panel
evanpelle Sep 27, 2025
7620a20
fix bugs
abdallahbahrawi1 Sep 29, 2025
1bb59b8
fix bugs and refactor the code
abdallahbahrawi1 Sep 30, 2025
588cb9b
Merge branch 'main' into Improve-Player-panel
evanpelle Oct 2, 2025
1c2e9d3
fix bugs and upgrade the alliance view
abdallahbahrawi1 Oct 3, 2025
138d66d
remove getIdentityKind function
abdallahbahrawi1 Oct 3, 2025
a6141db
fix bugs
abdallahbahrawi1 Oct 3, 2025
b5efa58
fix flag bug
abdallahbahrawi1 Oct 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added resources/images/StopIconWhite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/TradingIconWhite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions resources/images/TraitorIconLightRed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 24 additions & 5 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,11 @@
"upgrade": "Upgrade",
"level": "Level"
},
"player_type": {
"player": "Player",
"nation": "Nation",
"bot": "Bot"
},
"relation": {
"hostile": "Hostile",
"distrustful": "Distrustful",
Expand All @@ -580,23 +585,37 @@
"player_panel": {
"gold": "Gold",
"troops": "Troops",
"betrayals": "Number of betrayals",
"betrayals": "Betrayals",
"traitor": "Traitor",
"stable": "Stable",
"trust": "Trust",
"trading": "Trading",
"active": "Active",
"stopped": "Stopped",
"alliance_time_remaining": "Alliance Expires In",
"embargo": "Stopped trading with you",
"nuke": "Nukes sent by them to you",
"start_trade": "Start trading",
"stop_trade": "Stop trading",
"start_trade": "Start Trading",
"stop_trade": "Stop Trading",
"yes": "Yes",
"no": "No",
"none": "None",
"alliances": "Alliances",
"flag": "Flag"
"flag": "Flag",
"chat": "Chat",
"target": "Target",
"break": "Break",
"break_alliance": "Break Alliance",
"alliance": "Alliance",
"send_alliance": "Send Alliance",
"send_troops": "Send Troops",
"send_gold": "Send Gold",
"emotes": "Emojis"
},
"replay_panel": {
"replay_speed": "Replay speed",
"game_speed": "Game speed",
"fastest_game_speed": "max"
"fastest_game_speed": "Max"
},
"error_modal": {
"crashed": "Game crashed!",
Expand Down
69 changes: 69 additions & 0 deletions src/client/components/ui/ActionButton.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { html, TemplateResult } from "lit";

export type ButtonVariant =
| "normal"
| "red"
| "green"
| "indigo"
| "yellow"
| "sky";
export interface ActionButtonProps {
onClick: (e: MouseEvent) => void;
type?: ButtonVariant;
icon: string;
iconAlt: string;
title: string;
label: string;
disabled?: boolean;
}

const ICON_SIZE =
"h-5 w-5 shrink-0 transition-transform group-hover:scale-110 text-zinc-400";
const TEXT_SIZE =
"text-base sm:text-[14px] leading-5 font-semibold tracking-tight";

const getButtonStyles = () => {
const btnBase =
"group w-full min-w-[50px] select-none flex flex-col items-center justify-center " +
"gap-1 rounded-lg py-1.5 border border-white/10 bg-white/[0.04] shadow-sm " +
"transition-all duration-150 " +
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20 " +
"active:translate-y-[1px]";

return {
normal: `${btnBase} text-white/90 hover:bg-white/10 hover:text-white`,
red: `${btnBase} text-red-400 hover:bg-red-500/10 hover:text-red-300 focus-visible:ring-red-400/30`,
green: `${btnBase} text-emerald-400 hover:bg-emerald-500/10 hover:text-emerald-300 focus-visible:ring-emerald-400/30`,
yellow: `${btnBase} text-[#f59e0b] hover:bg-[#f59e0b]/10 hover:text-[#fbbf24] focus-visible:ring-[#f59e0b]/30`,
indigo: `${btnBase} text-indigo-400 hover:bg-indigo-500/10 hover:text-indigo-300 focus-visible:ring-indigo-400/30`,
sky: `${btnBase} text-[#38bdf8] hover:bg-[#38bdf8]/10 hover:text-[#0ea5e9] focus-visible:ring-[#38bdf8]/30`,
};
};

export const actionButton = (props: ActionButtonProps): TemplateResult => {
const {
onClick,
type = "normal",
icon,
iconAlt,
title,
label,
disabled = false,
} = props;
const buttonStyles = getButtonStyles();
const buttonClass = buttonStyles[type];

return html`
<button
@click=${onClick}
class="${buttonClass}"
title="${title}"
type="button"
aria-label="${title}"
?disabled=${disabled}
>
<img src=${icon} alt=${iconAlt} aria-hidden="true" class="${ICON_SIZE}" />
<span class="${TEXT_SIZE}">${label}</span>
</button>
`;
};
33 changes: 33 additions & 0 deletions src/client/components/ui/Divider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.js";

export type DividerSpacing = "sm" | "md" | "lg";
@customElement("ui-divider")
export class Divider extends LitElement {
@property({ type: String })
spacing: DividerSpacing = "md";

@property({ type: String })
color: string = "bg-zinc-700/80";

createRenderRoot() {
return this;
}

render() {
const spacingClasses: Record<DividerSpacing, string> = {
sm: "my-0.5",
md: "my-1",
lg: "my-2",
} as const;
const spacing = spacingClasses[this.spacing] ?? spacingClasses.md;

const colorClass = this.color || "bg-zinc-700/80";

return html`<div
role="separator"
aria-hidden="true"
class="${spacing} h-px ${colorClass}"
></div>`;
}
}
6 changes: 3 additions & 3 deletions src/client/graphics/layers/PlayerInfoOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,13 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
let playerType = "";
switch (player.type()) {
case PlayerType.Bot:
playerType = translateText("player_info_overlay.bot");
playerType = translateText("player_type.bot");
break;
case PlayerType.FakeHuman:
playerType = translateText("player_info_overlay.nation");
playerType = translateText("player_type.nation");
break;
case PlayerType.Human:
playerType = translateText("player_info_overlay.player");
playerType = translateText("player_type.player");
break;
}

Expand Down
Loading
Loading