-PGN text is not selectable (understand why?!)
-Checkered stage 2: switch button at reserve position (or on top).
+PGN text is not selectable on desktop computer (understand why?!)
Mode expert: game.js, button on top (with online indicator)
-Turn indicator on top too (black or white)
let incheckSq = doubleArray(sizeX, sizeY, false);
this.incheck.forEach(sq => { incheckSq[sq[0]][sq[1]] = true; });
let elementArray = [];
- let square00 = document.getElementById("sq-0-0");
- let squareWidth = !!square00
- ? parseFloat(window.getComputedStyle(square00).width.slice(0,-2))
- : 0;
const playingHuman = (this.mode == "human");
const playingComp = (this.mode == "computer");
let actionArray = [
];
if (!!this.vr)
{
+ const square00 = document.getElementById("sq-0-0");
+ const squareWidth = !!square00
+ ? parseFloat(window.getComputedStyle(square00).width.slice(0,-2))
+ : 0;
+ const indicWidth = (squareWidth>0 ? squareWidth/2 : 20);
if (this.mode == "human")
{
let connectedIndic = h(
'div',
{
"class": {
+ "topindicator": true,
+ "indic-left": true,
"connected": this.oppConnected,
"disconnected": !this.oppConnected,
},
+ style: {
+ "width": indicWidth + "px",
+ "height": indicWidth + "px",
+ },
}
);
elementArray.push(connectedIndic);
}
+ let turnIndic = h(
+ 'div',
+ {
+ "class": {
+ "topindicator": true,
+ "indic-right": true,
+ "white-turn": this.vr.turn=="w",
+ "black-turn": this.vr.turn=="b",
+ },
+ style: {
+ "width": indicWidth + "px",
+ "height": indicWidth + "px",
+ },
+ }
+ );
+ elementArray.push(turnIndic);
let choices = h('div',
{
attrs: { "id": "choices" },
'class': { 'row': true },
style: {
- //"position": "relative",
"display": this.choices.length>0?"block":"none",
"top": "-" + ((sizeY/2)*squareWidth+squareWidth/2) + "px",
"width": (this.choices.length * squareWidth) + "px",
margin-left: auto
margin-right: auto
-.connected, .disconnected
- width: 20px
- height: 20px
- margin: 0 auto 15px auto
+.topindicator
+ position: relative
border: 1px solid brown
+.indic-left
+ float: left
+ margin: 0 0 10px 20px
+
+.indic-right
+ float: right
+ margin: 0 20px 10px 0
+
.connected
background-color: green
.disconnected
background-color: red
+.white-turn
+ background-color: white
+
+.black-turn
+ background-color: black
+
// TODO: div.board, board9, board10, board11, board12
div.board
float: left
display: inline-block
position: relative
+.game
+ clear: both
+
.game .board
cursor: pointer