Skip to content

Commit

Permalink
support for ZH pockets in embedded analysis - closes lichess-org#5139
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar authored and RoepStoep committed May 3, 2020
1 parent 0028e65 commit fe725ef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/analyse/css/build/_analyse.embed.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
@import '../../../tree/css/tree';
@import '../../../draughts/css/opening';
@import '../../../draughts/css/control';
@import '../../../draughts/css/zh-pocket';

@import '../embed/embed';
20 changes: 20 additions & 0 deletions ui/analyse/css/embed/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,25 @@
grid-template-rows: auto 2.5rem;
grid-template-areas:
'board tools'
'board controls';
}

.pocket {
&-top { grid-area: pocket-top; }
&-bottom { grid-area: pocket-bot; }
width: 100%;
box-shadow: 0 3px 5px rgba(0,0,0,0.3) inset;
background: #888;
border-radius: 0;
}
.analyse.variant-crazyhouse {
grid-template-rows: 60px auto 2.5rem 60px;
body.supports-max-content & {
grid-template-rows: max-content auto 2.5rem max-content;
}
grid-template-areas:
'board pocket-top'
'board tools'
'board controls'
'board pocket-bot';
}
1 change: 1 addition & 0 deletions ui/site/src/standalones/embed-analyse.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ $(function() {
});

lidraughts.startEmbeddedAnalyse = function(opts) {
document.body.classList.toggle('supports-max-content', !!window.chrome);
opts.socketSend = $.noop
opts.initialPly = 'url';
opts.trans = lidraughts.trans(opts.i18n);
Expand Down
1 change: 0 additions & 1 deletion ui/site/src/standalones/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ lidraughts.isCol1 = (function() {
var isCol1Cache = 'init'; // 'init' | 'rec' | boolean

return function() {
var ctk = 'isCol1' + Math.random();
if (typeof isCol1Cache == 'string') {
if (isCol1Cache == 'init') { // only once
window.addEventListener('resize', function() { isCol1Cache = 'rec' }); // recompute on resize
Expand Down

0 comments on commit fe725ef

Please sign in to comment.