projects
/
xogo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
86f3c2c
)
Fix Dark variant (opacity --> in-shadow)
author
Benjamin Auder
<benjamin.auder@somewhere>
Sat, 13 Nov 2021 12:43:23 +0000
(13:43 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Sat, 13 Nov 2021 12:43:23 +0000
(13:43 +0100)
base_rules.js
patch
|
blob
|
blame
|
history
diff --git
a/base_rules.js
b/base_rules.js
index
68ca909
..
ff698f4
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-482,7
+482,7
@@
export default class ChessRules {
for (let y=0; y<this.size.y; y++) {
if (this.enlightened[x][y] && !newEnlightened[x][y]) {
let elt = document.getElementById(this.coordsToId([x, y]));
for (let y=0; y<this.size.y; y++) {
if (this.enlightened[x][y] && !newEnlightened[x][y]) {
let elt = document.getElementById(this.coordsToId([x, y]));
- elt.
style.fillOpacity = "0.5"
;
+ elt.
classList.add("in-shadow")
;
if (this.g_pieces[x][y]) {
this.g_pieces[x][y].remove();
this.g_pieces[x][y] = null;
if (this.g_pieces[x][y]) {
this.g_pieces[x][y].remove();
this.g_pieces[x][y] = null;
@@
-490,7
+490,7
@@
export default class ChessRules {
}
else if (!this.enlightened[x][y] && newEnlightened[x][y]) {
let elt = document.getElementById(this.coordsToId([x, y]));
}
else if (!this.enlightened[x][y] && newEnlightened[x][y]) {
let elt = document.getElementById(this.coordsToId([x, y]));
- elt.
style.fillOpacity = "1"
;
+ elt.
classList.remove("in-shadow")
;
if (this.board[x][y] != "") {
const piece = this.getPiece(x, y);
const color = this.getColor(x, y);
if (this.board[x][y] != "") {
const piece = this.getPiece(x, y);
const color = this.getColor(x, y);
@@
-627,7
+627,6
@@
export default class ChessRules {
for (let j=0; j < sizeY; j++) {
const ii = (flipped ? this.size.x - 1 - i : i);
const jj = (flipped ? this.size.y - 1 - j : j);
for (let j=0; j < sizeY; j++) {
const ii = (flipped ? this.size.x - 1 - i : i);
const jj = (flipped ? this.size.y - 1 - j : j);
- let fillOpacity = '1';
let classes = this.getSquareColorClass(ii, jj);
if (this.enlightened && !this.enlightened[ii][jj])
classes += " in-shadow";
let classes = this.getSquareColorClass(ii, jj);
if (this.enlightened && !this.enlightened[ii][jj])
classes += " in-shadow";