X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=d920053aa5cb1e476d1f20278137d36b185d82d6;hb=afde76668963c4d0d96002fcae2ebabb9acf81e4;hp=b7cc1fc08ef1ccb72852b9f926b331d8df1101a4;hpb=a154d45ebb7e409cd714d0c517e79c8147bdea69;p=vchess.git
diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index b7cc1fc0..d920053a 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -1,37 +1,119 @@
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 {{ st.tr["Participant(s):"] }}
+ span(
+ v-for="p in Object.values(people)"
+ v-if="p.focus && !!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.focus && !p.name)"
+ )
| + @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-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.col-md-9.col-md-offset-3.col-lg-10.col-lg-offset-2
- span.variant-info {{ game.vname }}
- button#chatBtn(onClick="doClick('modalChat')") Chat
+ 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(@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" ref="basegame"
- @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"
+ )
@@ -698,6 +1247,9 @@ export default {
color: grey
font-style: italic
+#playersInfo > p
+ margin: 0
+
@media screen and (min-width: 768px)
#actions
width: 300px
@@ -707,10 +1259,17 @@ export default {
#actions
display: inline-block
- margin-top: 10px
- button
- display: inline-block
- margin: 0
+ 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
@@ -719,30 +1278,55 @@ export default {
#aboveBoard
margin-left: 30%
-.variant-info
+.variant-cadence
+ padding-right: 10px
+
+.variant-name
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
@@ -752,4 +1336,22 @@ export default {
.draw-threerep, .draw-threerep:hover
background-color: #e4d1fc
+
+.somethingnew
+ background-color: #c5fefe
+
+.diagram
+ margin: 0 auto
+ width: 100%
+
+#buttonsConfirm
+ margin: 0
+ & > button > span
+ width: 100%
+ text-align: center
+
+button.acceptBtn
+ background-color: lightgreen
+button.refuseBtn
+ background-color: red