Fix notation and pieces setup for random asymmetric in Eightpieces
[vchess.git] / client / src / components / BaseGame.vue
CommitLineData
a6088c90 1<template lang="pug">
e71161fb 2div#baseGame
7e355d68 3 input#modalEog.modal(type="checkbox")
6808d7a1
BA
4 div#eogDiv(
5 role="dialog"
6 data-checkbox="modalEog"
7 )
9a3049f3 8 .card.text-center
7e355d68 9 label.modal-close(for="modalEog")
9a3049f3 10 h3.section {{ endgameMessage }}
cf94b843
BA
11 #gameContainer
12 #boardContainer
6808d7a1 13 Board(
a6836242 14 ref="board"
6808d7a1
BA
15 :vr="vr"
16 :last-move="lastMove"
20620465
BA
17 :analyze="game.mode=='analyze'"
18 :score="game.score"
6808d7a1
BA
19 :user-color="game.mycolor"
20 :orientation="orientation"
21 :vname="game.vname"
22 :incheck="incheck"
23 @play-move="play"
24 )
20620465 25 #turnIndicator(v-if="showTurn") {{ turn }}
b1e46b33 26 #controls.button-group
b9a5fe01
BA
27 button(@click="gotoBegin()")
28 img.inline(src="/images/icons/fast-forward_rev.svg")
29 button(@click="undo()")
30 img.inline(src="/images/icons/play_rev.svg")
31 button(v-if="canFlip" @click="flip()")
32 img.inline(src="/images/icons/flip.svg")
54ec15eb
BA
33 button(
34 @click="runAutoplay()"
35 :class="{'in-autoplay': autoplay}"
36 )
37 img.inline(src="/images/icons/autoplay.svg")
b9a5fe01
BA
38 button(@click="play()")
39 img.inline(src="/images/icons/play.svg")
40 button(@click="gotoEnd()")
41 img.inline(src="/images/icons/fast-forward.svg")
cf94b843 42 #movesList
6808d7a1 43 MoveList(
933fd1f9 44 :show="showMoves"
feaf1bf7
BA
45 :canAnalyze="canAnalyze"
46 :canDownload="allowDownloadPGN"
6808d7a1
BA
47 :score="game.score"
48 :message="game.scoreMsg"
49 :firstNum="firstMoveNumber"
50 :moves="moves"
51 :cursor="cursor"
feaf1bf7
BA
52 @download="download"
53 @showrules="showRules"
54 @analyze="analyzePosition"
6808d7a1
BA
55 @goto-move="gotoMove"
56 )
41c80bb6 57 .clearer
a6088c90
BA
58</template>
59
60<script>
61import Board from "@/components/Board.vue";
f21cd6d9 62import MoveList from "@/components/MoveList.vue";
a6088c90
BA
63import { store } from "@/store";
64import { getSquareId } from "@/utils/squareId";
d4036efe 65import { getDate } from "@/utils/datetime";
602d6bef 66import { processModalClick } from "@/utils/modalClick";
77c50966 67import { getScoreMessage } from "@/utils/scoring";
e71161fb
BA
68import { getFullNotation } from "@/utils/notation";
69import { undoMove } from "@/utils/playUndo";
a6088c90 70export default {
6808d7a1 71 name: "my-base-game",
a6088c90
BA
72 components: {
73 Board,
6808d7a1 74 MoveList
a6088c90 75 },
e71161fb 76 props: ["game"],
a6088c90
BA
77 data: function() {
78 return {
79 st: store.state,
b7c32f1a 80 // NOTE: all following variables must be reset at the beginning of a game
e71161fb 81 vr: null, //VariantRules object, game state
a6088c90
BA
82 endgameMessage: "",
83 orientation: "w",
84 score: "*", //'*' means 'unfinished'
b7c32f1a 85 moves: [],
a6088c90
BA
86 cursor: -1, //index of the move just played
87 lastMove: null,
5157ce0b 88 firstMoveNumber: 0, //for printing
e71161fb 89 incheck: [], //for Board
57eb158f 90 inMultimove: false,
54ec15eb
BA
91 autoplay: false,
92 autoplayLoop: null,
57eb158f
BA
93 inPlay: false,
94 stackToPlay: []
a6088c90
BA
95 };
96 },
97 computed: {
98 showMoves: function() {
933fd1f9
BA
99 return this.game.score != "*"
100 ? "all"
101 : (this.vr ? this.vr.showMoves : "none");
20620465
BA
102 },
103 showTurn: function() {
71ef1664
BA
104 return (
105 this.game.score == '*' &&
106 this.vr &&
107 (this.vr.showMoves != "all" || !this.vr.canFlip)
108 );
a6088c90 109 },
58ae6be5 110 turn: function() {
71ef1664
BA
111 if (!this.vr)
112 return "";
113 if (this.vr.showMoves != "all")
114 return this.st.tr[(this.vr.turn == 'w' ? "White" : "Black") + " to move"]
115 // Cannot flip: racing king or circular chess
116 return this.vr.movesCount == 0 && this.game.mycolor == "w"
117 ? this.st.tr["It's your turn!"]
a13cbc0f 118 : "";
58ae6be5 119 },
20620465 120 canAnalyze: function() {
933fd1f9 121 return this.game.mode != "analyze" && this.vr && this.vr.canAnalyze;
20620465 122 },
71ef1664
BA
123 canFlip: function() {
124 return this.vr && this.vr.canFlip;
125 },
20620465 126 allowDownloadPGN: function() {
933fd1f9 127 return this.game.score != "*" || (this.vr && this.vr.showMoves == "all");
6808d7a1 128 }
a6088c90 129 },
4b0384fa 130 created: function() {
b1e46b33 131 if (!!this.game.fenStart) this.re_setVariables();
4b0384fa 132 },
cf94b843 133 mounted: function() {
e71161fb
BA
134 if (!("ontouchstart" in window)) {
135 // Desktop browser:
136 const baseGameDiv = document.getElementById("baseGame");
137 baseGameDiv.tabIndex = 0;
138 baseGameDiv.addEventListener("click", this.focusBg);
139 baseGameDiv.addEventListener("keydown", this.handleKeys);
140 baseGameDiv.addEventListener("wheel", this.handleScroll);
141 }
42a92848
BA
142 document.getElementById("eogDiv")
143 .addEventListener("click", processModalClick);
cf94b843 144 },
54ec15eb
BA
145 beforeDestroy: function() {
146 if (!!this.autoplayLoop) clearInterval(this.autoplayLoop);
147 },
a6088c90 148 methods: {
9ca1e26b 149 focusBg: function() {
9ca1e26b
BA
150 document.getElementById("baseGame").focus();
151 },
152 handleKeys: function(e) {
6808d7a1
BA
153 if ([32, 37, 38, 39, 40].includes(e.keyCode)) e.preventDefault();
154 switch (e.keyCode) {
9ca1e26b
BA
155 case 37:
156 this.undo();
157 break;
158 case 39:
159 this.play();
160 break;
5701c228 161 case 38:
9ca1e26b
BA
162 this.gotoBegin();
163 break;
164 case 40:
165 this.gotoEnd();
166 break;
167 case 32:
9ca1e26b
BA
168 this.flip();
169 break;
170 }
171 },
dcd68c41 172 handleScroll: function(e) {
e71161fb
BA
173 e.preventDefault();
174 if (e.deltaY < 0) this.undo();
175 else if (e.deltaY > 0) this.play();
dcd68c41 176 },
0e16cb26
BA
177 showRules: function() {
178 //this.$router.push("/variants/" + this.game.vname);
179 window.open("#/variants/" + this.game.vname, "_blank"); //better
180 },
b1e46b33
BA
181 re_setVariables: function(game) {
182 if (!game) game = this.game; //in case of...
4b0384fa 183 this.endgameMessage = "";
8477e53d 184 // "w": default orientation for observed games
b1e46b33
BA
185 this.orientation = game.mycolor || "w";
186 this.moves = JSON.parse(JSON.stringify(game.moves || []));
e71161fb 187 // Post-processing: decorate each move with notation and FEN
b1e46b33
BA
188 this.vr = new V(game.fenStart);
189 const parsedFen = V.ParseFen(game.fenStart);
8477e53d
BA
190 const firstMoveColor = parsedFen.turn;
191 this.firstMoveNumber = Math.floor(parsedFen.movesCount / 2);
f54f4c26 192 let L = this.moves.length;
d4036efe 193 this.moves.forEach(move => {
e71161fb
BA
194 // Strategy working also for multi-moves:
195 if (!Array.isArray(move)) move = [move];
f54f4c26 196 move.forEach((m,idx) => {
e71161fb
BA
197 m.notation = this.vr.getNotation(m);
198 this.vr.play(m);
f54f4c26
BA
199 if (idx < L - 1 && this.vr.getCheckSquares(this.vr.turn).length > 0)
200 m.notation += "+";
e71161fb 201 });
d4036efe 202 });
8477e53d 203 if (firstMoveColor == "b") {
311cba76 204 // 'start' & 'end' is required for Board component
6808d7a1 205 this.moves.unshift({
6808d7a1 206 notation: "...",
311cba76 207 start: { x: -1, y: -1 },
3a2a7b5f
BA
208 end: { x: -1, y: -1 },
209 fen: game.fenStart
6808d7a1 210 });
f54f4c26 211 L++;
697ee580 212 }
e71161fb 213 this.positionCursorTo(this.moves.length - 1);
9ef63965 214 this.incheck = this.vr.getCheckSquares(this.vr.turn);
f54f4c26 215 const score = this.vr.getCurrentScore();
3f22c2c3
BA
216 if (L > 0 && this.moves[L - 1].notation != "...") {
217 if (["1-0","0-1"].includes(score))
218 this.moves[L - 1].notation += "#";
219 else if (this.vr.getCheckSquares(this.vr.turn).length > 0)
220 this.moves[L - 1].notation += "+";
221 }
4b0384fa 222 },
e71161fb
BA
223 positionCursorTo: function(index) {
224 this.cursor = index;
225 // Caution: last move in moves array might be a multi-move
226 if (index >= 0) {
227 if (Array.isArray(this.moves[index])) {
228 const L = this.moves[index].length;
229 this.lastMove = this.moves[index][L - 1];
230 } else {
231 this.lastMove = this.moves[index];
232 }
3a2a7b5f 233 } else this.lastMove = null;
e71161fb 234 },
63ca2b89 235 analyzePosition: function() {
7ba4a5bc 236 let newUrl =
6808d7a1
BA
237 "/analyse/" +
238 this.game.vname +
239 "/?fen=" +
240 this.vr.getFen().replace(/ /g, "_");
7ba4a5bc
BA
241 if (this.game.mycolor)
242 newUrl += "&side=" + this.game.mycolor;
910d631b 243 // Open in same tab in live games (against cheating)
6808d7a1 244 if (this.game.type == "live") this.$router.push(newUrl);
910d631b 245 else window.open("#" + newUrl);
603b8a8b 246 },
a6088c90
BA
247 download: function() {
248 const content = this.getPgn();
249 // Prepare and trigger download link
250 let downloadAnchor = document.getElementById("download");
251 downloadAnchor.setAttribute("download", "game.pgn");
6808d7a1
BA
252 downloadAnchor.href =
253 "data:text/plain;charset=utf-8," + encodeURIComponent(content);
a6088c90
BA
254 downloadAnchor.click();
255 },
256 getPgn: function() {
257 let pgn = "";
258 pgn += '[Site "vchess.club"]\n';
834c202a 259 pgn += '[Variant "' + this.game.vname + '"]\n';
a6088c90 260 pgn += '[Date "' + getDate(new Date()) + '"]\n';
d4036efe
BA
261 pgn += '[White "' + this.game.players[0].name + '"]\n';
262 pgn += '[Black "' + this.game.players[1].name + '"]\n';
834c202a 263 pgn += '[Fen "' + this.game.fenStart + '"]\n';
430a2038 264 pgn += '[Result "' + this.game.score + '"]\n\n';
e71161fb
BA
265 for (let i = 0; i < this.moves.length; i += 2) {
266 pgn += (i/2+1) + "." + getFullNotation(this.moves[i]) + " ";
267 if (i+1 < this.moves.length)
268 pgn += getFullNotation(this.moves[i+1]) + " ";
a6088c90
BA
269 }
270 return pgn + "\n";
271 },
b988c726
BA
272 showEndgameMsg: function(message) {
273 this.endgameMessage = message;
aae89b49 274 document.getElementById("modalEog").checked = true;
a6088c90 275 },
54ec15eb
BA
276 runAutoplay: function() {
277 const infinitePlay = () => {
278 if (this.cursor == this.moves.length - 1) {
279 clearInterval(this.autoplayLoop);
280 this.autoplayLoop = null;
281 this.autoplay = false;
282 return;
283 }
284 if (this.inPlay || this.inMultimove)
285 // Wait next tick
286 return;
287 this.play();
288 };
289 if (this.autoplay) {
290 this.autoplay = false;
291 clearInterval(this.autoplayLoop);
292 this.autoplayLoop = null;
293 } else {
294 this.autoplay = true;
295 infinitePlay();
296 this.autoplayLoop = setInterval(infinitePlay, 1500);
297 }
298 },
e71161fb 299 // Animate an elementary move
63ca2b89 300 animateMove: function(move, callback) {
a6088c90 301 let startSquare = document.getElementById(getSquareId(move.start));
f9c36b2d 302 if (!startSquare) return; //shouldn't happen but...
a6088c90
BA
303 let endSquare = document.getElementById(getSquareId(move.end));
304 let rectStart = startSquare.getBoundingClientRect();
305 let rectEnd = endSquare.getBoundingClientRect();
6808d7a1
BA
306 let translation = {
307 x: rectEnd.x - rectStart.x,
308 y: rectEnd.y - rectStart.y
309 };
310 let movingPiece = document.querySelector(
311 "#" + getSquareId(move.start) + " > img.piece"
312 );
efdfb4c7
BA
313 // For some unknown reasons Opera get "movingPiece == null" error
314 // TOOO: is it calling 'animate()' twice ? One extra time ?
315 if (!movingPiece) return;
a6088c90
BA
316 // HACK for animation (with positive translate, image slides "under background")
317 // Possible improvement: just alter squares on the piece's way...
318 const squares = document.getElementsByClassName("board");
6808d7a1 319 for (let i = 0; i < squares.length; i++) {
a6088c90 320 let square = squares.item(i);
6808d7a1 321 if (square.id != getSquareId(move.start)) square.style.zIndex = "-1";
a6088c90 322 }
6808d7a1
BA
323 movingPiece.style.transform =
324 "translate(" + translation.x + "px," + translation.y + "px)";
910d631b 325 movingPiece.style.transitionDuration = "0.25s";
a6088c90 326 movingPiece.style.zIndex = "3000";
6808d7a1
BA
327 setTimeout(() => {
328 for (let i = 0; i < squares.length; i++)
a6088c90
BA
329 squares.item(i).style.zIndex = "auto";
330 movingPiece.style = {}; //required e.g. for 0-0 with KR swap
63ca2b89 331 callback();
a6088c90
BA
332 }, 250);
333 },
8055eabd
BA
334 // For Analyse mode:
335 emitFenIfAnalyze: function() {
336 if (this.game.mode == "analyze") {
337 this.$emit(
338 "fenchange",
f1c9d707 339 !!this.lastMove ? this.lastMove.fen : this.game.fenStart
8055eabd
BA
340 );
341 }
342 },
e71161fb 343 // "light": if gotoMove() or gotoEnd()
57eb158f 344 play: function(move, received, light, noemit) {
a6836242
BA
345 // Freeze while choices are shown:
346 if (this.$refs["board"].choices.length > 0) return;
57eb158f
BA
347 if (!!noemit) {
348 if (this.inPlay) {
349 // Received moves in observed games can arrive too fast:
350 this.stackToPlay.unshift(move);
351 return;
352 }
353 this.inPlay = true;
354 }
9d54ab89 355 const navigate = !move;
e71161fb 356 const playSubmove = (smove) => {
fbd68f75 357 smove.notation = this.vr.getNotation(smove);
e71161fb 358 this.vr.play(smove);
f14572c4 359 this.lastMove = smove;
fbd68f75 360 if (!this.inMultimove) {
54ec15eb
BA
361 // Condition is "!navigate" but we mean "!this.autoplay"
362 if (!navigate) {
363 if (this.cursor < this.moves.length - 1)
364 this.moves = this.moves.slice(0, this.cursor + 1);
365 this.moves.push(smove);
366 }
fbd68f75
BA
367 this.inMultimove = true; //potentially
368 this.cursor++;
54ec15eb 369 } else if (!navigate) {
fbd68f75
BA
370 // Already in the middle of a multi-move
371 const L = this.moves.length;
372 if (!Array.isArray(this.moves[L-1]))
373 this.$set(this.moves, L-1, [this.moves[L-1], smove]);
374 else
375 this.$set(this.moves, L-1, this.moves.concat([smove]));
e71161fb
BA
376 }
377 };
378 const playMove = () => {
54ec15eb
BA
379 const animate = (
380 V.ShowMoves == "all" &&
381 (this.autoplay || !!received)
382 );
e71161fb
BA
383 if (!Array.isArray(move)) move = [move];
384 let moveIdx = 0;
385 let self = this;
386 const initurn = this.vr.turn;
387 (function executeMove() {
388 const smove = move[moveIdx++];
389 if (animate) {
390 self.animateMove(smove, () => {
391 playSubmove(smove);
392 if (moveIdx < move.length)
393 setTimeout(executeMove, 500);
394 else afterMove(smove, initurn);
395 });
396 } else {
397 playSubmove(smove);
398 if (moveIdx < move.length) executeMove();
399 else afterMove(smove, initurn);
400 }
401 })();
402 };
fbd68f75
BA
403 const computeScore = () => {
404 const score = this.vr.getCurrentScore();
f54f4c26
BA
405 if (!navigate) {
406 if (["1-0","0-1"].includes(score))
407 this.lastMove.notation += "#";
408 else if (this.vr.getCheckSquares(this.vr.turn).length > 0)
409 this.lastMove.notation += "+";
410 }
fbd68f75
BA
411 if (score != "*" && this.game.mode == "analyze") {
412 const message = getScoreMessage(score);
413 // Just show score on screen (allow undo)
414 this.showEndgameMsg(score + " . " + this.st.tr[message]);
415 }
416 return score;
417 };
e71161fb 418 const afterMove = (smove, initurn) => {
e71161fb
BA
419 if (this.vr.turn != initurn) {
420 // Turn has changed: move is complete
3a2a7b5f 421 if (!smove.fen)
cc00b83c
BA
422 // NOTE: only FEN of last sub-move is required (thus setting it here)
423 smove.fen = this.vr.getFen();
b0a0468a
BA
424 // Is opponent in check?
425 this.incheck = this.vr.getCheckSquares(this.vr.turn);
3a2a7b5f 426 this.emitFenIfAnalyze();
e71161fb 427 this.inMultimove = false;
f54f4c26 428 this.score = computeScore();
54ec15eb 429 if (this.game.mode != "analyze" && !navigate) {
f54f4c26 430 if (!noemit) {
5aa14a21 431 // Post-processing (e.g. computer play).
f54f4c26 432 const L = this.moves.length;
5aa14a21
BA
433 // NOTE: always emit the score, even in unfinished,
434 // to tell Game::processMove() that it's not a received move.
f54f4c26
BA
435 this.$emit("newmove", this.moves[L-1], { score: this.score });
436 } else {
57eb158f
BA
437 this.inPlay = false;
438 if (this.stackToPlay.length > 0)
439 // Move(s) arrived in-between
440 this.play(this.stackToPlay.pop(), received, light, noemit);
441 }
e71161fb
BA
442 }
443 }
444 };
445 // NOTE: navigate and received are mutually exclusive
446 if (navigate) {
447 // The move to navigate to is necessarily full:
448 if (this.cursor == this.moves.length - 1) return; //no more moves
449 move = this.moves[this.cursor + 1];
54ec15eb
BA
450 if (!this.autoplay) {
451 // Just play the move:
452 if (!Array.isArray(move)) move = [move];
453 for (let i=0; i < move.length; i++) this.vr.play(move[i]);
454 if (!light) {
455 this.lastMove = move[move.length-1];
456 this.incheck = this.vr.getCheckSquares(this.vr.turn);
457 this.score = computeScore();
458 this.emitFenIfAnalyze();
459 }
460 this.cursor++;
461 return;
8055eabd 462 }
e71161fb 463 }
63ca2b89
BA
464 // Forbid playing outside analyze mode, except if move is received.
465 // Sufficient condition because Board already knows which turn it is.
6808d7a1 466 if (
6808d7a1 467 this.game.mode != "analyze" &&
dcb3637c 468 !navigate &&
e71161fb 469 !received &&
6808d7a1
BA
470 (this.game.score != "*" || this.cursor < this.moves.length - 1)
471 ) {
a6088c90
BA
472 return;
473 }
e71161fb
BA
474 // To play a received move, cursor must be at the end of the game:
475 if (received && this.cursor < this.moves.length - 1)
476 this.gotoEnd();
477 playMove();
478 },
479 cancelCurrentMultimove: function() {
e71161fb
BA
480 const L = this.moves.length;
481 let move = this.moves[L-1];
482 if (!Array.isArray(move)) move = [move];
483 for (let i=move.length -1; i >= 0; i--) this.vr.undo(move[i]);
484 this.moves.pop();
485 this.cursor--;
486 this.inMultimove = false;
487 },
488 cancelLastMove: function() {
489 // The last played move was canceled (corr game)
490 this.undo();
491 this.moves.pop();
492 },
493 // "light": if gotoMove() or gotoBegin()
494 undo: function(move, light) {
a6836242
BA
495 // Freeze while choices are shown:
496 if (this.$refs["board"].choices.length > 0) return;
e71161fb
BA
497 if (this.inMultimove) {
498 this.cancelCurrentMultimove();
63ca2b89 499 this.incheck = this.vr.getCheckSquares(this.vr.turn);
e71161fb
BA
500 } else {
501 if (!move) {
3a2a7b5f
BA
502 const minCursor =
503 this.moves.length > 0 && this.moves[0].notation == "..."
504 ? 1
505 : 0;
506 if (this.cursor < minCursor) return; //no more moves
e71161fb
BA
507 move = this.moves[this.cursor];
508 }
e71161fb
BA
509 undoMove(move, this.vr);
510 if (light) this.cursor--;
511 else {
512 this.positionCursorTo(this.cursor - 1);
e71161fb 513 this.incheck = this.vr.getCheckSquares(this.vr.turn);
8055eabd 514 this.emitFenIfAnalyze();
63ca2b89 515 }
a6088c90 516 }
a6088c90
BA
517 },
518 gotoMove: function(index) {
a6836242 519 if (this.$refs["board"].choices.length > 0) return;
e71161fb
BA
520 if (this.inMultimove) this.cancelCurrentMultimove();
521 if (index == this.cursor) return;
522 if (index < this.cursor) {
523 while (this.cursor > index)
524 this.undo(null, null, "light");
525 }
526 else {
527 // index > this.cursor)
528 while (this.cursor < index)
529 this.play(null, null, "light");
530 }
531 // NOTE: next line also re-assign cursor, but it's very light
532 this.positionCursorTo(index);
8b405c81 533 this.incheck = this.vr.getCheckSquares(this.vr.turn);
8055eabd 534 this.emitFenIfAnalyze();
a6088c90
BA
535 },
536 gotoBegin: function() {
a6836242 537 if (this.$refs["board"].choices.length > 0) return;
e71161fb 538 if (this.inMultimove) this.cancelCurrentMultimove();
3a2a7b5f
BA
539 const minCursor =
540 this.moves.length > 0 && this.moves[0].notation == "..."
541 ? 1
542 : 0;
543 while (this.cursor >= minCursor) this.undo(null, null, "light");
544 this.lastMove = (minCursor == 1 ? this.moves[0] : null);
545 this.incheck = this.vr.getCheckSquares(this.vr.turn);
8055eabd 546 this.emitFenIfAnalyze();
a6088c90
BA
547 },
548 gotoEnd: function() {
a6836242 549 if (this.$refs["board"].choices.length > 0) return;
6808d7a1
BA
550 if (this.cursor == this.moves.length - 1) return;
551 this.gotoMove(this.moves.length - 1);
8055eabd 552 this.emitFenIfAnalyze();
a6088c90
BA
553 },
554 flip: function() {
a6836242 555 if (this.$refs["board"].choices.length > 0) return;
0e16cb26 556 this.orientation = V.GetOppCol(this.orientation);
6808d7a1
BA
557 }
558 }
a6088c90
BA
559};
560</script>
72ccbd67 561
41c80bb6 562<style lang="sass" scoped>
9a3049f3
BA
563[type="checkbox"]#modalEog+div .card
564 min-height: 45px
910d631b 565
cf94b843
BA
566#baseGame
567 width: 100%
4f518610
BA
568 &:focus
569 outline: none
cf94b843
BA
570
571#gameContainer
72ccbd67
BA
572 margin-left: auto
573 margin-right: auto
cf94b843 574
ed06d9e9
BA
575#downloadDiv
576 display: inline-block
577
72ccbd67 578#controls
28b32b4f 579 user-select: none
72ccbd67 580 button
b1e46b33 581 border: none
72ccbd67 582 margin: 0
feaf1bf7
BA
583 padding-top: 5px
584 padding-bottom: 5px
585
54ec15eb
BA
586.in-autoplay
587 background-color: #FACF8C
588
feaf1bf7 589img.inline
54ec15eb 590 height: 22px
feaf1bf7
BA
591 padding-top: 5px
592 @media screen and (max-width: 767px)
593 height: 18px
910d631b 594
0e16cb26
BA
595#turnIndicator
596 text-align: center
29bc61be 597 font-weight: bold
910d631b 598
72ccbd67 599#boardContainer
cf94b843 600 float: left
41c80bb6
BA
601// TODO: later, maybe, allow movesList of variable width
602// or e.g. between 250 and 350px (but more complicated)
910d631b 603
cf94b843
BA
604#movesList
605 width: 280px
606 float: left
910d631b 607
96e9585a
BA
608@media screen and (max-width: 767px)
609 #movesList
610 width: 100%
611 float: none
612 clear: both
72ccbd67 613</style>