From: Benjamin Auder Date: Fri, 12 Nov 2021 11:04:44 +0000 (+0100) Subject: Small style improve (options, Dark) X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/css/user/doc/pieces/%7B%7B%20pkg.url%20%7D%7D?a=commitdiff_plain;h=c7bf7b1b10a6d5059f75f540787aba3daaa435f7;p=xogo.git Small style improve (options, Dark) --- diff --git a/app.js b/app.js index c553ce5..21d205c 100644 --- a/app.js +++ b/app.js @@ -110,7 +110,7 @@ function prepareOptions(Rules) { if (check.defaut) optHtml += 'checked="true"'; optHtml += '/>'; } - if (Rules.Options.styles.length >= 1) optHtml += "

"; + if (Rules.Options.styles.length >= 1) optHtml += '

'; for (let style of Rules.Options.styles) { optHtml += ` diff --git a/base_rules.js b/base_rules.js index eb01442..68ca909 100644 --- a/base_rules.js +++ b/base_rules.js @@ -628,12 +628,12 @@ export default class ChessRules { const ii = (flipped ? this.size.x - 1 - i : i); const jj = (flipped ? this.size.y - 1 - j : j); let fillOpacity = '1'; - if (this.options["dark"] && !this.enlightened[ii][jj]) - fillOpacity = '0.5'; + let classes = this.getSquareColorClass(ii, jj); + if (this.enlightened && !this.enlightened[ii][jj]) + classes += " in-shadow"; // NOTE: x / y reversed because coordinates system is reversed. - // TODO: CSS "wood" style, rect --> style --> background-image ? - board += `