X-Git-Url: https://git.auder.net/pieces/Checkered/cn.svg?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHome.vue;h=3a7e383f20b48d62bad116fab599b0ad4981b845;hb=7c3cd3794ee13c41fc623179f7d4142d0d3e74da;hp=dfd3939103a9d22d67e2dfcd09364864c5709f87;hpb=ccd4a2b74aecdd6e52960a9ed42acea3e40c9271;p=vchess.git
diff --git a/client/src/views/Home.vue b/client/src/views/Home.vue
index dfd39391..3a7e383f 100644
--- a/client/src/views/Home.vue
+++ b/client/src/views/Home.vue
@@ -1,87 +1,250 @@
div
- .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
- label(for="prefixFilter") Type first letters...
- input#prefixFilter(v-model="curPrefix")
- .variant.col-sm-12.col-md-5.col-lg-4(
- v-for="(v,idx) in sortedCounts"
- :class="{'col-md-offset-1': idx%2==0, 'col-lg-offset-2': idx%2==0}"
- )
- a(:href="v.name")
- h4.boxtitle.text-center {{ v.name }}
- span.count-players / {{ v.count }}
- p.description.text-center {{ $tr(v.desc) }}
+ input#modalNewgame.modal(type="checkbox")
+ div(role="dialog" aria-labelledby="titleFenedit")
+ .card.smallpad
+ label#closeNewgame.modal-close(for="modalNewgame")
+ fieldset
+ label(for="selectVariant") {{ st.tr["Variant"] }}
+ select#selectVariant(v-model="newgameInfo.vid")
+ option(v-for="v in st.variants" :value="v.id") {{ v.name }}
+ fieldset
+ label(for="selectNbPlayers") {{ st.tr["Number of players"] }}
+ select#selectNbPlayers(v-model="newgameInfo.nbPlayers")
+ option(v-show="possibleNbplayers(2)" value="2") 2
+ option(v-show="possibleNbplayers(3)" value="3") 3
+ option(v-show="possibleNbplayers(4)" value="4") 4
+ fieldset
+ label(for="timeControl") Time control (in days)
+ #timeControl
+ input(type="number" v-model="newgameInfo.mainTime"
+ placeholder="Main time")
+ input(type="number" v-model="newgameInfo.increment"
+ placeholder="Increment")
+ fieldset
+ label(for="selectPlayers") {{ st.tr["Play with?"] }}
+ #selectPlayers
+ input(type="text" v-model="newgameInfo.players[0].name")
+ input(v-show="newgameInfo.nbPlayers>=3" type="text"
+ v-model="newgameInfo.players[1].name")
+ input(v-show="newgameInfo.nbPlayers==4" type="text"
+ v-model="newgameInfo.players[2].name")
+ fieldset
+ label(for="inputFen")
+ | {{ st.tr["FEN (ignored if players fields are blank)"] }}
+ input#inputFen(type="text" v-model="newgameInfo.fen")
+ button(@click="newGame") Launch game
+ p TODO: cadence, adversaire (pre-filled if click on name)
+ p cadence 2m+12s ou 7d+1d (m,s ou d,d) --> main, increment
+ p Note: leave FEN blank for random; FEN only for targeted challenge
+ div
+ ChallengeList(:challenges="challenges" @click-challenge="clickChallenge")
+ div(style="border:1px solid black")
+ h3 Online players
+ div(v-for="p in players" @click="challenge(p)") {{ p.name }}
+ button(onClick="doClick('modalNewgame')") New game
+ div
+ .button-group
+ button(@click="gdisplay='live'") Live games
+ button(@click="gdisplay='corr'") Correspondance games
+ GameList(v-show="gdisplay=='live'" :games="liveGames"
+ @show-game="showGame")
+ GameList(v-show="gdisplay=='corr'" :games="corrGames"
+ @show-game="showGame")
-
-