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