nav
label.drawer-toggle(for="drawerControl")
input#drawerControl.drawer(type="checkbox")
- #menuBar(@click="hideDrawer")
+ #menuBar(@click="hideDrawer()")
label.drawer-close(for="drawerControl")
#leftMenu
router-link(to="/")
<template lang="pug">
-div#baseGame(tabindex=-1 @click="() => focusBg()"
+div#baseGame(tabindex=-1 @click="focusBg()"
@keydown="handleKeys" @wheel="handleScroll")
input#modalEog.modal(type="checkbox")
div#eogDiv(role="dialog" data-checkbox="modalEog" aria-labelledby="eogMessage")
#turnIndicator(v-if="game.vname=='Dark' && game.score=='*'")
| {{ turn }}
#controls
- button(@click="gotoBegin") <<
- button(@click="() => undo()") <
- button(@click="flip") ⇅
- button(@click="() => play()") >
- button(@click="gotoEnd") >>
+ button(@click="gotoBegin()") <<
+ button(@click="undo()") <
+ button(@click="flip()") ⇅
+ button(@click="play()") >
+ button(@click="gotoEnd()") >>
#pgnDiv
#downloadDiv(v-if="game.vname!='Dark' || game.score!='*'")
a#download(href="#")
- button(@click="download") {{ st.tr["Download"] }} PGN
+ button(@click="download()") {{ st.tr["Download"] }} PGN
button(onClick="doClick('modalAdjust')") ⤢
button(v-if="game.vname!='Dark' && game.mode!='analyze'"
- @click="analyzePosition")
+ @click="analyzePosition()")
| {{ st.tr["Analyse"] }}
// NOTE: rather ugly hack to avoid showing twice "rules" link...
- button(v-if="!$route.path.match('/variants/')" @click="showRules")
+ button(v-if="!$route.path.match('/variants/')" @click="showRules()")
| {{ st.tr["Rules"] }}
#movesList
MoveList(v-if="showMoves" :score="game.score" :message="game.scoreMsg"
import { getDate } from "@/utils/datetime";
import { processModalClick } from "@/utils/modalClick";
import { getScoreMessage } from "@/utils/scoring";
-
export default {
name: 'my-base-game',
components: {
import { getSquareId, getSquareFromId } from "@/utils/squareId";
import { ArrayFun } from "@/utils/array";
import { store } from "@/store";
-
export default {
name: 'my-board',
// Last move cannot be guessed from here, and is required to highlight squares
<script>
import { store } from "@/store";
-
export default {
name: "my-challenge-list",
props: ["challenges"],
div
input#inputChat(type="text" :placeholder="st.tr['Type here']"
@keyup.enter="sendChat")
- button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }}
+ button#sendChatBtn(@click="sendChat()") {{ st.tr["Send"] }}
p(v-for="chat in chats" :class="classObject(chat)"
v-html="chat.name + ': ' + chat.msg")
p(v-for="chat in pastChats" :class="classObject(chat)"
<script>
import { store } from "@/store";
-
export default {
name: "my-chat",
// Prop 'pastChats' for corr games where chats are on server
import BaseGame from "@/components/BaseGame.vue";
import { store } from "@/store";
import Worker from "worker-loader!@/playCompMove";
-
export default {
name: "my-computer-game",
components: {
br
textarea#mailContent
fieldset
- button(type="button" @click="trySendMessage") {{ st.tr["Send"] }}
+ button(type="button" @click="trySendMessage()") {{ st.tr["Send"] }}
p#emailSent {{ st.tr["Email sent!"] }}
</template>
import { ajax } from "../utils/ajax";
import { store } from "@/store";
import { checkNameEmail } from "@/data/userCheck";
-
export default {
name: "my-contact-form",
data: function() {
td(data-label="White") {{ g.players[0].name || "@nonymous" }}
td(data-label="Black") {{ g.players[1].name || "@nonymous" }}
td(data-label="Time control") {{ g.cadence }}
- td(data-label="Result") {{ g.score }}
+ td(data-label="Result" :class="{finished: g.score!='*'}"
+ @click.stop="deleteGame(g)")
+ | {{ g.score }}
</template>
<script>
import { store } from "@/store";
-
+import { GameStorage } from "@/utils/gameStorage";
export default {
name: "my-game-list",
props: ["games"],
return augmentedGames.sort((g1,g2) => { return g2.priority - g1.priority; });
},
},
+ methods: {
+ deleteGame: function(game) {
+ if (confirm(this.st.tr["Remove game ?"]))
+ GameStorage.remove(game.id);
+ },
+ },
};
</script>
// TODO: understand why the style applied to <tr> element doesn't work
tr.my-turn > td
background-color: #fcd785
+tr td.finished
+ background-color: red
</style>
<script>
import { store } from "@/store";
-// Component for moves list on the right
export default {
name: 'my-move-list',
props: ["moves","cursor","score","message","firstNum"],
div(role="dialog")
.card
div(v-html="content")
+ p#disableMsg.clickable(@click="closeAndDisable()")
+ | {{ st.tr["Close and show no more"] }}
</template>
<script>
import { store } from "@/store.js";
export default {
name: "my-welcome",
+ data: function() {
+ return {
+ st: store.state,
+ };
+ },
computed: {
content: function() {
// (AJAX) Request to get welcome content (plain text, HTML)
- return require("raw-loader!@/translations/welcome/" + store.state.lang + ".pug")
+ return require("raw-loader!@/translations/welcome/" + this.st.lang + ".pug")
// Next two lines fix a weird issue after last update (2019-11)
.replace(/\\n/g, " ").replace(/\\"/g, '"')
.replace('module.exports = "', '').replace(/"$/, "");
},
};
</script>
+
+<style lang="sass">
+p#credits
+ font-size: 0.8rem
+ margin-top: -10px
+ text-align: center
+</style>
"Cadence": "Cadence",
"Challenge": "Challenge",
"Challenge declined": "Challenge declined",
+ "Close and show no more": "Close and show no more",
"Connection token sent. Check your emails!": "Connection token sent. Check your emails!",
"Contact": "Contact",
"Contact form": "Contact form",
"Cadence": "Cadencia",
"Challenge": "Desafiar",
"Challenge declined": "Desafío rechazado",
+ "Close and show no more": "Cerrar y no mostrar más",
"Connection token sent. Check your emails!": "Token de conexión enviado. ¡ Revisa tus correos !",
"Contact": "Contacto",
"Contact form": "Formulario de contacto",
"Cadence": "Cadence",
"Challenge": "Défier",
"Challenge declined": "Défi refusé",
+ "Close and show no more": "Fermer et ne plus montrer",
"Connection token sent. Check your emails!": "Token de connection envoyé. Allez voir vos emails !",
"Contact": "Contact",
"Contact form": "Formulaire de contact",
h3 Welcome to v[ariant]chess.club!
p A place to play chess variants.
img(src="/images/Hexagonal_chess.svg")
-p A variant is a change in the usual rules :
+-
+ var wikipediaUrl = "https://en.wikipedia.org/wiki/" +
+ "List_of_chess_variants#/media/File:Hexagonal_chess.svg";
+p#credits Image credit: #[a(href=wikipediaUrl) Wikipedia]
+p A variant is a change in the usual rules:
ul
li different pieces movements, or
li different chessboards (as on the image), or
h3 Notes (non-negotiable ;) )
p No ELO rating on this website.
p Games start with an assymetric random setup.
-p#disableMsg.clickable(onClick="localStorage.setItem('welcomed',true)")
- | Close and show no more
--
- var wikipediaUrl = "https://en.wikipedia.org/wiki/" +
- "List_of_chess_variants#/media/File:Hexagonal_chess.svg";
-p.smallfont Image credit: #[a(href=wikipediaUrl) Wikipedia]
h3 ¡ Bienvenido a v[ariant]chess.club !
p Un sitio donde jugar variantes del juego de ajedrez.
img(src="/images/Hexagonal_chess.svg")
+-
+ var wikipediaUrl = "https://en.wikipedia.org/wiki/" +
+ "List_of_chess_variants#/media/File:Hexagonal_chess.svg";
+p#credits Credito de imagen : #[a(href=wikipediaUrl) Wikipedia]
p Una variante es un cambio de las reglas habituales :
ul
li diferentes desplazamientos de piezas, o
h3 Notas (no negociables ;) )
p No hay clasificación ELO en el sitio.
p Las partidas comienzan con una posición aleatoria asimétrica.
-p#disableMsg.clickable(onClick="localStorage.setItem('welcomed',true)")
- | Cerrar y no mostrar más
--
- var wikipediaUrl = "https://en.wikipedia.org/wiki/" +
- "List_of_chess_variants#/media/File:Hexagonal_chess.svg";
-p.smallfont Credito de imagen : #[a(href=wikipediaUrl) Wikipedia]
h3 Bienvenue sur v[ariant]chess.club !
p Un site où jouer à des variantes du jeu d'échecs.
img(src="/images/Hexagonal_chess.svg")
+-
+ var wikipediaUrl = "https://en.wikipedia.org/wiki/" +
+ "List_of_chess_variants#/media/File:Hexagonal_chess.svg";
+p#credits Crédit image : #[a(href=wikipediaUrl) Wikipedia]
p Une variante est une modification des règles usuelles :
ul
li différents déplacements de pièces, ou
h3 Notes (non négociables ;) )
p Aucun classement ELO sur le site.
p Les parties démarrent avec une position aléatoire asymétrique.
-p#disableMsg.clickable(@click="closeAndDisable")
- | Fermer et ne plus montrer
--
- var wikipediaUrl = "https://en.wikipedia.org/wiki/" +
- "List_of_chess_variants#/media/File:Hexagonal_chess.svg";
-p.smallfont Crédit image : #[a(href=wikipediaUrl) Wikipedia]
<script>
import { store } from "@/store";
-
export default {
name: 'my-about',
computed: {
.col-sm-12
#fenDiv
input#fen(v-model="curFen" @input="adjustFenSize")
- button(@click="gotoFen") {{ st.tr["Go"] }}
+ button(@click="gotoFen()") {{ st.tr["Go"] }}
BaseGame(:game="game" :vr="vr" ref="basegame")
</template>
import BaseGame from "@/components/BaseGame.vue";
import { store } from "@/store";
import { ArrayFun } from "@/utils/array";
-
export default {
name: 'my-analyse',
components: {
<script>
import { store } from "@/store";
import { ajax } from "@/utils/ajax";
-
export default {
name: 'my-auth',
data: function() {
<template lang="pug">
main
- input#modalChat.modal(type="checkbox" @click="resetChatColor")
+ input#modalChat.modal(type="checkbox" @click="resetChatColor()")
div#chatWrap(role="dialog" data-checkbox="modalChat" aria-labelledby="inputChat")
#chat.card
label.modal-close(for="modalChat")
span.variant-info {{ game.vname }}
button#chatBtn(onClick="doClick('modalChat')") Chat
#actions(v-if="game.score=='*'")
- button(@click="clickDraw" :class="{['draw-' + drawOffer]: true}")
+ 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(v-if="!!game.mycolor" @click="abortGame()") {{ st.tr["Abort"] }}
+ button(v-if="!!game.mycolor" @click="resign()") {{ st.tr["Resign"] }}
#playersInfo
p
span.name(:class="{connected: isConnected(0)}")
fieldset(v-if="st.user.id > 0 && newchallenge.to.length > 0")
label(for="inputFen") FEN
input#inputFen(type="text" v-model="newchallenge.fen")
- button(@click="newChallenge") {{ st.tr["Send challenge"] }}
+ button(@click="newChallenge()") {{ st.tr["Send challenge"] }}
.row
.col-sm-12
button#newGame(onClick="doClick('modalNewgame')") {{ st.tr["New game"] }}
.col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
div
.button-group
- button(@click="(e) => setDisplay('c','live',e)" class="active")
+ button(@click="setDisplay('c','live',$event)" class="active")
| {{ st.tr["Live challenges"] }}
- button(@click="(e) => setDisplay('c','corr',e)")
+ button(@click="setDisplay('c','corr',$event)")
| {{ st.tr["Correspondance challenges"] }}
ChallengeList(v-show="cdisplay=='live'"
- :challenges="filterChallenges('live')" @click-challenge="clickChallenge")
+ :challenges="filterChallenges('live')" @click-challenge="clickChallenge()")
ChallengeList(v-show="cdisplay=='corr'"
- :challenges="filterChallenges('corr')" @click-challenge="clickChallenge")
+ :challenges="filterChallenges('corr')" @click-challenge="clickChallenge()")
#people
h3.text-center {{ st.tr["Who's there?"] }}
#players
.clearer
div
.button-group
- button(@click="(e) => setDisplay('g','live',e)" class="active")
+ button(@click="setDisplay('g','live',$event)" class="active")
| {{ st.tr["Live games"] }}
- button(@click="(e) => setDisplay('g','corr',e)")
+ button(@click="setDisplay('g','corr',$event)")
| {{ st.tr["Correspondance games"] }}
GameList(v-show="gdisplay=='live'" :games="filterGames('live')"
@show-game="showGame")
<script>
import { store } from "@/store";
import { ajax } from "@/utils/ajax";
-
export default {
name: 'my-logout',
data: function() {
import { GameStorage } from "@/utils/gameStorage";
import { ajax } from "@/utils/ajax";
import GameList from "@/components/GameList.vue";
-
export default {
name: "my-games",
components: {
.row
.col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
.button-group
- button(@click="clickReadRules") {{ st.tr["Rules"] }}
- button(v-show="!gameInProgress" @click="() => startGame('auto')")
+ button(@click="clickReadRules()") {{ st.tr["Rules"] }}
+ button(v-show="!gameInProgress" @click="startGame('auto')")
| {{ st.tr["Example game"] }}
- button(v-show="!gameInProgress" @click="() => startGame('versus')")
+ button(v-show="!gameInProgress" @click="startGame('versus')")
| {{ st.tr["Practice"] }}
- button(v-show="gameInProgress" @click="() => stopGame()")
+ button(v-show="gameInProgress" @click="stopGame()")
| {{ st.tr["Stop game"] }}
button(v-if="display=='rules' && gameInfo.vname!='Dark'"
- @click="gotoAnalyze")
+ @click="gotoAnalyze()")
| {{ st.tr["Analyse"] }}
.section-content(v-show="display=='rules'" v-html="content")
ComputerGame(v-show="display=='computer'" :game-info="gameInfo"
import ComputerGame from "@/components/ComputerGame.vue";
import { store } from "@/store";
import { getDiagram } from "@/utils/printDiagram";
-
export default {
name: 'my-rules',
components: {