From: Benjamin Auder Date: Mon, 10 Dec 2018 09:00:05 +0000 (+0100) Subject: Much less aggressive welcome message X-Git-Url: https://git.auder.net/?p=vchess.git;a=commitdiff_plain;h=2c99dab410af1cb902b8e6140df2348a92cf1312 Much less aggressive welcome message --- diff --git a/public/javascripts/index.js b/public/javascripts/index.js index d95f96a5..007c9fe2 100644 --- a/public/javascripts/index.js +++ b/public/javascripts/index.js @@ -72,6 +72,12 @@ new Vue({ // Show welcome dialog box if "first visit" const visited = getCookie("visited"); if (!visited || visited !== "1") + document.getElementById("modal-b4welcome").checked = true; + }, + methods: { + showWelcomeMsg: function() { + document.getElementById("modal-b4welcome").checked = false; document.getElementById("modal-welcome").checked = true; + }, }, }); diff --git a/views/index.pug b/views/index.pug index 4be9cf92..f7d9d041 100644 --- a/views/index.pug +++ b/views/index.pug @@ -32,6 +32,14 @@ block content 3. send an email to #[a(href="mailto:contact@vchess.club?subject=[vchess.club] bug report") contact@vchess.club] with relevant comments and the PGN attached. Thank you! + input#modal-b4welcome.modal(type="checkbox") + div(role="dialog") + #b4welcome.card.text-center + label.modal-close(for="modal-b4welcome") + h3.blue.section First visit? + p Please + span(style="color:blue;text-decoration:underline;cursor:pointer" @click="showWelcomeMsg") read this + span  before playing ☺ input#modal-welcome.modal(type="checkbox") div(role="dialog") #welcome.card.text-center @@ -74,7 +82,7 @@ block content p. For informations about hundreds (if not thousands!) of variants, you can visit the excellent #[a(href="https://www.chessvariants.com/") chessvariants] website. - p(style="cursor:pointer;color:darkgrey" onClick="setCookie('visited','1');document.getElementById('modal-welcome').checked=false") Do not annoy me again! + p(style="cursor:pointer;color:darkred" onClick="setCookie('visited','1');document.getElementById('modal-welcome').checked=false") Click here to not show this message next time p(style="font-size:0.8em") Image credit: #[a(href="https://en.wikipedia.org/wiki/List_of_chess_variants#/media/File:Hexagonal_chess.svg") Wikpedia] .row my-variant-summary(