From 737a5dafb39740ebe304b8d0a82df85070def571 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Thu, 28 May 2020 14:54:37 +0200 Subject: [PATCH] Fix Eightpieces, add some simple variants, add a basic variants classification instead of the list --- client/src/components/MoveList.vue | 6 +- client/src/router.js | 5 + client/src/translations/en.js | 10 +- client/src/translations/es.js | 10 +- client/src/translations/fr.js | 10 +- .../src/translations/rules/Bishopawns/en.pug | 19 + .../src/translations/rules/Bishopawns/es.pug | 19 + .../src/translations/rules/Bishopawns/fr.pug | 19 + client/src/translations/rules/Capture/en.pug | 11 +- client/src/translations/rules/Capture/es.pug | 12 +- client/src/translations/rules/Capture/fr.pug | 12 +- .../src/translations/rules/Discoduel/en.pug | 22 + .../src/translations/rules/Discoduel/es.pug | 23 + .../src/translations/rules/Discoduel/fr.pug | 23 + .../src/translations/rules/Doublemove1/en.pug | 2 +- .../src/translations/rules/Knightpawns/en.pug | 20 + .../src/translations/rules/Knightpawns/es.pug | 20 + .../src/translations/rules/Knightpawns/fr.pug | 20 + .../translations/rules/Pawnmassacre/en.pug | 21 + .../translations/rules/Pawnmassacre/es.pug | 23 + .../translations/rules/Pawnmassacre/fr.pug | 23 + .../src/translations/rules/Pawnsking/en.pug | 21 + .../src/translations/rules/Pawnsking/es.pug | 22 + .../src/translations/rules/Pawnsking/fr.pug | 22 + .../src/translations/rules/Progressive/en.pug | 35 ++ .../src/translations/rules/Progressive/es.pug | 35 ++ .../src/translations/rules/Progressive/fr.pug | 35 ++ .../src/translations/rules/Rookpawns/en.pug | 19 + .../src/translations/rules/Rookpawns/es.pug | 19 + .../src/translations/rules/Rookpawns/fr.pug | 19 + client/src/translations/variants/en.pug | 395 +++++++++++++++++ client/src/translations/variants/es.pug | 406 ++++++++++++++++++ client/src/translations/variants/fr.pug | 405 +++++++++++++++++ client/src/utils/notation.js | 14 +- client/src/variants/Bishopawns.js | 51 +++ client/src/variants/Dark.js | 8 +- client/src/variants/Discoduel.js | 50 +++ client/src/variants/Doublemove1.js | 58 +-- client/src/variants/Doublemove2.js | 36 +- client/src/variants/Eightpieces.js | 19 +- client/src/variants/Knightpawns.js | 47 ++ client/src/variants/Pawnmassacre.js | 18 + client/src/variants/Pawns.js | 9 + client/src/variants/Pawnsking.js | 56 +++ client/src/variants/Progressive.js | 111 +++++ client/src/variants/Rookpawns.js | 51 +++ client/src/views/VariantList.vue | 96 +++++ client/src/views/Variants.vue | 70 +-- server/db/populate.sql | 9 +- 49 files changed, 2330 insertions(+), 136 deletions(-) create mode 100644 client/src/translations/rules/Bishopawns/en.pug create mode 100644 client/src/translations/rules/Bishopawns/es.pug create mode 100644 client/src/translations/rules/Bishopawns/fr.pug create mode 100644 client/src/translations/rules/Discoduel/en.pug create mode 100644 client/src/translations/rules/Discoduel/es.pug create mode 100644 client/src/translations/rules/Discoduel/fr.pug create mode 100644 client/src/translations/rules/Knightpawns/en.pug create mode 100644 client/src/translations/rules/Knightpawns/es.pug create mode 100644 client/src/translations/rules/Knightpawns/fr.pug create mode 100644 client/src/translations/rules/Pawnmassacre/en.pug create mode 100644 client/src/translations/rules/Pawnmassacre/es.pug create mode 100644 client/src/translations/rules/Pawnmassacre/fr.pug create mode 100644 client/src/translations/rules/Pawnsking/en.pug create mode 100644 client/src/translations/rules/Pawnsking/es.pug create mode 100644 client/src/translations/rules/Pawnsking/fr.pug create mode 100644 client/src/translations/rules/Progressive/en.pug create mode 100644 client/src/translations/rules/Progressive/es.pug create mode 100644 client/src/translations/rules/Progressive/fr.pug create mode 100644 client/src/translations/rules/Rookpawns/en.pug create mode 100644 client/src/translations/rules/Rookpawns/es.pug create mode 100644 client/src/translations/rules/Rookpawns/fr.pug create mode 100644 client/src/translations/variants/en.pug create mode 100644 client/src/translations/variants/es.pug create mode 100644 client/src/translations/variants/fr.pug create mode 100644 client/src/variants/Bishopawns.js create mode 100644 client/src/variants/Discoduel.js create mode 100644 client/src/variants/Knightpawns.js create mode 100644 client/src/variants/Pawnmassacre.js create mode 100644 client/src/variants/Pawnsking.js create mode 100644 client/src/variants/Progressive.js create mode 100644 client/src/variants/Rookpawns.js create mode 100644 client/src/views/VariantList.vue diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 2e011b49..e36c058c 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -53,14 +53,12 @@ div .td( :class="{'highlight-lm': cursor == moveIdx}" @click="() => gotoMove(moveIdx)" - ) - | {{ notation(moveIdx) }} + v-html="notation(moveIdx)") .td( v-if="moveIdx < moves.length-1" :class="{'highlight-lm': cursor == moveIdx+1}" @click="() => gotoMove(moveIdx+1)" - ) - | {{ notation(moveIdx + 1) }} + v-html="notation(moveIdx + 1)") + + diff --git a/client/src/views/Variants.vue b/client/src/views/Variants.vue index e5d02856..d638b075 100644 --- a/client/src/views/Variants.vue +++ b/client/src/views/Variants.vue @@ -2,18 +2,9 @@ main .row .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 - input#prefixFilter( - v-model="curPrefix" - @input="setCurPrefix($event)" - :placeholder="st.tr['Prefix?']" - ) - .variant.col-sm-12.col-md-5.col-lg-4( - v-for="(v,idx) in filteredVariants" - :class="getVclasses(filteredVariants, idx)" - ) - router-link(:to="getLink(v.name)") - h4.boxtitle.text-center {{ v.name }} - p.description.text-center {{ st.tr[v.desc] }} + a#mainLink(href="/#/variants/list") + | {{ st.tr["View alphabetical variants list"] }} + div(v-html="content") diff --git a/server/db/populate.sql b/server/db/populate.sql index a44a3ab5..6b664a55 100644 --- a/server/db/populate.sql +++ b/server/db/populate.sql @@ -26,6 +26,7 @@ insert or ignore into Variants (name, description) values ('Benedict', 'Change colors'), ('Berolina', 'Pawns move diagonally'), ('Bicolour', 'Harassed kings'), + ('Bishopawns', 'Bishop versus pawns'), ('Cannibal', 'Capture powers'), ('Capture', 'Mandatory captures'), ('Checkered1', 'Shared pieces (v1)'), @@ -40,6 +41,7 @@ insert or ignore into Variants (name, description) values ('Crazyhouse', 'Captures reborn'), ('Cylinder', 'Neverending rows'), ('Diamond', 'Rotating board'), + ('Discoduel', 'Enter the disco'), ('Doublearmy', '64 pieces on the board'), ('Doublemove1', 'Double moves (v1)'), ('Doublemove2', 'Double moves (v2)'), @@ -58,6 +60,7 @@ insert or ignore into Variants (name, description) values ('Interweave', 'Interweaved colorbound teams'), ('Kinglet', 'Protect your pawns'), ('Knightmate', 'Mate the knight'), + ('Knightpawns', 'Knight versus pawns'), ('Knightrelay1', 'Move like a knight (v1)'), ('Knightrelay2', 'Move like a knight (v2)'), ('Koopa', 'Stun & kick pieces'), @@ -77,14 +80,18 @@ insert or ignore into Variants (name, description) values ('Pacifist1', 'Convert & support (v1)'), ('Pacifist2', 'Convert & support (v2)'), ('Parachute', 'Landing on the board'), - ('Pawns', 'Reach the last rank'), + ('Pawnmassacre', 'Pieces upside down'), + ('Pawns', 'Reach the last rank (v1)'), + ('Pawnsking', 'Reach the last rank (v2)'), ('Perfect', 'Powerful pieces'), ('Pocketknight', 'Knight in pocket'), + ('Progressive', 'Play more and more moves'), ('Racingkings', 'Kings cross the 8x8 board'), ('Rampage', 'Move under cover'), ('Rifle', 'Shoot pieces'), ('Recycle', 'Reuse pieces'), ('Rococo', 'Capture on the edge'), + ('Rookpawns', 'Rook versus pawns'), ('Royalrace', 'Kings cross the 11x11 board'), ('Rugby', 'Transform an essay'), ('Schess', 'Seirawan-Harper Chess'), -- 2.44.0