Skip to content

Commit

Permalink
add back button
Browse files Browse the repository at this point in the history
  • Loading branch information
brollin committed Jul 4, 2022
1 parent 9a5cecd commit f1a780d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/views/coordinate/bits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ object bits {
trans.coordinates.findSquare,
trans.coordinates.nameSquare,
trans.storm.score,
trans.study.back,
trans.time,
trans.asWhite,
trans.asBlack,
Expand Down
11 changes: 11 additions & 0 deletions ui/coordinateTrainer/css/_coordinateTrainer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ form.color {
row-gap: 1em;
}

.back {
@extend %flex-column;
align-items: center;
margin-top: $block-gap;
}

.back-button {
font-size: 1.5em;
text-transform: uppercase;
}

.progress {
@extend %box-radius;
background-color: $c-bg-zebra;
Expand Down
13 changes: 13 additions & 0 deletions ui/coordinateTrainer/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,19 @@ const side = (ctrl: CoordinateTrainerCtrl): VNode => {
);
}
if (ctrl.isAuth && ctrl.hasModeScores()) sideContent.push(h('div.box', scoreCharts(ctrl)));
if (ctrl.playing && ctrl.timeDisabled())
sideContent.push(
h(
'div.back',
h(
'a.back-button',
{
hook: bind('click', ctrl.stop),
},
${trans('back')}`
)
)
);

return h('div.side', sideContent);
};
Expand Down

0 comments on commit f1a780d

Please sign in to comment.