change header size and rating placement

This commit is contained in:
2026-11-06 22:03:24 +01:00
parent f2d886d602
commit 46bc27f614
+17 -15
View File
@@ -10,13 +10,15 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
def render(assigns) do def render(assigns) do
~H""" ~H"""
<Layouts.app flash={@flash}> <Layouts.app flash={@flash}>
<.header> <header class="flex flex-wrap items-start justify-between gap-4 pb-4">
Play endgame {@endgame.key} <div>
<:subtitle> <h1 class="settings-header">Play endgame {@endgame.key}</h1>
{@endgame.color |> Atom.to_string() |> String.capitalize()} to move · Rating: {round( <p class="settings-subtitle mt-4">
@endgame.rating {@endgame.color |> Atom.to_string() |> String.capitalize()} to move · Rating: {round(
)} · Attempts: {@endgame.times_attempted || @endgame.rating
0} · Solved: {@endgame.times_solved || 0} )} · Attempts: {@endgame.times_attempted ||
0} · Solved: {@endgame.times_solved || 0}
</p>
<p class="text-xs text-muted flex items-center mt-1"> <p class="text-xs text-muted flex items-center mt-1">
<span>FEN: {@endgame.fen}</span> <span>FEN: {@endgame.fen}</span>
<button <button
@@ -29,20 +31,16 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
<.icon name="hero-document-duplicate" class="w-3.5 h-3.5" /> <.icon name="hero-document-duplicate" class="w-3.5 h-3.5" />
</button> </button>
</p> </p>
</:subtitle> </div>
<:actions> <div class="flex flex-none gap-2">
<.button :if={Scope.premium?(@current_scope)} navigate={~p"/endgames"}> <.button :if={Scope.premium?(@current_scope)} navigate={~p"/endgames"}>
<.icon name="hero-arrow-left" /> Back to endgames <.icon name="hero-arrow-left" /> Back to endgames
</.button> </.button>
<.button :if={!Scope.premium?(@current_scope)} navigate={~p"/"}> <.button :if={!Scope.premium?(@current_scope)} navigate={~p"/"}>
<.icon name="hero-arrow-left" /> Back home <.icon name="hero-arrow-left" /> Back home
</.button> </.button>
</:actions> </div>
</.header> </header>
<div :if={@user_rating} class="mb-4">
<.rating_guide rating={@user_rating} deviation={@user_deviation} />
</div>
<PlayComponents.play_surface <PlayComponents.play_surface
endgame={@endgame} endgame={@endgame}
@@ -59,6 +57,10 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
last_grade={@last_grade} last_grade={@last_grade}
awaiting_best_line={@awaiting_best_line} awaiting_best_line={@awaiting_best_line}
/> />
<div :if={@user_rating} class="mb-4">
<.rating_guide rating={@user_rating} deviation={@user_deviation} />
</div>
</Layouts.app> </Layouts.app>
""" """
end end