From 44992e1c6275d8602b414f8aa75033ba633ddaf3 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Fri, 3 Oct 2014 23:30:46 +0200 Subject: [PATCH] introduce staunton pieces, rethink play layout --- .gitmodules | 3 ++ bin/prod/deploy | 3 +- modules/pref/src/main/PieceSet.scala | 2 +- public/staunton | 1 + public/stylesheets/board.css | 76 ++++++++++++++++++++-------- ui/round/package.json | 2 +- ui/round/src/view/main.js | 2 +- 7 files changed, 64 insertions(+), 25 deletions(-) create mode 160000 public/staunton diff --git a/.gitmodules b/.gitmodules index 1324b5d610..a36a009068 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "modules/swisssystem"] path = modules/swisssystem url = https://github.com/psuter/swisssystem +[submodule "public/staunton"] + path = public/staunton + url = https://github.com/clarkerubber/Staunton-Pieces diff --git a/bin/prod/deploy b/bin/prod/deploy index f9bf10196e..a0080c1251 100755 --- a/bin/prod/deploy +++ b/bin/prod/deploy @@ -60,7 +60,8 @@ RSYNC_OPTIONS=" \ --exclude logs \ --exclude RUNNING_PID \ --exclude bin/.translate_version \ - --exclude local"; + --exclude local + --exclude '*.psd'"; lilalog "Rsync scripts, binaries and assets" stage="target/universal/stage" diff --git a/modules/pref/src/main/PieceSet.scala b/modules/pref/src/main/PieceSet.scala index 7a8734b6c2..a685f0f9ae 100644 --- a/modules/pref/src/main/PieceSet.scala +++ b/modules/pref/src/main/PieceSet.scala @@ -11,7 +11,7 @@ sealed class PieceSet private (val name: String) { object PieceSet { - val all = NonEmptyList("cburnett", "merida", "pirouetti", "alpha", "spatial") map { name => new PieceSet(name) } + val all = NonEmptyList("cburnett", "merida", "pirouetti", "alpha", "spatial", "staunton") map { name => new PieceSet(name) } val list = all.list diff --git a/public/staunton b/public/staunton new file mode 160000 index 0000000000..263845c25f --- /dev/null +++ b/public/staunton @@ -0,0 +1 @@ +Subproject commit 263845c25fa45eb497c2fe6ff58ac003826aa55e diff --git a/public/stylesheets/board.css b/public/stylesheets/board.css index b3cd0b832c..4a28566ad0 100644 --- a/public/stylesheets/board.css +++ b/public/stylesheets/board.css @@ -1,11 +1,10 @@ +div.lichess_game { + display: table; +} div.lichess_board_wrap { - float: left; + display: table-cell; border: 1px solid #ccc; position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; } span.board_mark { position: absolute; @@ -36,7 +35,6 @@ div.lcs { width: 64px; height: 64px; } - body.blue div.lichess_board, body.blue #GameBoard, body.blue .mini_board, @@ -122,6 +120,7 @@ body.leather .cg-board, background-image: url(../images/board/leather-512.jpg); } /* KotH boards */ + body.blue div.lichess_board.kingOfTheHill, body.blue #GameBoard.kingOfTheHill { background-image: url(../images/board/koth/blue.jpg); @@ -170,7 +169,6 @@ body.leather div.lichess_board.kingOfTheHill, body.leather #GameBoard.kingOfTheHill { background-image: url(../images/board/koth/leather.jpg); } - @media only screen and (-webkit-min-device-pixel-ratio:2), @@ -178,11 +176,7 @@ only screen and (min--moz-device-pixel-ratio:2), only screen and (min-device-pixel-ratio:2), only screen and (min-resolution:192dpi), only screen and (min-resolution:2dppx) { - body.wood div.lichess_board, - body.wood #GameBoard, - body.wood .mini_board, - body.wood .cg-board, - #top div.color_demo.wood { + body.wood div.lichess_board, body.wood #GameBoard, body.wood .mini_board, body.wood .cg-board, #top div.color_demo.wood { background-image: url(../images/board/wood3-1024.jpg); } body.canvas div.lichess_board, @@ -416,6 +410,50 @@ body.alpha div.queen.black { body.alpha div.king.black { background-image: url(../piece/alpha/bK.svg); } +body.staunton div.pawn.white { + background-image: url(../staunton/Renders/Pieces/Wood/White-Pawn.png); +} +body.staunton div.bishop.white { + background-image: url(../staunton/Renders/Pieces/Wood/White-Bishop.png); +} +body.staunton div.knight.white, +#top div.piece_demo.staunton { + background-image: url(../staunton/Renders/Pieces/Wood/White-Knight.png); +} +body.staunton div.rook.white { + background-image: url(../staunton/Renders/Pieces/Wood/White-Rook.png); +} +body.staunton div.queen.white { + background-image: url(../staunton/Renders/Pieces/Wood/White-Queen.png); +} +body.staunton div.king.white { + background-image: url(../staunton/Renders/Pieces/Wood/White-King.png); +} +body.staunton div.pawn.black { + background-image: url(../staunton/Renders/Pieces/Wood/Black-Pawn.png); +} +body.staunton div.bishop.black { + background-image: url(../staunton/Renders/Pieces/Wood/Black-Bishop.png); +} +body.staunton div.knight.black { + background-image: url(../staunton/Renders/Pieces/Wood/Black-Knight.png); +} +body.staunton div.rook.black { + background-image: url(../staunton/Renders/Pieces/Wood/Black-Rook.png); +} +body.staunton div.queen.black { + background-image: url(../staunton/Renders/Pieces/Wood/Black-Queen.png); +} +body.staunton div.king.black { + background-image: url(../staunton/Renders/Pieces/Wood/Black-King.png); +} +body.staunton div.cg-piece { + height: 140%; + width: 120%; + left: -10%; + top: -10%; + z-index: 3; +} div.lichess_game_not_started { position: relative; } @@ -430,7 +468,7 @@ div.lichess_overboard { line-height: 1.8em; text-decoration: none; background: #fff; - box-shadow: 0 0 95px 25px rgba(0,0,0,0.6); + box-shadow: 0 0 95px 25px rgba(0, 0, 0, 0.6); text-align: center; } div.lichess_overboard a.close { @@ -517,14 +555,11 @@ div.lichess_join_url span { border: 1px solid #D4D4D4; } div.lichess_ground { - position: relative; - margin-left: 532px; - height: 514px; + display: table-cell; + vertical-align: middle; + padding-left: 15px; } div.lichess_table_wrap { - position: absolute; - top: 176px; - left: 0px; width: 242px; } div.lichess_table { @@ -926,9 +961,8 @@ div.underboard a { div.underboard.replay_and_analyse a { font-size: 1.4em; } - div.check_count span.player.color { - display:inline-block; + display: inline-block; margin-left: 5px; font-weight: bold; } diff --git a/ui/round/package.json b/ui/round/package.json index 724a8b60d4..6e3f053cd5 100644 --- a/ui/round/package.json +++ b/ui/round/package.json @@ -30,7 +30,7 @@ "watchify": "^1.0.2" }, "dependencies": { - "chessground": "^1.4.0", + "chessground": "^1.4.1", "lodash-node": "^2.4.1", "mithril": "^0.1.22" } diff --git a/ui/round/src/view/main.js b/ui/round/src/view/main.js index 4a4ba90807..ea0f675742 100644 --- a/ui/round/src/view/main.js +++ b/ui/round/src/view/main.js @@ -8,7 +8,7 @@ module.exports = function(ctrl) { if (isUpdate) return; $('body').trigger('lichess.content_loaded'); }, - class: 'lichess_game clearfix not_spectator pov_' + ctrl.data.player.color + class: 'lichess_game not_spectator pov_' + ctrl.data.player.color }, [ ctrl.data.blindMode ? m('div#lichess_board_blind') : null, m('div.lichess_board_wrap', ctrl.data.blindMode ? null : [