Skip to content

Commit 7b82f35

Browse files
committed
botPlay UI
1 parent 96b2d82 commit 7b82f35

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

ui/botPlay/css/play/_layout.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ $col1-moves-height: 4em;
4040
grid-column-gap: $block-gap;
4141

4242
&__table {
43-
grid-area: 5 / 2 / 9 / 3;
44-
}
45-
&__opponent-img {
46-
grid-area: 3 / 2 / 4 / 3;
43+
grid-area: 4 / 2 / 8 / 3;
4744
}
4845

4946
.keyboard-move {

ui/botPlay/css/play/_opponent.scss

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
.bot-game__opponent {
22
&__head {
33
@extend %flex-center-nowrap;
4-
gap: 2em;
4+
gap: 1em;
5+
padding: 0.8em 0.6em 0.8em 1em;
6+
position: relative;
57
}
68

7-
&-img {
9+
&__head img {
810
max-height: calc(var(---cg-width) / 3);
911
max-width: 50%;
1012
aspect-ratio: 1;
1113
line-height: 0;
12-
}
13-
14-
&__description {
15-
background: $c-bg-zebra;
16-
padding: 0.8em 0.6em 0.8em 0.8em;
14+
position: absolute;
15+
bottom: 0;
16+
right: 0;
1717
}
1818

1919
&__name {
20-
@include line-clamp(2);
21-
margin-top: 0.3em;
2220
font-weight: normal;
2321
color: $c-brag;
2422
font-size: 1.6em;
25-
text-align: center;
2623
}
2724
&__rating {
2825
color: $c-font-dim;
2926
}
27+
28+
&__description {
29+
background: $c-bg-zebra;
30+
padding: 0.8em 0.6em 0.8em 1em;
31+
}
3032
}

ui/botPlay/src/play/view/playView.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export const playView = (ctrl: PlayCtrl) =>
2626
const viewTable = (ctrl: PlayCtrl) => {
2727
const diffs = materialDiffs(ctrl);
2828
return [
29-
viewOpponentImage(ctrl.opts.bot),
3029
viewClockMat(ctrl, 'top', diffs[0]),
3130
viewOpponent(ctrl.opts.bot),
3231
viewMoves(ctrl),
@@ -158,14 +157,13 @@ const goThroughMoves = (ctrl: PlayCtrl, e: Event) => {
158157
};
159158

160159
const viewOpponentImage = (bot: BotInfo) =>
161-
h('img.bot-game__opponent-img', {
162-
attrs: { src: bot.image && botAssetUrl('image', bot.image) },
163-
});
160+
bot.image && h('img', { attrs: { src: botAssetUrl('image', bot.image) } });
164161

165162
const viewOpponent = (bot: BotInfo) =>
166163
h('div.bot-game__opponent', [
167164
h('div.bot-game__opponent__head', [
168-
h('h2.bot-game__opponent__name', bot.name),
165+
viewOpponentImage(bot),
166+
h('span.bot-game__opponent__name', bot.name),
169167
h('span.bot-game__opponent__rating', '' + bot.ratings['classical']),
170168
]),
171169
h('div.bot-game__opponent__description', bot.description),

0 commit comments

Comments
 (0)