From: Steinar H. Gunderson Date: Thu, 20 Oct 2022 17:55:26 +0000 (+0200) Subject: Better imbalance pieces in dark mode. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=df46572ddfcbd6a247b8f37b0e7a3842b7b402d2 Better imbalance pieces in dark mode. Simply use the pieces of the opposite color and invert them; they are made for a light background. --- diff --git a/www/css/remoteglot.css b/www/css/remoteglot.css index 42bf1b9..672e583 100644 --- a/www/css/remoteglot.css +++ b/www/css/remoteglot.css @@ -203,6 +203,11 @@ a.move:hover { color: #555; } +.imbalance-inverted-piece { + display: none; + filter: invert(1); +} + @media (prefers-color-scheme: dark) { :root { @@ -221,5 +226,9 @@ a.move, a.move:link { a:link { color: rgb(128,128,238); } - +.imbalance-piece { + display: none; +} +.imbalance-inverted-piece { + display: initial; } diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index dc0e630..3a95204 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1751,10 +1751,12 @@ var update_imbalance = function(fen) { var black_imbalance = ''; for (var piece in imbalance) { for (var i = 0; i < imbalance[piece]; ++i) { - white_imbalance += ''; + white_imbalance += ''; + white_imbalance += ''; } for (var i = 0; i < -imbalance[piece]; ++i) { - black_imbalance += ''; + black_imbalance += ''; + black_imbalance += ''; } } $('#whiteimbalance').html(white_imbalance);