compress pieces in crowded crazyhouse pocket
This commit is contained in:
parent
c5faeb32a5
commit
e04e16405a
|
@ -599,6 +599,7 @@ div.table {
|
|||
background: #888;
|
||||
white-space: nowrap;
|
||||
max-width: 244px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.pocket.top {
|
||||
margin-bottom: 10px;
|
||||
|
@ -613,9 +614,12 @@ div.table {
|
|||
position: relative;
|
||||
}
|
||||
.pocket piece:first-child {
|
||||
margin-left: 0;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
.pocket.crowded piece {
|
||||
width: 48.5px!important;
|
||||
background-position: center;
|
||||
}
|
||||
.pocket.usable piece {
|
||||
cursor: pointer;
|
||||
transition: background-color 0.13s;
|
||||
|
|
|
@ -10,9 +10,10 @@ module.exports = {
|
|||
if (!step.crazy) return;
|
||||
var pocket = step.crazy.pockets[color === 'white' ? 0 : 1];
|
||||
var oKeys = Object.keys(pocket)
|
||||
var crowded = oKeys.length > 4;
|
||||
var usable = color === ctrl.chessground.data.movable.color;
|
||||
return m('div', {
|
||||
class: 'pocket is2d ' + position + (usable ? ' usable' : ''),
|
||||
class: 'pocket is2d ' + position + (usable ? ' usable' : '') + (crowded ? ' crowded' : ''),
|
||||
config: function(el, isUpdate, context) {
|
||||
if (isUpdate) return;
|
||||
var onstart = partial(crazyDrag, ctrl, color);
|
||||
|
|
|
@ -11,10 +11,11 @@ module.exports = {
|
|||
var step = round.plyStep(ctrl.data, ctrl.vm.ply);
|
||||
if (!step.crazy) return;
|
||||
var pocket = step.crazy.pockets[color === 'white' ? 0 : 1];
|
||||
var oKeys = Object.keys(pocket)
|
||||
var oKeys = Object.keys(pocket);
|
||||
var crowded = oKeys.length > 4;
|
||||
var usable = position === 'bottom' && !ctrl.replaying() && game.isPlayerPlaying(ctrl.data);
|
||||
return m('div', {
|
||||
class: 'pocket is2d ' + position + (usable ? ' usable' : ''),
|
||||
class: 'pocket is2d ' + position + (usable ? ' usable' : '') + (crowded ? ' crowded' : ''),
|
||||
config: position === 'bottom' ? function(el, isUpdate, context) {
|
||||
if (isUpdate) return;
|
||||
var onstart = partial(crazyDrag, ctrl);
|
||||
|
|
Loading…
Reference in a new issue