X-Git-Url: https://git.auder.net/doc/current/git-logo.png?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=d15e307ee70621f3730cd67d3d7ebdfef121841f;hb=ad030c7d24804fbfa06158e93d89a3f101d2c8b3;hp=ea5ea36549b5bcda9215bc6b7f6dbe8aef7cfbc0;hpb=a36a09c039d2abaa130c7daddd865009f1456bf7;p=vchess.git
diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index ea5ea365..0735b76b 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -1,381 +1,1785 @@
-.row
- .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
- input#modalAbort.modal(type="checkbox")
- div(role="dialog" aria-labelledby="abortBoxTitle")
- .card.smallpad.small-modal.text-center
- label.modal-close(for="modalAbort")
- h3#abortBoxTitle.section {{ st.tr["Terminate game?"] }}
- button(@click="abortGame") {{ st.tr["Sorry I have to go"] }}
- button(@click="abortGame") {{ st.tr["Game seems over"] }}
- button(@click="abortGame") {{ st.tr["Game is too boring"] }}
- BaseGame(:game="game" :vr="vr" ref="basegame"
- @newmove="processMove" @gameover="gameOver")
- // TODO: also show players names
- div Time: {{ virtualClocks[0] }} - {{ virtualClocks[1] }}
- .button-group(v-if="game.mode!='analyze' && game.score=='*'")
- button(@click="offerDraw") Draw
- button(@click="() => abortGame()") Abort
- button(@click="resign") Resign
- div(v-if="game.mode=='corr'")
- textarea(v-show="score=='*' && vr.turn==game.mycolor" v-model="corrMsg")
- div(v-show="cursor>=0") {{ moves[cursor].message }}
+main
+ input#modalRules.modal(type="checkbox")
+ div#rulesDiv(
+ role="dialog"
+ data-checkbox="modalRules"
+ )
+ .card
+ label.modal-close(for="modalRules")
+ a#variantNameInGame(:href="'/#/variants/'+game.vname") {{ game.vname }}
+ div(v-html="rulesContent")
+ input#modalScore.modal(type="checkbox")
+ div#scoreDiv(
+ role="dialog"
+ data-checkbox="modalScore"
+ )
+ .card.text-center
+ label.modal-close(for="modalScore")
+ p.score-section
+ span.score {{ game.score }}
+ | :
+ span.score-msg {{ st.tr[game.scoreMsg] }}
+ input#modalRematch.modal(type="checkbox")
+ div#rematchDiv(
+ role="dialog"
+ data-checkbox="modalRematch"
+ )
+ .card.text-center
+ label.modal-close(for="modalRematch")
+ a(
+ :href="'#/game/' + rematchId"
+ onClick="document.getElementById('modalRematch').checked=false"
+ )
+ | {{ st.tr["Rematch in progress"] }}
+ input#modalChat.modal(
+ type="checkbox"
+ @click="toggleChat()"
+ )
+ div#chatWrap(
+ role="dialog"
+ data-checkbox="modalChat"
+ )
+ .card
+ label.modal-close(for="modalChat")
+ #participants
+ span {{ st.tr["Participant(s):"] }}
+ span(
+ v-for="p in Object.values(people)"
+ v-if="participateInChat(p)"
+ )
+ | {{ p.name }}
+ span.anonymous(v-if="someAnonymousPresent()") + @nonymous
+ Chat(
+ ref="chatcomp"
+ :players="game.players"
+ :pastChats="game.chats"
+ @mychat="processChat"
+ @chatcleared="clearChat"
+ )
+ input#modalConfirm.modal(type="checkbox")
+ div#confirmDiv(role="dialog")
+ .card
+ .diagram(
+ v-if="!!vr && ['all','byrow'].includes(vr.showMoves)"
+ v-html="curDiag"
+ )
+ p.text-center(v-else)
+ span {{ st.tr["Move played:"] + " " }}
+ span.bold {{ moveNotation }}
+ br
+ span {{ st.tr["Are you sure?"] }}
+ .button-group#buttonsConfirm
+ // onClick for acceptBtn: set dynamically
+ button.acceptBtn
+ span {{ st.tr["Validate"] }}
+ button.refuseBtn(@click="cancelMove()")
+ span {{ st.tr["Cancel"] }}
+ .row
+ #aboveBoard.col-sm-12
+ span.variant-cadence(v-if="game.type!='import'") {{ game.cadence }}
+ span.variant-name {{ game.vname }}
+ span#nextGame(
+ v-if="nextIds.length > 0"
+ @click="showNextGame()"
+ )
+ | {{ st.tr["Next_g"] }}
+ button#chatBtn(
+ :class="btnTooltipClass()"
+ onClick="window.doClick('modalChat')"
+ aria-label="Chat"
+ )
+ img(src="/images/icons/chat.svg")
+ #actions(v-if="game.score=='*'")
+ button(
+ @click="clickDraw()"
+ :class="btnTooltipClass('draw')"
+ :aria-label="st.tr['Draw']"
+ )
+ img(src="/images/icons/draw.svg")
+ button(
+ v-if="!!game.mycolor"
+ :class="btnTooltipClass()"
+ @click="abortGame()"
+ :aria-label="st.tr['Abort']"
+ )
+ img(src="/images/icons/abort.svg")
+ button(
+ v-if="!!game.mycolor"
+ :class="btnTooltipClass()"
+ @click="resign()"
+ :aria-label="st.tr['Resign']"
+ )
+ img(src="/images/icons/resign.svg")
+ button(
+ v-else
+ :class="btnTooltipClass('rematch')"
+ @click="clickRematch()"
+ :aria-label="st.tr['Rematch']"
+ )
+ img(src="/images/icons/rematch.svg")
+ #playersInfo
+ div(v-if="isLargeScreen()")
+ span.name(:class="{connected: isConnected(0)}")
+ | {{ game.players[0].name || "@nonymous" }}
+ span.time(
+ v-if="game.score=='*'"
+ :class="{yourturn: !!vr && vr.turn == 'w'}"
+ )
+ span.time-left {{ virtualClocks[0][0] }}
+ span.time-separator(v-if="!!virtualClocks[0][1]") :
+ span.time-right(v-if="!!virtualClocks[0][1]")
+ | {{ virtualClocks[0][1] }}
+ span.split-names -
+ span.name(:class="{connected: isConnected(1)}")
+ | {{ game.players[1].name || "@nonymous" }}
+ span.time(
+ v-if="game.score=='*'"
+ :class="{yourturn: !!vr && vr.turn == 'b'}"
+ )
+ span.time-left {{ virtualClocks[1][0] }}
+ span.time-separator(v-if="!!virtualClocks[1][1]") :
+ span.time-right(v-if="!!virtualClocks[1][1]")
+ | {{ virtualClocks[1][1] }}
+ div(v-else)
+ span.name(:class="{connected: isConnected(0)}")
+ | {{ game.players[0].name || "@nonymous" }}
+ span.split-names -
+ span.name(:class="{connected: isConnected(1)}")
+ | {{ game.players[1].name || "@nonymous" }}
+ div(v-if="game.score=='*'")
+ span.time(:class="{yourturn: !!vr && vr.turn == 'w'}")
+ span.time-left {{ virtualClocks[0][0] }}
+ span.time-separator(v-if="!!virtualClocks[0][1]") :
+ span.time-right(v-if="!!virtualClocks[0][1]")
+ | {{ virtualClocks[0][1] }}
+ span.separator
+ span.time(:class="{yourturn: !!vr && vr.turn == 'b'}")
+ span.time-left {{ virtualClocks[1][0] }}
+ span.time-separator(v-if="!!virtualClocks[1][1]") :
+ span.time-right(v-if="!!virtualClocks[1][1]")
+ | {{ virtualClocks[1][1] }}
+ BaseGame(
+ ref="basegame"
+ :game="game"
+ @newmove="processMove"
+ )
-
-
+
+
+
+