From a154d45ebb7e409cd714d0c517e79c8147bdea69 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Wed, 12 Feb 2020 18:35:22 +0100 Subject: [PATCH] Remove some titles, improve style. TODO: bug start new corr games --- client/src/App.vue | 5 --- client/src/components/ContactForm.vue | 1 - client/src/components/Settings.vue | 1 - client/src/components/Welcome.vue | 53 -------------------------- client/src/translations/en.js | 2 - client/src/translations/es.js | 2 - client/src/translations/fr.js | 2 - client/src/translations/welcome/en.pug | 18 --------- client/src/translations/welcome/es.pug | 18 --------- client/src/translations/welcome/fr.pug | 18 --------- client/src/views/Game.vue | 4 +- client/src/views/Hall.vue | 21 ++++++---- 12 files changed, 16 insertions(+), 129 deletions(-) delete mode 100644 client/src/components/Welcome.vue delete mode 100644 client/src/translations/welcome/en.pug delete mode 100644 client/src/translations/welcome/es.pug delete mode 100644 client/src/translations/welcome/fr.pug diff --git a/client/src/App.vue b/client/src/App.vue index e97fc410..1ead6cb5 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -4,7 +4,6 @@ Settings ContactForm UpsertUser - Welcome .container .row .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 @@ -46,7 +45,6 @@ import ContactForm from "@/components/ContactForm.vue"; import Language from "@/components/Language.vue"; import Settings from "@/components/Settings.vue"; import UpsertUser from "@/components/UpsertUser.vue"; -import Welcome from "@/components/Welcome.vue"; import { store } from "./store.js"; import { processModalClick } from "./utils/modalClick.js"; export default { @@ -55,7 +53,6 @@ export default { Language, Settings, UpsertUser, - Welcome, }, data: function() { return { @@ -72,8 +69,6 @@ export default { dialogs.forEach(d => { d.addEventListener("click", processModalClick); }); - if (!localStorage.getItem("welcomed")) - setTimeout( () => { doClick("modalWelcome"); }, 2000); }, methods: { hideDrawer: function(e) { diff --git a/client/src/components/ContactForm.vue b/client/src/components/ContactForm.vue index 392d3196..14273b08 100644 --- a/client/src/components/ContactForm.vue +++ b/client/src/components/ContactForm.vue @@ -4,7 +4,6 @@ div div(role="dialog" data-checkbox="modalContact") .card label.modal-close(for="modalContact") - h3.section {{ st.tr["Contact form"] }} form(@submit.prevent="trySendMessage()" @keyup.enter="trySendMessage()") fieldset label(for="userEmail") {{ st.tr["Email"] }} diff --git a/client/src/components/Settings.vue b/client/src/components/Settings.vue index df60e04c..f1031df8 100644 --- a/client/src/components/Settings.vue +++ b/client/src/components/Settings.vue @@ -4,7 +4,6 @@ div div(role="dialog" data-checkbox="modalSettings") .card(@change="updateSettings($event)") label.modal-close(for="modalSettings") - h3.section {{ st.tr["Settings"] }} form fieldset label(for="setHints") {{ st.tr["Show possible moves?"] }} diff --git a/client/src/components/Welcome.vue b/client/src/components/Welcome.vue deleted file mode 100644 index 8c8ec4ca..00000000 --- a/client/src/components/Welcome.vue +++ /dev/null @@ -1,53 +0,0 @@ -<template lang="pug"> -div - input#modalWelcome.modal(type="checkbox") - 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/" + 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(/"$/, ""); - }, - }, - methods: { - closeAndDisable: function() { - document.getElementById("modalWelcome").checked = false; - localStorage.setItem('welcomed',true); - }, - }, -}; -</script> - -<style lang="sass"> -[type="checkbox"].modal+div .card - max-width: 767px - max-height: 100% -img - display: block - margin: 0 auto - width: 300px -@media screen and (max-width: 767px) - img - width: 75% -p#credits - font-size: 0.8rem - margin-top: -10px - text-align: center -</style> diff --git a/client/src/translations/en.js b/client/src/translations/en.js index 7ff050e1..75af8fdf 100644 --- a/client/src/translations/en.js +++ b/client/src/translations/en.js @@ -18,10 +18,8 @@ export const translations = "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", "Content": "Content", "Correspondance challenges": "Correspondance challenges", "Correspondance games": "Correspondance games", diff --git a/client/src/translations/es.js b/client/src/translations/es.js index 87d2ba1c..efbf6d46 100644 --- a/client/src/translations/es.js +++ b/client/src/translations/es.js @@ -18,10 +18,8 @@ export const translations = "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", "Content": "Contenido", "Correspondance challenges": "DesafÃos por correspondencia", "Correspondance games": "Partidas por correspondencia", diff --git a/client/src/translations/fr.js b/client/src/translations/fr.js index 4e27d2ec..c23142c8 100644 --- a/client/src/translations/fr.js +++ b/client/src/translations/fr.js @@ -18,10 +18,8 @@ export const translations = "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", "Content": "Contenu", "Correspondance challenges": "Défis par correspondance", "Correspondance games": "Parties par correspondance", diff --git a/client/src/translations/welcome/en.pug b/client/src/translations/welcome/en.pug deleted file mode 100644 index 4bb53b34..00000000 --- a/client/src/translations/welcome/en.pug +++ /dev/null @@ -1,18 +0,0 @@ -h3 Welcome to v[ariant]chess.club! -p A place to play chess variants. -img(src="/images/Hexagonal_chess.svg") -- - 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 - li new pieces, or - li moves side effects, or - li ...and so on -a(href="https://www.chessvariants.com/why.html") Why should I play them ?! -h3 Notes (non-negotiable ;) ) -p No ELO rating on this website. -p Games start with an assymetric random setup. diff --git a/client/src/translations/welcome/es.pug b/client/src/translations/welcome/es.pug deleted file mode 100644 index 56f1ac4d..00000000 --- a/client/src/translations/welcome/es.pug +++ /dev/null @@ -1,18 +0,0 @@ -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 - li differentes tableros (como en la imagen), o - li nuevas piezas, o - li efectos de borde en los movimientos, o - li ...etc -a(href="https://www.chessvariants.com/why.html") Pero por qué jugar esto ?! -h3 Notas (no negociables ;) ) -p No hay clasificación ELO en el sitio. -p Las partidas comienzan con una posición aleatoria asimétrica. diff --git a/client/src/translations/welcome/fr.pug b/client/src/translations/welcome/fr.pug deleted file mode 100644 index 4a5a3877..00000000 --- a/client/src/translations/welcome/fr.pug +++ /dev/null @@ -1,18 +0,0 @@ -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 - li différents échiquiers (comme sur l'image), ou - li de nouvelles pièces, ou - li des effets de bord sur les coups, ou - li ...etc -a(href="https://www.chessvariants.com/why.html") Mais pourquoi jouer à ça ?! -h3 Notes (non négociables ;) ) -p Aucun classement ELO sur le site. -p Les parties démarrent avec une position aléatoire asymétrique. diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index a5db1464..b7cc1fc0 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -1,7 +1,7 @@ <template lang="pug"> main input#modalChat.modal(type="checkbox" @click="resetChatColor()") - div#chatWrap(role="dialog" data-checkbox="modalChat" aria-labelledby="inputChat") + div#chatWrap(role="dialog" data-checkbox="modalChat") #chat.card label.modal-close(for="modalChat") #participants @@ -738,7 +738,7 @@ export default { #chat padding-top: 20px - max-width: 600px + max-width: 767px border: none; #chatBtn diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index bcc6cbab..16af9c9a 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -1,15 +1,14 @@ <template lang="pug"> main input#modalInfo.modal(type="checkbox") - div#infoDiv(role="dialog" data-checkbox="modalInfo" aria-labelledby="infoMessage") - .card.smallpad.small-modal.text-center + div#infoDiv(role="dialog" data-checkbox="modalInfo") + .card.text-center label.modal-close(for="modalInfo") - h3#infoMessage.section - p(v-html="infoMessage") + h3.section + p(v-html="infoMessage") input#modalNewgame.modal(type="checkbox") - div#newgameDiv(role="dialog" data-checkbox="modalNewgame" - aria-labelledby="titleFenedit") - .card.smallpad(@keyup.enter="newChallenge()") + div#newgameDiv(role="dialog" data-checkbox="modalNewgame") + .card(@keyup.enter="newChallenge()") label#closeNewgame.modal-close(for="modalNewgame") fieldset label(for="selectVariant") {{ st.tr["Variant"] }} * @@ -715,6 +714,14 @@ export default { #newGame display: block margin: 10px auto 5px auto + +#infoDiv > .card + max-width: 370px + +#newgameDiv > .card + max-width: 767px + max-height: 100% + #people width: 100% #players -- 2.44.0