From 5b852870cf90a96d1a2a16ce158e57ee5dd52681 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Wed, 12 Feb 2020 14:31:32 +0100 Subject: [PATCH] Re-introduce welcome screen with forced reading --- client/public/images/Hexagonal_chess.svg | 2415 ++++++++++++++++++++++ client/src/App.vue | 5 + client/src/components/Welcome.vue | 29 + client/src/main.js | 2 +- client/src/translations/welcome/en.pug | 20 + client/src/translations/welcome/es.pug | 20 + client/src/translations/welcome/fr.pug | 20 + 7 files changed, 2510 insertions(+), 1 deletion(-) create mode 100644 client/public/images/Hexagonal_chess.svg create mode 100644 client/src/components/Welcome.vue create mode 100644 client/src/translations/welcome/en.pug create mode 100644 client/src/translations/welcome/es.pug create mode 100644 client/src/translations/welcome/fr.pug diff --git a/client/public/images/Hexagonal_chess.svg b/client/public/images/Hexagonal_chess.svg new file mode 100644 index 00000000..7bc0fb4b --- /dev/null +++ b/client/public/images/Hexagonal_chess.svg @@ -0,0 +1,2415 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/src/App.vue b/client/src/App.vue index c47c6aaf..592861d7 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -4,6 +4,7 @@ Settings ContactForm UpsertUser + Welcome .container .row .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 @@ -45,6 +46,7 @@ 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 { @@ -53,6 +55,7 @@ export default { Language, Settings, UpsertUser, + Welcome, }, data: function() { return { @@ -69,6 +72,8 @@ 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/Welcome.vue b/client/src/components/Welcome.vue new file mode 100644 index 00000000..2e2cb823 --- /dev/null +++ b/client/src/components/Welcome.vue @@ -0,0 +1,29 @@ + + + diff --git a/client/src/main.js b/client/src/main.js index 06b050b7..f1e23cbd 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -17,7 +17,7 @@ new Vue({ { let modalBoxes = document.querySelectorAll("[id^='modal']"); modalBoxes.forEach(m => { - if (m.checked) + if (m.checked && m.id != "modalWelcome") m.checked = false; }); } diff --git a/client/src/translations/welcome/en.pug b/client/src/translations/welcome/en.pug new file mode 100644 index 00000000..bbc5edfc --- /dev/null +++ b/client/src/translations/welcome/en.pug @@ -0,0 +1,20 @@ +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 : +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. +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] diff --git a/client/src/translations/welcome/es.pug b/client/src/translations/welcome/es.pug new file mode 100644 index 00000000..c3a292e9 --- /dev/null +++ b/client/src/translations/welcome/es.pug @@ -0,0 +1,20 @@ +h3 ¡ Bienvenido a v[ariant]chess.club ! +p Un sitio donde jugar variantes del juego de ajedrez. +img(src="/images/Hexagonal_chess.svg") +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. +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] diff --git a/client/src/translations/welcome/fr.pug b/client/src/translations/welcome/fr.pug new file mode 100644 index 00000000..84fd0c46 --- /dev/null +++ b/client/src/translations/welcome/fr.pug @@ -0,0 +1,20 @@ +h3 Bienvenue sur v[ariant]chess.club ! +p Un site où jouer à des variantes du jeu d'échecs. +img(src="/images/Hexagonal_chess.svg") +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. +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] -- 2.44.0