From: Benjamin Auder Date: Tue, 2 Jan 2024 15:03:28 +0000 (+0100) Subject: Fix Dice display X-Git-Url: https://git.auder.net/doc/html/%7B%7B%20asset%28%27mixstore/css/current/gitweb.css?a=commitdiff_plain;h=03883a0d1495bc6e6fadc3a11aa99286aba5c9e1;p=xogo.git Fix Dice display --- diff --git a/variants/Dice/class.js b/variants/Dice/class.js index 1bb6f1f..53836eb 100644 --- a/variants/Dice/class.js +++ b/variants/Dice/class.js @@ -61,29 +61,21 @@ export default class DiceRules extends ChessRules { }; } - static get PieceToUnicode() { - return { - 'K': "♔", - 'Q': "♕", - 'R': "♖", - 'B': "♗", - 'N': "♘", - 'P': "♙", - 'k': "♚", - 'q': "♛", - 'r': "♜", - 'b': "♝", - 'n': "♞", - 'p': "♟" - }; - } - displayMessage(piece, color) { - if (color == 'w') - piece = piece.toUpperCase(); + if (color == 'b') { + const blackPieceToCode = { + 'k': 'l', + 'p': 'o', + 'n': 'm', + 'b': 'v', + 'q': 'w', + 'r': 't' + }; + piece = blackPieceToCode[piece]; + } super.displayMessage(this.message, 'to play: ' + - '' + V.PieceToUnicode[piece] + '' + '' + piece + '' ); } diff --git a/variants/Dice/style.css b/variants/Dice/style.css index c9ed898..ad11010 100644 --- a/variants/Dice/style.css +++ b/variants/Dice/style.css @@ -1,10 +1,9 @@ @import url("/base_pieces.css"); -/* doesn't work: @font-face { font-family: chess-font; - src: url(/assets/FreeSerifBold-rdMp.otf); -} */ + src: url(/assets/MERIFONT.TTF); +} div.piece-text { position: relative; @@ -17,7 +16,9 @@ div.piece-text { font-size: 1.7em; } -/* div.piece-text > span.symb { font-family: chess-font; -} */ + display: inline-block; + position: relative; + top: 5px; +}