From: Benjamin Auder Date: Fri, 14 Dec 2018 23:20:15 +0000 (+0100) Subject: On the road to problems to complete website :) X-Git-Url: https://git.auder.net/variants/Baroque/complete_rules.html?a=commitdiff_plain;h=f5d3e4f539355d166baf38bab97480582e90e4af;p=vchess.git On the road to problems to complete website :) --- diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js new file mode 100644 index 00000000..54b36ab7 --- /dev/null +++ b/public/javascripts/components/problems.js @@ -0,0 +1,14 @@ +//TODO: list problems as FEN (quickly rendered), by date, with possible filtering per variant(?) +//click on a problem ==> land on variant page with mode==friend, FEN prefilled... ok + +// get 10 first problems, and buttons next<>previous send date + "before" or "after" +// need database: sqlite ! + +// form "new problem" fen(position/turn/flags[guess]), instructions, solution (mandatory) +// ==> upload on server in sandbox +// +// Atomic rules, atomic game, atomic problems(list drawn position +// + summary(first chars of instructions) + timedate)... one big Vue ? with components +// +// click on problem ==> masque problems, affiche game tab, launch new game Friend with +// FEN + turn + flags + rappel instructions / solution on click sous l'échiquier diff --git a/public/javascripts/variant.js b/public/javascripts/variant.js new file mode 100644 index 00000000..f9d23d8b --- /dev/null +++ b/public/javascripts/variant.js @@ -0,0 +1,7 @@ +new Vue({ + el: "#variantPage", + data: { display: "" }, //do not show anything... + // TODO: listen event "show problem", avec le probleme stringifié en arg + // Alors: display=game, mode=friend, newGame(fen, turn, ...), + // et set Instructions+Soluce +}); diff --git a/views/index.pug b/views/index.pug index 188ec9ca..521c1258 100644 --- a/views/index.pug +++ b/views/index.pug @@ -16,16 +16,7 @@ block content div(role="dialog") #help.card label.modal-close(for="modal-help") - h3.blue.section Tips - p.section - span.conditional-jump - | On a variant page, read the rules by clicking on the title - | "<Variant> rules". - span.conditional-jump - | Try playing against a human: click the leftmost "new game" button. - | ...Then, while waiting you can play against a (rather weak) bot - | or a friend. - // TODO? On the index page, try typing the first letters of a variant. + p.section First: watch #[a(href="/demo.webm") demo video] :) h3.blue.section Comments p.section. All games start with a random assymetric position. #[br] diff --git a/views/variant.pug b/views/variant.pug index a44a3741..e7449621 100644 --- a/views/variant.pug +++ b/views/variant.pug @@ -8,11 +8,17 @@ block content .container#variantPage .row .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 - h4.rulesTitle.text-center(v-on:click="displayRules=!displayRules") + h4.rulesTitle.text-center(v-on:click="display='rules'") | #{variant} Rules - my-rules(v-show="displayRules") + my-rules(v-show="display=='rules'") .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 - my-game + h4.rulesTitle.text-center(v-on:click="display='game'") + | #{variant} Game + my-game(v-show="display=='game'") + .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 + h4.rulesTitle.text-center(v-on:click="display='problems'") + | #{variant} Problems + my-game(v-show="display=='problems'") block javascripts script(src="/javascripts/utils/misc.js") @@ -27,8 +33,4 @@ block javascripts const variant = "#{variant}"; script(src="/javascripts/components/rules.js") script(src="/javascripts/components/game.js") - script. - new Vue({ - el: "#variantPage", - data: { displayRules: false }, - }); + script(src="/javascripts/components/problems.js")