Add Makruk, Shako and Shogi + a few fixes
[vchess.git] / client / src / components / BaseGame.vue
1 <template lang="pug">
2 div#baseGame
3 input#modalEog.modal(type="checkbox")
4 div#eogDiv(
5 role="dialog"
6 data-checkbox="modalEog"
7 )
8 .card.text-center
9 label.modal-close(for="modalEog")
10 h3.section {{ endgameMessage }}
11 #gameContainer
12 #boardContainer
13 Board(
14 ref="board"
15 :vr="vr"
16 :last-move="lastMove"
17 :analyze="mode=='analyze'"
18 :score="game.score"
19 :user-color="game.mycolor"
20 :orientation="orientation"
21 :vname="game.vname"
22 :incheck="incheck"
23 @play-move="play"
24 @click-square="clickSquare"
25 )
26 #turnIndicator(v-if="showTurn") {{ turn }}
27 #controls.button-group
28 button(@click="gotoBegin()")
29 img.inline(src="/images/icons/fast-forward_rev.svg")
30 button(@click="undo()")
31 img.inline(src="/images/icons/play_rev.svg")
32 button(v-if="canFlip" @click="flip()")
33 img.inline(src="/images/icons/flip.svg")
34 button(
35 @click="runAutoplay()"
36 :class="{'in-autoplay': autoplay}"
37 )
38 img.inline(src="/images/icons/autoplay.svg")
39 button(@click="play()")
40 img.inline(src="/images/icons/play.svg")
41 button(@click="gotoEnd()")
42 img.inline(src="/images/icons/fast-forward.svg")
43 p#fenAnalyze(v-show="showFen") {{ (!!vr ? vr.getFen() : "") }}
44 #movesList
45 MoveList(
46 :show="showMoves"
47 :canAnalyze="canAnalyze"
48 :canDownload="allowDownloadPGN"
49 :score="game.score"
50 :message="game.scoreMsg"
51 :firstNum="firstMoveNumber"
52 :moves="moves"
53 :cursor="cursor"
54 @download="download"
55 @showrules="showRules"
56 @analyze="toggleAnalyze"
57 @goto-move="gotoMove"
58 @reset-arrows="resetArrows"
59 )
60 .clearer
61 </template>
62
63 <script>
64 import Board from "@/components/Board.vue";
65 import MoveList from "@/components/MoveList.vue";
66 import params from "@/parameters";
67 import { store } from "@/store";
68 import { getSquareId } from "@/utils/squareId";
69 import { getDate } from "@/utils/datetime";
70 import { processModalClick } from "@/utils/modalClick";
71 import { getScoreMessage } from "@/utils/scoring";
72 import { getFullNotation } from "@/utils/notation";
73 import { undoMove } from "@/utils/playUndo";
74 export default {
75 name: "my-base-game",
76 components: {
77 Board,
78 MoveList
79 },
80 props: ["game"],
81 data: function() {
82 return {
83 st: store.state,
84 // NOTE: all following variables must be reset at the beginning of a game
85 vr: null, //VariantRules object, game state
86 endgameMessage: "",
87 orientation: "w",
88 mode: "",
89 score: "*", //'*' means 'unfinished'
90 moves: [],
91 cursor: -1, //index of the move just played
92 lastMove: null,
93 firstMoveNumber: 0, //for printing
94 incheck: [], //for Board
95 inMultimove: false,
96 autoplay: false,
97 inPlay: false,
98 stackToPlay: []
99 };
100 },
101 computed: {
102 turn: function() {
103 if (!this.vr) return "";
104 if (this.vr.showMoves != "all") {
105 return this.st.tr[
106 (this.vr.turn == 'w' ? "White" : "Black") + " to move"];
107 }
108 // Cannot flip: racing king or circular chess
109 return (
110 this.vr.movesCount == 0 && this.game.mycolor == "w"
111 ? this.st.tr["It's your turn!"]
112 : ""
113 );
114 },
115 showFen: function() {
116 return (
117 this.mode == "analyze" &&
118 this.$router.currentRoute.path.indexOf("/analyse") === -1
119 );
120 },
121 // TODO: is it OK to pass "computed" as properties?
122 // Also, some are seemingly not recomputed when vr is initialized.
123 showMoves: function() {
124 return this.game.score != "*"
125 ? "all"
126 : (!!this.vr ? this.vr.showMoves : "none");
127 },
128 showTurn: function() {
129 return (
130 this.game.score == '*' &&
131 !!this.vr && (this.vr.showMoves != "all" || !this.vr.canFlip)
132 );
133 },
134 canAnalyze: function() {
135 return (
136 this.game.mode != "analyze" &&
137 !!this.vr && this.vr.canAnalyze
138 );
139 },
140 canFlip: function() {
141 return !!this.vr && this.vr.canFlip;
142 },
143 allowDownloadPGN: function() {
144 return (
145 this.game.score != "*" ||
146 (!!this.vr && this.vr.showMoves == "all")
147 );
148 }
149 },
150 created: function() {
151 if (!!this.game.fenStart) this.re_setVariables();
152 },
153 mounted: function() {
154 if (!("ontouchstart" in window)) {
155 // Desktop browser:
156 const baseGameDiv = document.getElementById("baseGame");
157 baseGameDiv.tabIndex = 0;
158 baseGameDiv.addEventListener("click", this.focusBg);
159 baseGameDiv.addEventListener("keydown", this.handleKeys);
160 baseGameDiv.addEventListener("wheel", this.handleScroll);
161 }
162 document.getElementById("eogDiv")
163 .addEventListener("click", processModalClick);
164 },
165 beforeDestroy: function() {
166 // TODO: probably not required
167 this.autoplay = false;
168 },
169 methods: {
170 focusBg: function() {
171 document.getElementById("baseGame").focus();
172 },
173 handleKeys: function(e) {
174 if ([32, 37, 38, 39, 40].includes(e.keyCode)) e.preventDefault();
175 switch (e.keyCode) {
176 case 37:
177 this.undo();
178 break;
179 case 39:
180 this.play();
181 break;
182 case 38:
183 this.gotoBegin();
184 break;
185 case 40:
186 this.gotoEnd();
187 break;
188 case 32:
189 this.flip();
190 break;
191 }
192 },
193 handleScroll: function(e) {
194 e.preventDefault();
195 if (e.deltaY < 0) this.undo();
196 else if (e.deltaY > 0) this.play();
197 },
198 resetArrows: function() {
199 // TODO: make arrows scale with board, and remove this
200 this.$refs["board"].cancelResetArrows();
201 },
202 showRules: function() {
203 // The button is here only on Game page:
204 document.getElementById("modalRules").checked = true;
205 },
206 re_setVariables: function(game) {
207 if (!game) game = this.game; //in case of...
208 this.endgameMessage = "";
209 // "w": default orientation for observed games
210 this.orientation = game.mycolor || "w";
211 this.mode = game.mode || game.type; //TODO: merge...
212 this.moves = JSON.parse(JSON.stringify(game.moves || []));
213 // Post-processing: decorate each move with notation and FEN
214 this.vr = new V(game.fenStart);
215 this.inMultimove = false; //in case of
216 this.$refs["board"].resetCurrentAttempt(); //also in case of
217 let analyseBtn = document.getElementById("analyzeBtn");
218 if (!!analyseBtn) analyseBtn.classList.remove("active");
219 const parsedFen = V.ParseFen(game.fenStart);
220 const firstMoveColor = parsedFen.turn;
221 this.firstMoveNumber = Math.floor(parsedFen.movesCount / 2) + 1;
222 let L = this.moves.length;
223 if (L == 0) {
224 this.incheck = [];
225 this.score = "*";
226 }
227 this.moves.forEach((move,idx) => {
228 // Strategy working also for multi-moves:
229 if (!Array.isArray(move)) move = [move];
230 const Lm = move.length;
231 move.forEach((m,idxM) => {
232 m.notation = this.vr.getNotation(m);
233 m.unambiguous = V.GetUnambiguousNotation(m);
234 this.vr.play(m);
235 const checkSquares = this.vr.getCheckSquares();
236 if (checkSquares.length > 0) m.notation += "+";
237 if (idxM == Lm - 1) m.fen = this.vr.getFen();
238 if (idx == L - 1 && idxM == Lm - 1) {
239 this.incheck = checkSquares;
240 this.score = this.vr.getCurrentScore();
241 if (["1-0", "0-1"].includes(this.score)) m.notation += "#";
242 }
243 });
244 });
245 if (firstMoveColor == "b") {
246 // 'start' & 'end' is required for Board component
247 this.moves.unshift({
248 notation: "...",
249 unambiguous: "...",
250 start: { x: -1, y: -1 },
251 end: { x: -1, y: -1 },
252 fen: game.fenStart
253 });
254 L++;
255 }
256 this.positionCursorTo(L - 1);
257 },
258 positionCursorTo: function(index) {
259 this.cursor = index;
260 // Note: last move in moves array might be a multi-move
261 if (index >= 0) this.lastMove = this.moves[index];
262 else this.lastMove = null;
263 },
264 toggleAnalyze: function() {
265 // Freeze while choices are shown (and autoplay has priority)
266 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
267 if (this.mode != "analyze") {
268 // Enter analyze mode:
269 if (this.inMultimove) this.cancelCurrentMultimove();
270 this.gameMode = this.mode; //was not 'analyze'
271 this.mode = "analyze";
272 this.gameCursor = this.cursor;
273 this.gameMoves = JSON.parse(JSON.stringify(this.moves));
274 document.getElementById("analyzeBtn").classList.add("active");
275 }
276 else {
277 // Exit analyze mode:
278 this.mode = this.gameMode ;
279 this.cursor = this.gameCursor;
280 this.moves = this.gameMoves;
281 let fen = this.game.fenStart;
282 if (this.cursor >= 0) {
283 let mv = this.moves[this.cursor];
284 if (!Array.isArray(mv)) mv = [mv];
285 fen = mv[mv.length-1].fen;
286 }
287 this.vr = new V(fen);
288 this.inMultimove = false; //in case of
289 this.$refs["board"].resetCurrentAttempt(); //also in case of
290 this.incheck = this.vr.getCheckSquares();
291 if (this.cursor >= 0) this.lastMove = this.moves[this.cursor];
292 else this.lastMove = null;
293 document.getElementById("analyzeBtn").classList.remove("active");
294 }
295 },
296 download: function() {
297 const content = this.getPgn();
298 // Prepare and trigger download link
299 let downloadAnchor = document.getElementById("download");
300 downloadAnchor.setAttribute("download", "game.pgn");
301 downloadAnchor.href =
302 "data:text/plain;charset=utf-8," + encodeURIComponent(content);
303 downloadAnchor.click();
304 },
305 getPgn: function() {
306 let pgn = "";
307 pgn += '[Site "vchess.club"]\n';
308 pgn += '[Variant "' + this.game.vname + '"]\n';
309 const gdt = getDate(new Date(this.game.created || Date.now()));
310 pgn += '[Date "' + gdt + '"]\n';
311 pgn += '[White "' + this.game.players[0].name + '"]\n';
312 pgn += '[Black "' + this.game.players[1].name + '"]\n';
313 pgn += '[Fen "' + this.game.fenStart + '"]\n';
314 pgn += '[Result "' + this.game.score + '"]\n';
315 if (!!this.game.id)
316 pgn += '[Url "' + params.serverUrl + '/game/' + this.game.id + '"]\n';
317 if (!!this.game.cadence)
318 pgn += '[Cadence "' + this.game.cadence + '"]\n';
319 pgn += '\n';
320 for (let i = 0; i < this.moves.length; i += 2) {
321 if (i > 0) pgn += " ";
322 // Adjust dots notation for a better display:
323 let fullNotation = getFullNotation(this.moves[i]);
324 if (fullNotation == "...") fullNotation = "..";
325 pgn += (i / 2 + this.firstMoveNumber) + "." + fullNotation;
326 if (i+1 < this.moves.length)
327 pgn += " " + getFullNotation(this.moves[i+1]);
328 }
329 pgn += "\n\n";
330 for (let i = 0; i < this.moves.length; i += 2) {
331 const moveNumber = i / 2 + this.firstMoveNumber;
332 // Skip "dots move", useless for machine reading:
333 if (this.moves[i].notation != "...") {
334 pgn += moveNumber + ".w " +
335 getFullNotation(this.moves[i], "unambiguous") + "\n";
336 }
337 if (i+1 < this.moves.length) {
338 pgn += moveNumber + ".b " +
339 getFullNotation(this.moves[i+1], "unambiguous") + "\n";
340 }
341 }
342 return pgn;
343 },
344 showEndgameMsg: function(message) {
345 this.endgameMessage = message;
346 document.getElementById("modalEog").checked = true;
347 },
348 runAutoplay: function() {
349 if (this.autoplay) {
350 this.autoplay = false;
351 if (this.stackToPlay.length > 0)
352 // Move(s) arrived in-between
353 this.play(this.stackToPlay.pop(), "received");
354 }
355 else if (this.cursor < this.moves.length - 1) {
356 this.autoplay = true;
357 this.play(null, null, null, "autoplay");
358 }
359 },
360 // Animate an elementary move
361 animateMove: function(move, callback) {
362 let startSquare = document.getElementById(getSquareId(move.start));
363 if (!startSquare) return; //shouldn't happen but...
364 let endSquare = document.getElementById(getSquareId(move.end));
365 let rectStart = startSquare.getBoundingClientRect();
366 let rectEnd = endSquare.getBoundingClientRect();
367 let translation = {
368 x: rectEnd.x - rectStart.x,
369 y: rectEnd.y - rectStart.y
370 };
371 let movingPiece = document.querySelector(
372 "#" + getSquareId(move.start) + " > img.piece"
373 );
374 // For some unknown reasons Opera get "movingPiece == null" error
375 // TODO: is it calling 'animate()' twice ? One extra time ?
376 if (!movingPiece) return;
377 const squares = document.getElementsByClassName("board");
378 for (let i = 0; i < squares.length; i++) {
379 let square = squares.item(i);
380 if (square.id != getSquareId(move.start))
381 // HACK for animation:
382 // (with positive translate, image slides "under background")
383 square.style.zIndex = "-1";
384 }
385 movingPiece.style.transform =
386 "translate(" + translation.x + "px," + translation.y + "px)";
387 movingPiece.style.transitionDuration = "0.25s";
388 movingPiece.style.zIndex = "3000";
389 setTimeout(() => {
390 for (let i = 0; i < squares.length; i++)
391 squares.item(i).style.zIndex = "auto";
392 movingPiece.style = {}; //required e.g. for 0-0 with KR swap
393 callback();
394 }, 250);
395 },
396 // For Analyse mode:
397 emitFenIfAnalyze: function() {
398 if (this.game.mode == "analyze") {
399 let fen = this.game.fenStart;
400 if (!!this.lastMove) {
401 if (Array.isArray(this.lastMove)) {
402 const L = this.lastMove.length;
403 fen = this.lastMove[L-1].fen;
404 }
405 else fen = this.lastMove.fen;
406 }
407 this.$emit("fenchange", fen);
408 }
409 },
410 clickSquare: function(square) {
411 // Some variants make use of a single click at specific times:
412 const move = this.vr.doClick(square);
413 if (!!move) this.play(move);
414 },
415 // "light": if gotoMove() or gotoEnd()
416 play: function(move, received, light, autoplay) {
417 // Freeze while choices are shown:
418 if (this.$refs["board"].choices.length > 0) return;
419 const navigate = !move;
420 // Forbid navigation during autoplay:
421 if (navigate && this.autoplay && !autoplay) return;
422 // Forbid playing outside analyze mode, except if move is received.
423 // Sufficient condition because Board already knows which turn it is.
424 if (
425 this.mode != "analyze" &&
426 !navigate &&
427 !received &&
428 (this.game.score != "*" || this.cursor < this.moves.length - 1)
429 ) {
430 return;
431 }
432 if (!!received) {
433 if (this.autoplay || this.inPlay) {
434 // Received moves while autoplaying are stacked,
435 // and in observed games they could arrive too fast:
436 this.stackToPlay.unshift(move);
437 return;
438 }
439 this.inPlay = true;
440 if (this.mode == "analyze") this.toggleAnalyze();
441 if (this.cursor < this.moves.length - 1)
442 // To play a received move, cursor must be at the end of the game:
443 this.gotoEnd();
444 }
445 // The board may show some the possible moves: (TODO: bad solution)
446 this.$refs["board"].resetCurrentAttempt();
447 const playSubmove = (smove) => {
448 smove.notation = this.vr.getNotation(smove);
449 smove.unambiguous = V.GetUnambiguousNotation(smove);
450 this.vr.play(smove);
451 if (this.inMultimove && !!this.lastMove) {
452 if (!Array.isArray(this.lastMove))
453 this.lastMove = [this.lastMove, smove];
454 else this.lastMove.push(smove);
455 }
456 // Is opponent (or me) in check?
457 this.incheck = this.vr.getCheckSquares();
458 if (this.incheck.length > 0) smove.notation += "+";
459 if (!this.inMultimove) {
460 // First sub-move:
461 this.lastMove = smove;
462 // Condition is "!navigate" but we mean "!this.autoplay"
463 if (!navigate) {
464 if (this.cursor < this.moves.length - 1)
465 this.moves = this.moves.slice(0, this.cursor + 1);
466 this.moves.push(smove);
467 }
468 this.inMultimove = true; //potentially
469 this.cursor++;
470 } else if (!navigate) {
471 // Already in the middle of a multi-move
472 const L = this.moves.length;
473 if (!Array.isArray(this.moves[L-1]))
474 this.$set(this.moves, L-1, [this.moves[L-1], smove]);
475 else this.moves[L-1].push(smove);
476 }
477 };
478 const playMove = () => {
479 const animate = (
480 ["all", "highlight"].includes(V.ShowMoves) &&
481 (this.autoplay || !!received)
482 );
483 if (!Array.isArray(move)) move = [move];
484 let moveIdx = 0;
485 let self = this;
486 const initurn = this.vr.turn;
487 (function executeMove() {
488 const smove = move[moveIdx++];
489 // NOTE: condition "smove.start.x >= 0" required for Dynamo,
490 // because second move may be empty.
491 if (animate && smove.start.x >= 0) {
492 self.animateMove(smove, () => {
493 playSubmove(smove);
494 if (moveIdx < move.length) setTimeout(executeMove, 500);
495 else afterMove(smove, initurn);
496 });
497 } else {
498 playSubmove(smove);
499 if (moveIdx < move.length) executeMove();
500 else afterMove(smove, initurn);
501 }
502 })();
503 };
504 const computeScore = () => {
505 const score = this.vr.getCurrentScore();
506 if (!navigate) {
507 if (["1-0", "0-1"].includes(score)) {
508 if (Array.isArray(this.lastMove)) {
509 const L = this.lastMove.length;
510 this.lastMove[L - 1].notation += "#";
511 }
512 else this.lastMove.notation += "#";
513 }
514 }
515 if (score != "*" && ["analyze", "versus"].includes(this.mode)) {
516 const message = getScoreMessage(score);
517 // Show score on screen
518 this.showEndgameMsg(score + " . " + this.st.tr[message]);
519 }
520 return score;
521 };
522 const afterMove = (smove, initurn) => {
523 if (this.vr.turn != initurn) {
524 // Turn has changed: move is complete
525 if (!smove.fen)
526 // NOTE: only FEN of last sub-move is required (=> setting it here)
527 smove.fen = this.vr.getFen();
528 this.emitFenIfAnalyze();
529 this.inMultimove = false;
530 this.score = computeScore();
531 if (this.autoplay) {
532 if (this.cursor < this.moves.length - 1)
533 setTimeout(() => this.play(null, null, null, "autoplay"), 1000);
534 else {
535 this.autoplay = false;
536 if (this.stackToPlay.length > 0)
537 // Move(s) arrived in-between
538 this.play(this.stackToPlay.pop(), "received");
539 }
540 }
541 if (this.mode != "analyze" && !navigate) {
542 if (!received) {
543 // Post-processing (e.g. computer play).
544 const L = this.moves.length;
545 // NOTE: always emit the score, even in unfinished
546 this.$emit("newmove", this.moves[L-1], { score: this.score });
547 } else {
548 this.inPlay = false;
549 if (this.stackToPlay.length > 0)
550 // Move(s) arrived in-between
551 this.play(this.stackToPlay.pop(), "received");
552 }
553 }
554 }
555 };
556 // NOTE: navigate and received are mutually exclusive
557 if (navigate) {
558 // The move to navigate to is necessarily full:
559 if (this.cursor == this.moves.length - 1) return; //no more moves
560 move = this.moves[this.cursor + 1];
561 if (!this.autoplay) {
562 // Just play the move:
563 if (!Array.isArray(move)) move = [move];
564 for (let i=0; i < move.length; i++) this.vr.play(move[i]);
565 if (!light) {
566 this.lastMove = move;
567 this.incheck = this.vr.getCheckSquares();
568 this.score = computeScore();
569 this.emitFenIfAnalyze();
570 }
571 this.cursor++;
572 return;
573 }
574 }
575 playMove();
576 },
577 cancelCurrentMultimove: function() {
578 const L = this.moves.length;
579 let move = this.moves[L-1];
580 if (!Array.isArray(move)) move = [move];
581 for (let i = move.length - 1; i >= 0; i--) this.vr.undo(move[i]);
582 this.moves.pop();
583 this.cursor--;
584 this.inMultimove = false;
585 },
586 cancelLastMove: function() {
587 // The last played move was canceled (corr game)
588 this.undo();
589 this.moves.pop();
590 },
591 // "light": if gotoMove() or gotoBegin()
592 undo: function(move, light) {
593 // Freeze while choices are shown:
594 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
595 this.$refs["board"].resetCurrentAttempt();
596 if (this.inMultimove) {
597 this.cancelCurrentMultimove();
598 this.incheck = this.vr.getCheckSquares();
599 if (this.cursor >= 0) this.lastMove = this.moves[this.cursor];
600 else this.lastMove = null;
601 } else {
602 if (!move) {
603 const minCursor =
604 this.moves.length > 0 && this.moves[0].notation == "..."
605 ? 1
606 : 0;
607 if (this.cursor < minCursor) return; //no more moves
608 move = this.moves[this.cursor];
609 }
610 this.$refs["board"].resetCurrentAttempt();
611 undoMove(move, this.vr);
612 if (light) this.cursor--;
613 else {
614 this.positionCursorTo(this.cursor - 1);
615 this.incheck = this.vr.getCheckSquares();
616 this.emitFenIfAnalyze();
617 }
618 }
619 },
620 gotoMove: function(index) {
621 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
622 this.$refs["board"].resetCurrentAttempt();
623 if (this.inMultimove) this.cancelCurrentMultimove();
624 if (index == this.cursor) return;
625 if (index < this.cursor) {
626 while (this.cursor > index)
627 this.undo(null, null, "light");
628 }
629 else {
630 // index > this.cursor)
631 while (this.cursor < index)
632 this.play(null, null, "light");
633 }
634 // NOTE: next line also re-assign cursor, but it's very light
635 this.positionCursorTo(index);
636 this.incheck = this.vr.getCheckSquares();
637 this.emitFenIfAnalyze();
638 },
639 gotoBegin: function() {
640 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
641 this.$refs["board"].resetCurrentAttempt();
642 if (this.inMultimove) this.cancelCurrentMultimove();
643 const minCursor =
644 this.moves.length > 0 && this.moves[0].notation == "..."
645 ? 1
646 : 0;
647 while (this.cursor >= minCursor) this.undo(null, null, "light");
648 this.lastMove = (minCursor == 1 ? this.moves[0] : null);
649 this.incheck = this.vr.getCheckSquares();
650 this.emitFenIfAnalyze();
651 },
652 gotoEnd: function() {
653 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
654 this.$refs["board"].resetCurrentAttempt();
655 if (this.cursor == this.moves.length - 1) return;
656 this.gotoMove(this.moves.length - 1);
657 this.emitFenIfAnalyze();
658 },
659 flip: function() {
660 if (this.$refs["board"].choices.length > 0) return;
661 this.orientation = V.GetOppCol(this.orientation);
662 }
663 }
664 };
665 </script>
666
667 <style lang="sass" scoped>
668 [type="checkbox"]#modalEog+div .card
669 min-height: 45px
670 max-width: 350px
671
672 #baseGame
673 width: 100%
674 &:focus
675 outline: none
676
677 #gameContainer
678 margin-left: auto
679 margin-right: auto
680
681 #downloadDiv
682 display: inline-block
683
684 #controls
685 user-select: none
686 button
687 border: none
688 margin: 0
689 padding-top: 5px
690 padding-bottom: 5px
691
692 p#fenAnalyze
693 margin: 5px
694
695 .in-autoplay
696 background-color: #FACF8C
697
698 img.inline
699 height: 22px
700 padding-top: 5px
701 @media screen and (max-width: 767px)
702 height: 18px
703
704 #turnIndicator
705 text-align: center
706 font-weight: bold
707
708 #boardContainer
709 float: left
710 // TODO: later, maybe, allow movesList of variable width
711 // or e.g. between 250 and 350px (but more complicated)
712
713 #movesList
714 width: 280px
715 float: left
716
717 @media screen and (max-width: 767px)
718 #movesList
719 width: 100%
720 float: none
721 clear: both
722 </style>