X-Git-Url: https://git.auder.net/pieces/Cwda/c_white_queen.svg?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=572c80ad4e018606c79467e56c8ff48c3c1e9295;hb=af34341d92d47d14f396e7f4adb81f2a7e9d9a61;hp=433a8ac63da158a1b3947a813f56ae4cbab780b4;hpb=29bc61bed4a31df9353640a60a386f7f1ae0643b;p=vchess.git
diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue
index 433a8ac6..572c80ad 100644
--- a/client/src/components/BaseGame.vue
+++ b/client/src/components/BaseGame.vue
@@ -1,10 +1,5 @@
-div#baseGame(
- tabindex=-1
- @click="focusBg()"
- @keydown="handleKeys($event)"
- @wheel="handleScroll($event)"
-)
+div#baseGame
input#modalEog.modal(type="checkbox")
div#eogDiv(
role="dialog"
@@ -13,66 +8,53 @@ div#baseGame(
.card.text-center
label.modal-close(for="modalEog")
h3.section {{ endgameMessage }}
- input#modalAdjust.modal(type="checkbox")
- div#adjuster(
- role="dialog"
- data-checkbox="modalAdjust"
- )
- .card.text-center
- label.modal-close(for="modalAdjust")
- label(for="boardSize") {{ st.tr["Board size"] }}
- input#boardSize.slider(
- type="range"
- min="0"
- max="100"
- value="50"
- @input="adjustBoard()"
- )
#gameContainer
#boardContainer
Board(
+ ref="board"
:vr="vr"
:last-move="lastMove"
- :analyze="analyze"
+ :analyze="game.mode=='analyze'"
+ :score="game.score"
:user-color="game.mycolor"
:orientation="orientation"
:vname="game.vname"
:incheck="incheck"
@play-move="play"
+ @click-square="clickSquare"
)
- #turnIndicator(v-if="game.vname=='Dark' && game.score=='*'")
- | {{ st.tr[vr.turn + " to move"] }}
- #controls
- button(@click="gotoBegin()") <<
- button(@click="undo()") <
- button(@click="flip()") ⇅
- button(@click="play()") >
- button(@click="gotoEnd()") >>
- #belowControls
- #downloadDiv(v-if="game.vname!='Dark' || game.score!='*'")
- a#download(href="#")
- button(@click="download()") {{ st.tr["Download"] }} PGN
- button(onClick="window.doClick('modalAdjust')") ⤢
- button(
- v-if="game.vname!='Dark' && game.mode!='analyze'"
- @click="analyzePosition()"
- )
- | {{ st.tr["Analyse"] }}
- // NOTE: rather ugly hack to avoid showing twice "rules" link...
+ #turnIndicator(v-if="showTurn") {{ turn }}
+ #controls.button-group
+ button(@click="gotoBegin()")
+ img.inline(src="/images/icons/fast-forward_rev.svg")
+ button(@click="undo()")
+ img.inline(src="/images/icons/play_rev.svg")
+ button(v-if="canFlip" @click="flip()")
+ img.inline(src="/images/icons/flip.svg")
button(
- v-if="!$route.path.match('/variants/')"
- @click="showRules()"
+ @click="runAutoplay()"
+ :class="{'in-autoplay': autoplay}"
)
- | {{ st.tr["Rules"] }}
+ img.inline(src="/images/icons/autoplay.svg")
+ button(@click="play()")
+ img.inline(src="/images/icons/play.svg")
+ button(@click="gotoEnd()")
+ img.inline(src="/images/icons/fast-forward.svg")
#movesList
MoveList(
- v-if="showMoves"
+ :show="showMoves"
+ :canAnalyze="canAnalyze"
+ :canDownload="allowDownloadPGN"
:score="game.score"
:message="game.scoreMsg"
:firstNum="firstMoveNumber"
:moves="moves"
:cursor="cursor"
+ @download="download"
+ @showrules="showRules"
+ @analyze="analyzePosition"
@goto-move="gotoMove"
+ @reset-arrows="resetArrows"
)
.clearer
@@ -80,23 +62,26 @@ div#baseGame(