commit 8e6289c683277f00211b3715d8ceffacf41097b4
parent 2a0f5cce92a4c71c4b9ade8ba5e2bc907021a826
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Wed, 14 Jun 2023 12:49:04 -0700
cleanup
Diffstat:
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/pkg/web/handlers/interceptors/chess.go b/pkg/web/handlers/interceptors/chess.go
@@ -337,21 +337,21 @@ func (g *ChessGame) drawPlayerCard(key string, isBlack, isSpectator, isYourTurn,
border: 3px solid #000;
background-color: #666;
}
-.graph .first-row { height: 120px; }
-.graph .second-row { height: 120px; }
+.graph tr { height: 240px; }
.graph td {
+ height: inherit;
border-right: 0px solid #555;
}
.graph td:hover {
background-color: #5c5c5c;
}
-.graph .first-row td {
- vertical-align: bottom;
-}
-.graph .second-row td {
- vertical-align: top;
+.graph .column-wrapper {
+ height: 50%;
+ width: {{ .ColumnWidth }}px;
+ position: relative;
}
.graph .column {
+ position: absolute;
width: {{ .ColumnWidth }}px;
box-sizing: border-box;
border-right: 1px solid #555;
@@ -426,21 +426,19 @@ func (g *ChessGame) drawPlayerCard(key string, isBlack, isSpectator, isYourTurn,
<div style="color: #eee;">Black accuracy: <span id="black-accuracy">{{ .BlackAccuracy | pct }}</span></div>
{{ end }}
<table class="graph">
- <tr class="first-row">
+ <tr>
{{ range $idx, $el := .Stats.Scores }}
<td title="{{ $idx | fmtMove }} {{ $el.Move }} | Advantage: {{ if not $el.Mate }}{{ $el.CP | cp }}{{ else }}#{{ $el.Mate }}{{ end }}">
- {{ if ge .CP 0 }}
- <div class="column" style="height: {{ $el | renderCP "white" }}px; background-color: #eee;"></div>
- {{ end }}
- </td>
- {{ end }}
- </tr>
- <tr class="second-row">
- {{ range $idx, $el := .Stats.Scores }}
- <td title="{{ $idx | fmtMove }} {{ $el.Move }} | Advantage: {{ if not $el.Mate }}{{ $el.CP | cp }}{{ else }}#{{ $el.Mate }}{{ end }}">
- {{ if le .CP 0 }}
- <div class="column" style="height: {{ $el | renderCP "black" }}px; background-color: #111;"></div>
- {{ end }}
+ <div class="column-wrapper">
+ {{ if ge .CP 0 }}
+ <div class="column" style="height: {{ $el | renderCP "white" }}px; background-color: #eee; bottom: 0;"></div>
+ {{ end }}
+ </div>
+ <div class="column-wrapper">
+ {{ if le .CP 0 }}
+ <div class="column" style="height: {{ $el | renderCP "black" }}px; background-color: #111;"></div>
+ {{ end }}
+ </div>
</td>
{{ end }}
</tr>