X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fviews%2FGame.vue;h=e0ae7e91cac2e6886e25a249a6c863dc6ad75a79;hb=aae89b49a846b2c101d74db7dff9151392d6db34;hp=5255cf43703e89ad6c5e08811813b85df09dbf9a;hpb=9ef63965401837983286ac6a95767af3923405fe;p=vchess.git
diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index 5255cf43..e0ae7e91 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -1,37 +1,110 @@
main
- input#modalChat.modal(type="checkbox" @click="resetChatColor()")
- div#chatWrap(role="dialog" data-checkbox="modalChat")
- #chat.card
+ 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")
+ 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)")
+ span.anonymous(v-if="Object.values(people).some(p => !p.name && p.id === 0)")
| + @nonymous
- Chat(:players="game.players" :pastChats="game.chats"
- :newChat="newChat" @mychat="processChat")
+ 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 }}
- button#chatBtn(onClick="doClick('modalChat')") Chat
+ 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(@click="clickDraw()" :class="{['draw-' + drawOffer]: true}")
- | {{ st.tr["Draw"] }}
- button(v-if="!!game.mycolor" @click="abortGame()") {{ st.tr["Abort"] }}
- button(v-if="!!game.mycolor" @click="resign()") {{ st.tr["Resign"] }}
+ 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=='*'") {{ virtualClocks[0] }}
+ 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=='*'") {{ virtualClocks[1] }}
- BaseGame(:game="game" :vr="vr" @newmove="processMove" @gameover="gameOver")
+ 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"
+ @gameover="gameOver"
+ )
@@ -748,9 +1124,16 @@ export default {
#actions
display: inline-block
margin: 0
- button
- display: inline-block
- margin: 0
+
+button
+ display: inline-block
+ margin: 0
+ display: inline-flex
+ img
+ height: 24px
+ display: flex
+ @media screen and (max-width: 767px)
+ height: 18px
@media screen and (max-width: 767px)
#aboveBoard
@@ -766,26 +1149,48 @@ export default {
font-weight: bold
padding-right: 10px
-.name
+span#nextGame
+ background-color: #edda99
+ cursor: pointer
+ display: inline-block
+ margin-right: 10px
+
+span.name
font-size: 1.5rem
- padding: 1px
+ padding: 0 3px
-.time
+span.time
font-size: 2rem
display: inline-block
- margin-left: 10px
+ .time-left
+ margin-left: 10px
+ .time-right
+ margin-left: 5px
+ .time-separator
+ margin-left: 5px
+ position: relative
+ top: -1px
+
+span.yourturn
+ color: #831B1B
+ .time-separator
+ animation: blink-animation 2s steps(3, start) infinite
+@keyframes blink-animation
+ to
+ visibility: hidden
.split-names
display: inline-block
margin: 0 15px
-#chat
+#chatWrap > .card
padding-top: 20px
max-width: 767px
- border: none;
+ border: none
-#chatBtn
- margin: 0 10px 0 0
+#confirmDiv > .card
+ max-width: 767px
+ max-height: 100%
.draw-sent, .draw-sent:hover
background-color: lightyellow
@@ -798,4 +1203,21 @@ export default {
.somethingnew
background-color: #c5fefe
+
+.diagram
+ margin: 0 auto
+ max-width: 400px
+ // width: 100% required for Firefox
+ width: 100%
+
+#buttonsConfirm
+ margin: 0
+ & > button > span
+ width: 100%
+ text-align: center
+
+button.acceptBtn
+ background-color: lightgreen
+button.refuseBtn
+ background-color: red