X-Git-Url: https://git.auder.net/pieces/Checkered/cq.svg?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=7f1bd407bcb57779c0c6c1bc9620f014433383b5;hb=e57c4de4148d43e7635e09adcde4e56585aea303;hp=6146e2705d06a099c866a4206eff31311161ad1f;hpb=7f3484bd3530cd9f656e215d2d4d832d98bf5906;p=vchess.git
diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index 6146e270..7f1bd407 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -1,16 +1,109 @@
-.row
- .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
- BaseGame(:game="game" :vr="vr" ref="basegame"
- @newmove="processMove" @gameover="gameOver")
- div Names: {{ game.players[0].name }} - {{ game.players[1].name }}
- div(v-if="game.score=='*'") 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
- textarea(v-if="game.score=='*'" v-model="corrMsg")
- Chat(:players="game.players")
+main
+ input#modalChat.modal(
+ type="checkbox"
+ @click="resetChatColor()"
+ )
+ div#chatWrap(
+ role="dialog"
+ data-checkbox="modalChat"
+ )
+ .card
+ label.modal-close(for="modalChat")
+ #participants
+ span {{ Object.keys(people).length + " " + st.tr["participant(s):"] }}
+ span(
+ v-for="p in Object.values(people)"
+ v-if="p.name"
+ )
+ | {{ p.name }}
+ span.anonymous(v-if="Object.values(people).some(p => !p.name && p.id === 0)")
+ | + @nonymous
+ Chat(
+ ref="chatcomp"
+ :players="game.players"
+ :pastChats="game.chats"
+ :newChat="newChat"
+ @mychat="processChat"
+ @chatcleared="clearChat"
+ )
+ input#modalConfirm.modal(type="checkbox")
+ div#confirmDiv(role="dialog")
+ .card
+ .diagram(v-html="curDiag")
+ .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.col-md-9.col-md-offset-3.col-lg-10.col-lg-offset-2
+ span.variant-cadence {{ game.cadence }}
+ span.variant-name {{ game.vname }}
+ span#nextGame(
+ v-if="nextIds.length > 0"
+ @click="showNextGame()"
+ )
+ | {{ st.tr["Next_g"] }}
+ button#chatBtn.tooltip(
+ onClick="window.doClick('modalChat')"
+ aria-label="Chat"
+ )
+ img(src="/images/icons/chat.svg")
+ #actions(v-if="game.score=='*'")
+ button.tooltip(
+ @click="clickDraw()"
+ :class="{['draw-' + drawOffer]: true}"
+ :aria-label="st.tr['Draw']"
+ )
+ img(src="/images/icons/draw.svg")
+ button.tooltip(
+ v-if="!!game.mycolor"
+ @click="abortGame()"
+ :aria-label="st.tr['Abort']"
+ )
+ img(src="/images/icons/abort.svg")
+ button.tooltip(
+ v-if="!!game.mycolor"
+ @click="resign()"
+ :aria-label="st.tr['Resign']"
+ )
+ img(src="/images/icons/resign.svg")
+ button.tooltip(
+ v-else-if="!!game.mycolor"
+ @click="rematch()"
+ :aria-label="st.tr['Rematch']"
+ )
+ img(src="/images/icons/rematch.svg")
+ #playersInfo
+ p
+ 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] }}
+ BaseGame(
+ ref="basegame"
+ :game="game"
+ @newmove="processMove"
+ )
-