Copy FEN to clipboard from the endgame view (#33)

* display fen string under engame data and add hook to copy to clipboard

* split seed data across files
This commit is contained in:
2026-11-03 12:00:35 +01:00
committed by GitHub
parent a5bb1cb670
commit dd060531d3
6 changed files with 104 additions and 26 deletions
@@ -13,6 +13,18 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
<:subtitle>
{@endgame.color |> Atom.to_string() |> String.capitalize()} to move · Rating: {@endgame.rating} · Attempts: {@endgame.times_attempted ||
0} · Solved: {@endgame.times_solved || 0}
<p class="text-xs text-gray-500 flex items-center mt-1">
<span>FEN: {@endgame.fen}</span>
<button
id="copy-fen-btn"
phx-hook="CopyFen"
data-fen={@endgame.fen}
class="inline-flex items-center cursor-pointer"
title="Copy FEN to clipboard"
>
<.icon name="hero-document-duplicate" class="w-3.5 h-3.5" />
</button>
</p>
</:subtitle>
<:actions>
<.button navigate={~p"/endgames"}>