X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fviews%2FGame.vue;h=214f81964582264d6c57ad072bc1241df2bd1146;hb=620a88ede2ad25e66d9cbb521388ee53e4a564c0;hp=5255cf43703e89ad6c5e08811813b85df09dbf9a;hpb=9ef63965401837983286ac6a95767af3923405fe;p=vchess.git
diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index 5255cf43..214f8196 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -1,37 +1,97 @@
main
- input#modalChat.modal(type="checkbox" @click="resetChatColor()")
- div#chatWrap(role="dialog" data-checkbox="modalChat")
+ input#modalChat.modal(
+ type="checkbox"
+ @click="resetChatColor()"
+ )
+ div#chatWrap(
+ role="dialog"
+ data-checkbox="modalChat"
+ )
#chat.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(
+ :players="game.players"
+ :pastChats="game.chats"
+ :newChat="newChat"
+ @mychat="processChat"
+ @chatcleared="clearChat"
+ )
.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 +1002,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,14 +1027,35 @@ 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
@@ -784,9 +1066,6 @@ export default {
max-width: 767px
border: none;
-#chatBtn
- margin: 0 10px 0 0
-
.draw-sent, .draw-sent:hover
background-color: lightyellow