commit 3eea228802324c0de7213a8355fa18a129c3f58c
parent 4d96365c845ab01b2400831d6594219f6108ef07
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Wed, 14 Jun 2023 16:37:43 -0700
highlight current position
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pkg/web/handlers/interceptors/chess.go b/pkg/web/handlers/interceptors/chess.go
@@ -450,7 +450,7 @@ func (g *ChessGame) drawPlayerCard(moveIdx int, key string, isBlack, isSpectator
{{ range $idx, $el := .Stats.Scores }}
<td title="{{ $idx | fmtMove }} {{ $el.Move }} | Advantage: {{ if not $el.Mate }}{{ $el.CP | cp }}{{ else }}#{{ $el.Mate }}{{ end }}">
{{ $el.BestMove | commentHTML }}
- <a class="column-wrapper-wrapper" href="/chess/{{ $.Key }}?m={{ $idx | plus }}">
+ <a class="column-wrapper-wrapper" href="/chess/{{ $.Key }}?m={{ $idx | plus }}" style="display: block;{{ if eq $.MoveIdx ($idx | plus) }} background-color: rgba(255, 255, 0, 0.2);{{ end }}">
<div class="column-wrapper">
{{ if ge .CP 0 }}
<div class="column" style="height: {{ $el | renderCP "white" }}px; background-color: #eee; bottom: 0;"></div>
@@ -522,6 +522,7 @@ func (g *ChessGame) drawPlayerCard(moveIdx int, key string, isBlack, isSpectator
"Stats": stats,
"ColumnWidth": columnWidth,
"IsAdmin": isAdmin,
+ "MoveIdx": moveIdx,
}
fns := template.FuncMap{