X-Git-Url: https://git.auder.net/pieces/Checkered/cq.svg?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=62fae75349d5cad0adc25ec1a870dcd076ba50bf;hb=5246b49d18b711fb26ee27919ab392be24b80fba;hp=45364053e944d23d82daeb5b1e9a018227d6708b;hpb=9ddaf8da8743c50b9019888a82d84392913c60c9;p=vchess.git
diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue
index 45364053..62fae753 100644
--- a/client/src/components/BaseGame.vue
+++ b/client/src/components/BaseGame.vue
@@ -1,168 +1,183 @@
-div#baseGame(tabindex=-1 @click="focusBg()"
- @keydown="handleKeys" @wheel="handleScroll")
+div#baseGame
input#modalEog.modal(type="checkbox")
- div#eogDiv(role="dialog" data-checkbox="modalEog" aria-labelledby="eogMessage")
- .card.smallpad.small-modal.text-center
+ div#eogDiv(
+ role="dialog"
+ data-checkbox="modalEog"
+ )
+ .card.text-center
label.modal-close(for="modalEog")
- h3#eogMessage.section {{ endgameMessage }}
- input#modalAdjust.modal(type="checkbox")
- div#adjuster(role="dialog" data-checkbox="modalAdjust" aria-labelledby="labelAdjust")
- .card.smallpad.small-modal.text-center
- label.modal-close(for="modalAdjust")
- label#labelAdjust(for="boardSize") {{ st.tr["Board size"] }}
- input#boardSize.slider(type="range" min="0" max="100" value="50"
- @input="adjustBoard")
+ h3.section {{ endgameMessage }}
#gameContainer
#boardContainer
- Board(:vr="vr" :last-move="lastMove" :analyze="analyze"
- :user-color="game.mycolor" :orientation="orientation"
- :vname="game.vname" :incheck="incheck" @play-move="play")
- #turnIndicator(v-if="game.vname=='Dark' && game.score=='*'")
- | {{ turn }}
- #controls
- button(@click="gotoBegin()") <<
- button(@click="undo()") <
- button(@click="flip()") ⇅
- button(@click="play()") >
- button(@click="gotoEnd()") >>
- #pgnDiv
- #downloadDiv(v-if="game.vname!='Dark' || game.score!='*'")
- a#download(href="#")
- button(@click="download()") {{ st.tr["Download"] }} PGN
- button(onClick="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...
- button(v-if="!$route.path.match('/variants/')" @click="showRules()")
- | {{ st.tr["Rules"] }}
+ Board(
+ ref="board"
+ :vr="vr"
+ :last-move="lastMove"
+ :analyze="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="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(
+ @click="runAutoplay()"
+ :class="{'in-autoplay': autoplay}"
+ )
+ 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")
+ p#fenAnalyze(v-show="showFen") {{ (!!vr ? vr.getFen() : "") }}
#movesList
- MoveList(v-if="showMoves" :score="game.score" :message="game.scoreMsg"
- :firstNum="firstMoveNumber" :moves="moves" :cursor="cursor"
- @goto-move="gotoMove")
+ MoveList(
+ :show="showMoves"
+ :canAnalyze="canAnalyze"
+ :canDownload="allowDownloadPGN"
+ :score="game.score"
+ :message="game.scoreMsg"
+ :firstNum="firstMoveNumber"
+ :moves="moves"
+ :cursor="cursor"
+ @download="download"
+ @showrules="showRules"
+ @analyze="toggleAnalyze"
+ @goto-move="gotoMove"
+ @reset-arrows="resetArrows"
+ )
.clearer