e99c194e81d38d2a44a44c3c77e07e04d69a63dc
[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 const parsedFen = V.ParseFen(game.fenStart);
216 const firstMoveColor = parsedFen.turn;
217 this.firstMoveNumber = Math.floor(parsedFen.movesCount / 2) + 1;
218 let L = this.moves.length;
219 if (L == 0) {
220 this.incheck = [];
221 this.score = "*";
222 }
223 this.moves.forEach((move,idx) => {
224 // Strategy working also for multi-moves:
225 if (!Array.isArray(move)) move = [move];
226 const Lm = move.length;
227 move.forEach((m,idxM) => {
228 m.notation = this.vr.getNotation(m);
229 m.unambiguous = V.GetUnambiguousNotation(m);
230 this.vr.play(m);
231 const checkSquares = this.vr.getCheckSquares();
232 if (checkSquares.length > 0) m.notation += "+";
233 if (idxM == Lm - 1) m.fen = this.vr.getFen();
234 if (idx == L - 1 && idxM == Lm - 1) {
235 this.incheck = checkSquares;
236 this.score = this.vr.getCurrentScore();
237 if (["1-0", "0-1"].includes(this.score)) m.notation += "#";
238 }
239 });
240 });
241 if (firstMoveColor == "b") {
242 // 'start' & 'end' is required for Board component
243 this.moves.unshift({
244 notation: "...",
245 unambiguous: "...",
246 start: { x: -1, y: -1 },
247 end: { x: -1, y: -1 },
248 fen: game.fenStart
249 });
250 L++;
251 }
252 this.positionCursorTo(L - 1);
253 },
254 positionCursorTo: function(index) {
255 this.cursor = index;
256 // Note: last move in moves array might be a multi-move
257 if (index >= 0) this.lastMove = this.moves[index];
258 else this.lastMove = null;
259 },
260 toggleAnalyze: function() {
261 // Freeze while choices are shown (and autoplay has priority)
262 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
263 if (this.mode != "analyze") {
264 // Enter analyze mode:
265 if (this.inMultimove) this.cancelCurrentMultimove();
266 this.gameMode = this.mode; //was not 'analyze'
267 this.mode = "analyze";
268 this.gameCursor = this.cursor;
269 this.gameMoves = JSON.parse(JSON.stringify(this.moves));
270 document.getElementById("analyzeBtn").classList.add("active");
271 }
272 else {
273 // Exit analyze mode:
274 this.mode = this.gameMode ;
275 this.cursor = this.gameCursor;
276 this.moves = this.gameMoves;
277 let fen = this.game.fenStart;
278 if (this.cursor >= 0) {
279 let mv = this.moves[this.cursor];
280 if (!Array.isArray(mv)) mv = [mv];
281 fen = mv[mv.length-1].fen;
282 }
283 this.vr = new V(fen);
284 this.inMultimove = false; //in case of
285 this.$refs["board"].resetCurrentAttempt(); //also in case of
286 this.incheck = this.vr.getCheckSquares();
287 if (this.cursor >= 0) this.lastMove = this.moves[this.cursor];
288 else this.lastMove = null;
289 document.getElementById("analyzeBtn").classList.remove("active");
290 }
291 },
292 download: function() {
293 const content = this.getPgn();
294 // Prepare and trigger download link
295 let downloadAnchor = document.getElementById("download");
296 downloadAnchor.setAttribute("download", "game.pgn");
297 downloadAnchor.href =
298 "data:text/plain;charset=utf-8," + encodeURIComponent(content);
299 downloadAnchor.click();
300 },
301 getPgn: function() {
302 let pgn = "";
303 pgn += '[Site "vchess.club"]\n';
304 pgn += '[Variant "' + this.game.vname + '"]\n';
305 const gdt = getDate(new Date(this.game.created || Date.now()));
306 pgn += '[Date "' + gdt + '"]\n';
307 pgn += '[White "' + this.game.players[0].name + '"]\n';
308 pgn += '[Black "' + this.game.players[1].name + '"]\n';
309 pgn += '[Fen "' + this.game.fenStart + '"]\n';
310 pgn += '[Result "' + this.game.score + '"]\n';
311 if (!!this.game.id)
312 pgn += '[Url "' + params.serverUrl + '/game/' + this.game.id + '"]\n';
313 if (!!this.game.cadence)
314 pgn += '[Cadence "' + this.game.cadence + '"]\n';
315 pgn += '\n';
316 for (let i = 0; i < this.moves.length; i += 2) {
317 if (i > 0) pgn += " ";
318 // Adjust dots notation for a better display:
319 let fullNotation = getFullNotation(this.moves[i]);
320 if (fullNotation == "...") fullNotation = "..";
321 pgn += (i / 2 + this.firstMoveNumber) + "." + fullNotation;
322 if (i+1 < this.moves.length)
323 pgn += " " + getFullNotation(this.moves[i+1]);
324 }
325 pgn += "\n\n";
326 for (let i = 0; i < this.moves.length; i += 2) {
327 const moveNumber = i / 2 + this.firstMoveNumber;
328 // Skip "dots move", useless for machine reading:
329 if (this.moves[i].notation != "...") {
330 pgn += moveNumber + ".w " +
331 getFullNotation(this.moves[i], "unambiguous") + "\n";
332 }
333 if (i+1 < this.moves.length) {
334 pgn += moveNumber + ".b " +
335 getFullNotation(this.moves[i+1], "unambiguous") + "\n";
336 }
337 }
338 return pgn;
339 },
340 showEndgameMsg: function(message) {
341 this.endgameMessage = message;
342 document.getElementById("modalEog").checked = true;
343 },
344 runAutoplay: function() {
345 if (this.autoplay) {
346 this.autoplay = false;
347 if (this.stackToPlay.length > 0)
348 // Move(s) arrived in-between
349 this.play(this.stackToPlay.pop(), "received");
350 }
351 else if (this.cursor < this.moves.length - 1) {
352 this.autoplay = true;
353 this.play(null, null, null, "autoplay");
354 }
355 },
356 // Animate an elementary move
357 animateMove: function(move, callback) {
358 let startSquare = document.getElementById(getSquareId(move.start));
359 if (!startSquare) return; //shouldn't happen but...
360 let endSquare = document.getElementById(getSquareId(move.end));
361 let rectStart = startSquare.getBoundingClientRect();
362 let rectEnd = endSquare.getBoundingClientRect();
363 let translation = {
364 x: rectEnd.x - rectStart.x,
365 y: rectEnd.y - rectStart.y
366 };
367 let movingPiece = document.querySelector(
368 "#" + getSquareId(move.start) + " > img.piece"
369 );
370 // For some unknown reasons Opera get "movingPiece == null" error
371 // TODO: is it calling 'animate()' twice ? One extra time ?
372 if (!movingPiece) return;
373 const squares = document.getElementsByClassName("board");
374 for (let i = 0; i < squares.length; i++) {
375 let square = squares.item(i);
376 if (square.id != getSquareId(move.start))
377 // HACK for animation:
378 // (with positive translate, image slides "under background")
379 square.style.zIndex = "-1";
380 }
381 movingPiece.style.transform =
382 "translate(" + translation.x + "px," + translation.y + "px)";
383 movingPiece.style.transitionDuration = "0.25s";
384 movingPiece.style.zIndex = "3000";
385 setTimeout(() => {
386 for (let i = 0; i < squares.length; i++)
387 squares.item(i).style.zIndex = "auto";
388 movingPiece.style = {}; //required e.g. for 0-0 with KR swap
389 callback();
390 }, 250);
391 },
392 // For Analyse mode:
393 emitFenIfAnalyze: function() {
394 if (this.game.mode == "analyze") {
395 let fen = this.game.fenStart;
396 if (!!this.lastMove) {
397 if (Array.isArray(this.lastMove)) {
398 const L = this.lastMove.length;
399 fen = this.lastMove[L-1].fen;
400 }
401 else fen = this.lastMove.fen;
402 }
403 this.$emit("fenchange", fen);
404 }
405 },
406 clickSquare: function(square) {
407 // Some variants make use of a single click at specific times:
408 const move = this.vr.doClick(square);
409 if (!!move) this.play(move);
410 },
411 // "light": if gotoMove() or gotoEnd()
412 play: function(move, received, light, autoplay) {
413 // Freeze while choices are shown:
414 if (this.$refs["board"].choices.length > 0) return;
415 const navigate = !move;
416 // Forbid navigation during autoplay:
417 if (navigate && this.autoplay && !autoplay) return;
418 // Forbid playing outside analyze mode, except if move is received.
419 // Sufficient condition because Board already knows which turn it is.
420 if (
421 this.mode != "analyze" &&
422 !navigate &&
423 !received &&
424 (this.game.score != "*" || this.cursor < this.moves.length - 1)
425 ) {
426 return;
427 }
428 if (!!received) {
429 if (this.autoplay || this.inPlay) {
430 // Received moves while autoplaying are stacked,
431 // and in observed games they could arrive too fast:
432 this.stackToPlay.unshift(move);
433 return;
434 }
435 this.inPlay = true;
436 if (this.mode == "analyze") this.toggleAnalyze();
437 if (this.cursor < this.moves.length - 1)
438 // To play a received move, cursor must be at the end of the game:
439 this.gotoEnd();
440 }
441 // The board may show some the possible moves: (TODO: bad solution)
442 this.$refs["board"].resetCurrentAttempt();
443 const playSubmove = (smove) => {
444 smove.notation = this.vr.getNotation(smove);
445 smove.unambiguous = V.GetUnambiguousNotation(smove);
446 this.vr.play(smove);
447 if (this.inMultimove && !!this.lastMove) {
448 if (!Array.isArray(this.lastMove))
449 this.lastMove = [this.lastMove, smove];
450 else this.lastMove.push(smove);
451 }
452 // Is opponent (or me) in check?
453 this.incheck = this.vr.getCheckSquares();
454 if (this.incheck.length > 0) smove.notation += "+";
455 if (!this.inMultimove) {
456 // First sub-move:
457 this.lastMove = smove;
458 // Condition is "!navigate" but we mean "!this.autoplay"
459 if (!navigate) {
460 if (this.cursor < this.moves.length - 1)
461 this.moves = this.moves.slice(0, this.cursor + 1);
462 this.moves.push(smove);
463 }
464 this.inMultimove = true; //potentially
465 this.cursor++;
466 } else if (!navigate) {
467 // Already in the middle of a multi-move
468 const L = this.moves.length;
469 if (!Array.isArray(this.moves[L-1]))
470 this.$set(this.moves, L-1, [this.moves[L-1], smove]);
471 else this.moves[L-1].push(smove);
472 }
473 };
474 const playMove = () => {
475 const animate = (
476 ["all", "highlight"].includes(V.ShowMoves) &&
477 (this.autoplay || !!received)
478 );
479 if (!Array.isArray(move)) move = [move];
480 let moveIdx = 0;
481 let self = this;
482 const initurn = this.vr.turn;
483 (function executeMove() {
484 const smove = move[moveIdx++];
485 // NOTE: condition "smove.start.x >= 0" required for Dynamo,
486 // because second move may be empty.
487 if (animate && smove.start.x >= 0) {
488 self.animateMove(smove, () => {
489 playSubmove(smove);
490 if (moveIdx < move.length) setTimeout(executeMove, 500);
491 else afterMove(smove, initurn);
492 });
493 } else {
494 playSubmove(smove);
495 if (moveIdx < move.length) executeMove();
496 else afterMove(smove, initurn);
497 }
498 })();
499 };
500 const computeScore = () => {
501 const score = this.vr.getCurrentScore();
502 if (!navigate) {
503 if (["1-0", "0-1"].includes(score)) {
504 if (Array.isArray(this.lastMove)) {
505 const L = this.lastMove.length;
506 this.lastMove[L - 1].notation += "#";
507 }
508 else this.lastMove.notation += "#";
509 }
510 }
511 if (score != "*" && ["analyze", "versus"].includes(this.mode)) {
512 const message = getScoreMessage(score);
513 // Show score on screen
514 this.showEndgameMsg(score + " . " + this.st.tr[message]);
515 }
516 return score;
517 };
518 const afterMove = (smove, initurn) => {
519 if (this.vr.turn != initurn) {
520 // Turn has changed: move is complete
521 if (!smove.fen)
522 // NOTE: only FEN of last sub-move is required (=> setting it here)
523 smove.fen = this.vr.getFen();
524 this.emitFenIfAnalyze();
525 this.inMultimove = false;
526 this.score = computeScore();
527 if (this.autoplay) {
528 if (this.cursor < this.moves.length - 1)
529 setTimeout(() => this.play(null, null, null, "autoplay"), 1000);
530 else {
531 this.autoplay = false;
532 if (this.stackToPlay.length > 0)
533 // Move(s) arrived in-between
534 this.play(this.stackToPlay.pop(), "received");
535 }
536 }
537 if (this.mode != "analyze" && !navigate) {
538 if (!received) {
539 // Post-processing (e.g. computer play).
540 const L = this.moves.length;
541 // NOTE: always emit the score, even in unfinished
542 this.$emit("newmove", this.moves[L-1], { score: this.score });
543 } else {
544 this.inPlay = false;
545 if (this.stackToPlay.length > 0)
546 // Move(s) arrived in-between
547 this.play(this.stackToPlay.pop(), "received");
548 }
549 }
550 }
551 };
552 // NOTE: navigate and received are mutually exclusive
553 if (navigate) {
554 // The move to navigate to is necessarily full:
555 if (this.cursor == this.moves.length - 1) return; //no more moves
556 move = this.moves[this.cursor + 1];
557 if (!this.autoplay) {
558 // Just play the move:
559 if (!Array.isArray(move)) move = [move];
560 for (let i=0; i < move.length; i++) this.vr.play(move[i]);
561 if (!light) {
562 this.lastMove = move;
563 this.incheck = this.vr.getCheckSquares();
564 this.score = computeScore();
565 this.emitFenIfAnalyze();
566 }
567 this.cursor++;
568 return;
569 }
570 }
571 playMove();
572 },
573 cancelCurrentMultimove: function() {
574 const L = this.moves.length;
575 let move = this.moves[L-1];
576 if (!Array.isArray(move)) move = [move];
577 for (let i = move.length - 1; i >= 0; i--) this.vr.undo(move[i]);
578 this.moves.pop();
579 this.cursor--;
580 this.inMultimove = false;
581 },
582 cancelLastMove: function() {
583 // The last played move was canceled (corr game)
584 this.undo();
585 this.moves.pop();
586 },
587 // "light": if gotoMove() or gotoBegin()
588 undo: function(move, light) {
589 // Freeze while choices are shown:
590 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
591 this.$refs["board"].resetCurrentAttempt();
592 if (this.inMultimove) {
593 this.cancelCurrentMultimove();
594 this.incheck = this.vr.getCheckSquares();
595 if (this.cursor >= 0) this.lastMove = this.moves[this.cursor];
596 else this.lastMove = null;
597 } else {
598 if (!move) {
599 const minCursor =
600 this.moves.length > 0 && this.moves[0].notation == "..."
601 ? 1
602 : 0;
603 if (this.cursor < minCursor) return; //no more moves
604 move = this.moves[this.cursor];
605 }
606 this.$refs["board"].resetCurrentAttempt();
607 undoMove(move, this.vr);
608 if (light) this.cursor--;
609 else {
610 this.positionCursorTo(this.cursor - 1);
611 this.incheck = this.vr.getCheckSquares();
612 this.emitFenIfAnalyze();
613 }
614 }
615 },
616 gotoMove: function(index) {
617 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
618 this.$refs["board"].resetCurrentAttempt();
619 if (this.inMultimove) this.cancelCurrentMultimove();
620 if (index == this.cursor) return;
621 if (index < this.cursor) {
622 while (this.cursor > index)
623 this.undo(null, null, "light");
624 }
625 else {
626 // index > this.cursor)
627 while (this.cursor < index)
628 this.play(null, null, "light");
629 }
630 // NOTE: next line also re-assign cursor, but it's very light
631 this.positionCursorTo(index);
632 this.incheck = this.vr.getCheckSquares();
633 this.emitFenIfAnalyze();
634 },
635 gotoBegin: function() {
636 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
637 this.$refs["board"].resetCurrentAttempt();
638 if (this.inMultimove) this.cancelCurrentMultimove();
639 const minCursor =
640 this.moves.length > 0 && this.moves[0].notation == "..."
641 ? 1
642 : 0;
643 while (this.cursor >= minCursor) this.undo(null, null, "light");
644 this.lastMove = (minCursor == 1 ? this.moves[0] : null);
645 this.incheck = this.vr.getCheckSquares();
646 this.emitFenIfAnalyze();
647 },
648 gotoEnd: function() {
649 if (this.$refs["board"].choices.length > 0 || this.autoplay) return;
650 this.$refs["board"].resetCurrentAttempt();
651 if (this.cursor == this.moves.length - 1) return;
652 this.gotoMove(this.moves.length - 1);
653 this.emitFenIfAnalyze();
654 },
655 flip: function() {
656 if (this.$refs["board"].choices.length > 0) return;
657 this.orientation = V.GetOppCol(this.orientation);
658 }
659 }
660 };
661 </script>
662
663 <style lang="sass" scoped>
664 [type="checkbox"]#modalEog+div .card
665 min-height: 45px
666 max-width: 350px
667
668 #baseGame
669 width: 100%
670 &:focus
671 outline: none
672
673 #gameContainer
674 margin-left: auto
675 margin-right: auto
676
677 #downloadDiv
678 display: inline-block
679
680 #controls
681 user-select: none
682 button
683 border: none
684 margin: 0
685 padding-top: 5px
686 padding-bottom: 5px
687
688 p#fenAnalyze
689 margin: 5px
690
691 .in-autoplay
692 background-color: #FACF8C
693
694 img.inline
695 height: 22px
696 padding-top: 5px
697 @media screen and (max-width: 767px)
698 height: 18px
699
700 #turnIndicator
701 text-align: center
702 font-weight: bold
703
704 #boardContainer
705 float: left
706 // TODO: later, maybe, allow movesList of variable width
707 // or e.g. between 250 and 350px (but more complicated)
708
709 #movesList
710 width: 280px
711 float: left
712
713 @media screen and (max-width: 767px)
714 #movesList
715 width: 100%
716 float: none
717 clear: both
718 </style>