<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet"
- href="//cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.0/mini-default.min.css">
+ href="//cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-default.min.css">
<link rel="stylesheet"
href="//fonts.googleapis.com/css?family=Open+Sans:400,700">
<style>
nav
label.drawer-toggle(for="drawerControl")
input#drawerControl.drawer(type="checkbox")
- #menuBar
+ #menuBar(@click="hideDrawer")
label.drawer-close(for="drawerControl")
#leftMenu
router-link(to="/")
| {{ st.tr["Variants"] }}
router-link(to="/mygames")
| {{ st.tr["My games"] }}
- a(href="https://groups.google.com/forum/#!forum/vchess-club")
+ a(href="https://forum.vchess.club")
| {{ st.tr["Forum"] }}
#rightMenu
.clickable(onClick="doClick('modalUser')")
return `/images/flags/${this.st.lang}.svg`;
},
},
+ methods: {
+ hideDrawer: function(e) {
+ if (e.target.innerText == "Forum")
+ return; //external link
+ e.preventDefault(); //TODO: why is this needed?
+ document.getElementsByClassName("drawer")[0].checked = false;
+ },
+ },
};
</script>
width: 36px
height: 27px
-// TODO: drawer, until 600px wide OK (seemingly)
-// After, zone where left and right just go on top of another
-// Then, on narrow screen put everything on one line
[type="checkbox"].drawer+*
right: -767px
+#menuBar
+ label.drawer-close
+ top: 50px
+
footer
//background-color: #000033
font-size: 1rem
<template lang="pug">
div
table
- tr
- th Variant
- th From
- th To
- th Cadence
- tr(v-for="c in sortedChallenges" @click="$emit('click-challenge',c)")
- td {{ c.vname }}
- td {{ c.from.name }}
- td {{ c.to }}
- td {{ c.timeControl }}
+ thead
+ tr
+ th Variant
+ th From
+ th To
+ th Cadence
+ tbody
+ tr(v-for="c in sortedChallenges" @click="$emit('click-challenge',c)")
+ td(data-label="Variant") {{ c.vname }}
+ td(data-label="From") {{ c.from.name }}
+ td(data-label="To") {{ c.to }}
+ td(data-label="Cadence") {{ c.timeControl }}
</template>
<script>
},
};
</script>
-
-<style lang="sass">
-// TODO: affichage bizarre sur petits écrans <=767px
-</style>
<template lang="pug">
-div
- .card.smallpad
- h4 Chat
- p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.msg")
- input#inputChat(type="text" :placeholder="st.tr['Type here']"
- @keyup.enter="sendChat")
- button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }}
+#chat.card
+ h4 Chat
+ p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.msg")
+ input#inputChat(type="text" :placeholder="st.tr['Type here']"
+ @keyup.enter="sendChat")
+ button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }}
</template>
<script>
};
</script>
-<style lang="sass">
+<style lang="sass" scoped>
.my-chatmsg
color: grey
.opp-chatmsg
color: black
+#chat
+ max-width: 100%
</style>
},
};
</script>
+
+<style lang="sass" scoped>
+#emailSent
+ display: none
+</style>
<template lang="pug">
div
table
- tr
- th Variant
- th White
- th Black
- th Time control
- th(v-if="showResult") Result
- tr(v-for="g in sortedGames" @click="$emit('show-game',g)"
- :class="{'my-turn': g.myTurn}")
- td {{ g.vname }}
- td {{ g.players[0].name || "@nonymous" }}
- td {{ g.players[1].name || "@nonymous" }}
- td {{ g.timeControl }}
- td(v-if="showResult") {{ g.score }}
+ thead
+ tr
+ th Variant
+ th White
+ th Black
+ th Time control
+ th(v-if="showResult") Result
+ tbody
+ tr(v-for="g in sortedGames" @click="$emit('show-game',g)"
+ :class="{'my-turn': g.myTurn}")
+ td(data-label="Variant") {{ g.vname }}
+ td(data-label="White") {{ g.players[0].name || "@nonymous" }}
+ td(data-label="Black") {{ g.players[1].name || "@nonymous" }}
+ td(data-label="Time control") {{ g.timeControl }}
+ td(v-if="showResult" data-label="Result") {{ g.score }}
</template>
<script>
div(role="dialog")
#language.card
label.modal-close(for="modalLang")
- form
+ form(@change="setLanguage")
fieldset
label(for="langSelect") {{ st.tr["Language"] }}
select#langSelect
each language,langCode in langName
- option(value=langCode selected=(lang==langCode))
+ option(value=langCode)
=language
</template>
st: store.state,
};
},
- methods: {
+ mounted: function() {
+ // TODO: better style would be in pug directly, but how?
+ document.querySelectorAll("#langSelect > option").forEach(opt => {
+ if (opt.value == this.st.lang)
+ opt.selected = true;
+ });
+ },
+ methods: {
setLanguage: function(e) {
localStorage["lang"] = e.target.value;
store.setLanguage(e.target.value);
this.state.conn.onclose = this.socketCloseListener;
const supportedLangs = ["en","es","fr"];
this.state.lang = localStorage["lang"] ||
- supportedLangs.includes(navigator.language)
+ (supportedLangs.includes(navigator.language)
? navigator.language
- : "en";
+ : "en");
this.setTranslations();
},
setTranslations: async function() {