commit e58c05b1aec3bb3061d39b46b2aa6a37b1069740
parent 8a4af6d5ebd7a89d5418eacfd9b549704e8656d2
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Thu, 15 Jun 2023 01:08:42 -0700
reduce bandwidth
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pkg/web/handlers/chess.go b/pkg/web/handlers/chess.go
@@ -780,9 +780,11 @@ func renderShowVisiblePieceInPosition(styles *StylesBuilder, visiblePieces map[c
}
func renderHideAllPieces(styles *StylesBuilder) {
+ ids := make([]string, 64)
for i := 0; i < 64; i++ {
- styles.Appendf(`#piece_%s { display: none !important; }`, chess.Square(i).String())
+ ids[i] = "#piece_" + chess.Square(i).String()
}
+ styles.Appendf(`%s { display: none !important; }`, strings.Join(ids, ", "))
}
func renderBestMove(styles *StylesBuilder, bestMove *chess.Move) {