From 4a79cc1a384a93398bd134b840019e646d26adf6 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Mon, 16 Mar 2026 21:27:55 -0600 Subject: [PATCH] style upload --- .../live/battle_components.ex | 49 ++++++------------- lib/cobblemon_ui_web/live/dashboard_live.ex | 1 - .../live/pokemon_components.ex | 28 ++++++----- 3 files changed, 31 insertions(+), 47 deletions(-) diff --git a/lib/cobblemon_ui_web/live/battle_components.ex b/lib/cobblemon_ui_web/live/battle_components.ex index 0866493..f54838b 100644 --- a/lib/cobblemon_ui_web/live/battle_components.ex +++ b/lib/cobblemon_ui_web/live/battle_components.ex @@ -9,33 +9,19 @@ defmodule CobblemonUiWeb.BattleComponents do def battle_panel(assigns) do ~H""" -
- <%!-- Header --%> -
- - Active Battle -
- +
<%!-- Actors --%>
<%= for {actor, idx} <- Enum.with_index(@battle.actors) do %> - <%!-- Divider between actors on mobile, VS bar on desktop --%> -
<%!-- Actor header --%> -
+
<%= if actor.type == "player" do %> <.icon name="hero-user" class="size-4 text-primary" /> @@ -52,10 +38,7 @@ defmodule CobblemonUiWeb.BattleComponents do {actor.type}

- <%!-- VS badge for desktop --%> - +
<%!-- Pokemon cards --%> @@ -63,27 +46,27 @@ defmodule CobblemonUiWeb.BattleComponents do <%= for poke <- actor.active_pokemon do %> <% tier = Map.get(@tier_list, String.downcase(poke.species || ""), nil) %> <% hp_pct = if poke.max_hp > 0, do: Float.round(poke.hp / poke.max_hp * 100, 1), else: 0.0 %> -
- <%!-- Sprite --%> -
+
+ <%!-- Sprite with tier badge pinned to corner --%> +
{poke.species} +
+ <.tier_badge :if={tier} tier={tier} species={poke.species} compact={true} /> +
<%!-- Info --%>
<%!-- Name row --%> -
+
{poke.species} - - Lv.{poke.level} - - <.tier_badge :if={tier} tier={tier} species={poke.species} compact={true} /> + Lv.{poke.level}
<%!-- HP bar --%> -
+
HP - {poke.hp} / {poke.max_hp} + {poke.hp}/{poke.max_hp} ({hp_pct}%)
diff --git a/lib/cobblemon_ui_web/live/dashboard_live.ex b/lib/cobblemon_ui_web/live/dashboard_live.ex index 9271fb8..d85e6c3 100644 --- a/lib/cobblemon_ui_web/live/dashboard_live.ex +++ b/lib/cobblemon_ui_web/live/dashboard_live.ex @@ -185,7 +185,6 @@ defmodule CobblemonUiWeb.DashboardLive do

{player_name(@players, @selected_player)}

-

Player Data Explorer

diff --git a/lib/cobblemon_ui_web/live/pokemon_components.ex b/lib/cobblemon_ui_web/live/pokemon_components.ex index 9490c9e..b0f2ecc 100644 --- a/lib/cobblemon_ui_web/live/pokemon_components.ex +++ b/lib/cobblemon_ui_web/live/pokemon_components.ex @@ -50,12 +50,13 @@ defmodule CobblemonUiWeb.PokemonComponents do :if={!@tier} title="Tier data not downloaded" class={[ - "inline-flex items-center justify-center font-black rounded leading-none shrink-0", - "bg-base-300/20 text-base-content/25 ring-1 ring-base-300/30", - if(@compact, do: "text-[11px] w-6 h-6", else: "text-sm w-7 h-7") + "inline-flex flex-col items-center justify-center rounded leading-none shrink-0", + "bg-base-300/20 text-base-content/25", + if(@compact, do: "w-7 h-8 px-1", else: "w-8 h-9 px-1.5") ]} > - ? + ? + tier
<.icon @@ -100,19 +101,20 @@ defmodule CobblemonUiWeb.PokemonComponents do target="_blank" rel="noopener noreferrer" class={[ - "inline-flex items-center justify-center font-black rounded leading-none shrink-0 hover:scale-110 transition-transform", - if(@compact, do: "text-[11px] w-6 h-6", else: "text-sm w-7 h-7"), + "inline-flex flex-col items-center justify-center rounded leading-none shrink-0 hover:scale-110 transition-transform", + if(@compact, do: "w-7 h-8 px-1", else: "w-8 h-9 px-1.5"), case @tier do - "S" -> "bg-red-500/20 text-red-400 ring-1 ring-red-500/30 hover:bg-red-500/30" - "A" -> "bg-orange-500/20 text-orange-400 ring-1 ring-orange-500/30 hover:bg-orange-500/30" - "B" -> "bg-yellow-500/20 text-yellow-400 ring-1 ring-yellow-500/30 hover:bg-yellow-500/30" - "C" -> "bg-green-500/20 text-green-400 ring-1 ring-green-500/30 hover:bg-green-500/30" - "D" -> "bg-blue-500/20 text-blue-400 ring-1 ring-blue-500/30 hover:bg-blue-500/30" - _ -> "bg-base-300/30 text-base-content/40 ring-1 ring-base-300/40" + "S" -> "bg-red-500/20 text-red-400 hover:bg-red-500/30" + "A" -> "bg-orange-500/20 text-orange-400 hover:bg-orange-500/30" + "B" -> "bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/30" + "C" -> "bg-green-500/20 text-green-400 hover:bg-green-500/30" + "D" -> "bg-blue-500/20 text-blue-400 hover:bg-blue-500/30" + _ -> "bg-base-300/30 text-base-content/40" end ]} > - {@tier} + {@tier} + tier """ end