.card.smallpad.small-modal.text-center
label.modal-close(for="modalEog")
h3#eogMessage.section {{ endgameMessage }}
- .row
- .col-sm-12.col-md-9
- #boardContainer
- Board(:vr="vr" :last-move="lastMove" :analyze="game.mode=='analyze'"
- :user-color="game.mycolor" :orientation="orientation"
- :vname="game.vname" @play-move="play")
- #controls
- button(@click="gotoBegin") <<
- button(@click="() => undo()") <
- button(@click="flip") ⇅
- button(@click="() => play()") >
- button(@click="gotoEnd") >>
- #pgnDiv
- a#download(href="#")
- button(@click="download") {{ st.tr["Download PGN"] }}
- button(v-if="game.mode!='analyze'" @click="analyzePosition")
- | {{ st.tr["Analyze"] }}
- .col-sm-12.col-md-3
+ #gameContainer
+ #boardContainer
+ Board(:vr="vr" :last-move="lastMove" :analyze="game.mode=='analyze'"
+ :user-color="game.mycolor" :orientation="orientation"
+ :vname="game.vname" @play-move="play")
+ #controls
+ button(@click="gotoBegin") <<
+ button(@click="() => undo()") <
+ button(@click="flip") ⇅
+ button(@click="() => play()") >
+ button(@click="gotoEnd") >>
+ #pgnDiv
+ a#download(href="#")
+ button(@click="download") {{ st.tr["Download PGN"] }}
+ button(v-if="game.mode!='analyze'" @click="analyzePosition")
+ | {{ st.tr["Analyze"] }}
+ #movesList
MoveList(v-if="showMoves" :score="game.score" :message="game.scoreMsg"
:firstNum="firstMoveNumber" :moves="moves" :cursor="cursor"
@goto-move="gotoMove")
+ // TODO: clearer required ?!
+ .clearer
</template>
<script>
if (!!this.game.fenStart)
this.re_setVariables();
},
+ mounted: function() {
+ const boardSize = localStorage.getItem("boardSize");
+ if (!!boardSize)
+ document.getElementById("boardContainer").style.width = boardSize + "px";
+ },
methods: {
focusBg: function() {
// TODO: small blue border appears...
</script>
<style lang="sass">
-#modal-eog+div .card
- overflow: hidden
-#pgnDiv
- text-align: center
+#baseGame
+ width: 100%
+
+#gameContainer
margin-left: auto
margin-right: auto
+
+#modal-eog+div .card
+ overflow: hidden
@media screen and (min-width: 768px)
#controls
width: 400px
-@media screen and (max-width: 767px)
- .game
- width: 100%
+ margin-left: auto
+ margin-right: auto
#controls
margin-top: 10px
+ margin-left: auto
+ margin-right: auto
button
display: inline-block
width: 20%
margin: 0
+#pgnDiv
+ text-align: center
+ margin-left: auto
+ margin-right: auto
#boardContainer
- //margin-top: 5px
- >div
- margin-left: auto
- margin-right: auto
+ float: left
+#movesList
+ width: 280px
+ float: left
+
+.clearer
+ clear: both
</style>
elementArray
);
},
- mounted: function() {
- // NOTE (TODO?): could also be dependent on page type (game, analyze, variant)
- const boardSize = localStorage.getItem("boardSize");
- if (!!boardSize)
- document.querySelector(".game").style.width = boardSize + "px";
- },
methods: {
mousedown: function(e) {
e = e || window.event;
padding-bottom: 9.1%
.game
- //width: #{'min(80vw, 500px)'}
- margin: 0 auto
+ width: 100%
+ margin: 0
.board
cursor: pointer
- @media screen and (max-width: 767px)
- width: 100%
- margin: 0
#choices
margin: 0 auto 0 auto
option(value="2") {{ st.tr["All"] }}
fieldset
.slidecontainer
- input#myRange.slider(type="range" min="20" max="100" value="60"
+ input#myRange.slider(type="range" min="0" max="100" value="50"
@input="adjustBoard")
</template>
: event.target.value;
},
adjustBoard: function() {
- const board = document.querySelector(".game");
- if (!board)
+ const boardContainer = document.getElementById("boardContainer");
+ if (!boardContainer)
return; //no board on page
- const multiplier = document.getElementById("myRange").value;
- const boardSize = 10 * multiplier;
+ const k = document.getElementById("myRange").value;
+ const movesWidth = 280; //TODO: constant somewhere...;
+ const minBoardWidth = 240; //TODO: same
+ // Value of 0 is board min size; 100 is screen.width - movesWidth
+ const boardSize = k * (screen.width - (movesWidth+minBoardWidth)) / 100 + minBoardWidth;
localStorage.setItem("boardSize", boardSize);
- board.style.width = boardSize + "px";
+ boardContainer.style.width = boardSize + "px";
+ document.getElementById("gameContainer").style.width = (boardSize + movesWidth) + "px";
},
},
};
@newchat-sent="finishSendChat" @newchat-received="processChat")
.row
.col-sm-12.col-md-9.col-md-offset-3.col-lg-10.col-lg-offset-2
+ button#chatBtn(onClick="doClick('modalChat')") Chat
#actions(v-if="game.mode!='analyze' && game.score=='*'")
button(@click="offerDraw") Draw
button(@click="abortGame") Abort
button(@click="resign") Resign
- button#chatBtn(onClick="doClick('modalChat')") Chat
div Names: {{ game.players[0].name }} - {{ game.players[1].name }}
div(v-if="game.score=='*'") Time: {{ virtualClocks[0] }} - {{ virtualClocks[1] }}
BaseGame(:game="game" :vr="vr" ref="basegame"
width: 100%
#actions
+ display: inline-block
margin-top: 10px
- margin-left: auto
- margin-right: auto
button
display: inline-block
width: 33%
padding-top: 20px
max-width: 600px
border: none;
+
+#chatBtn
+ margin: 0 10px 0 0
</style>