Skip to content

Commit

Permalink
fix ribbon star count
Browse files Browse the repository at this point in the history
  • Loading branch information
allanjoseph98 committed Aug 4, 2024
1 parent 17cb0f4 commit 39ebba4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ui/learn/src/score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const apple = 50;
export const capture = 50;
export const scenario = 50;

type Rank = 1 | 2 | 3;
export type Rank = 1 | 2 | 3;

const levelBonus: { [r in Rank]: number } = {
1: 500,
Expand Down
8 changes: 4 additions & 4 deletions ui/learn/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export const view = (ctrl: LearnCtrl): VNode => (ctrl.inStage() ? runView(ctrl)

type Status = 'future' | 'done' | 'ongoing';

const mapView = (ctrl: LearnCtrl) => {
return h('div.learn.learn--map', [
const mapView = (ctrl: LearnCtrl) =>
h('div.learn.learn--map', [
h('div.learn__side', mapSideView(ctrl)),
h('div.learn__main.learn-stages', [
...stages.categs.map(categ =>
Expand Down Expand Up @@ -45,11 +45,11 @@ const mapView = (ctrl: LearnCtrl) => {
whatNext(ctrl),
]),
]);
};

const titleVerbosityClass = (title: string) => (title.length > 13 ? (title.length > 18 ? 'vvv' : 'vv') : '');

const makeStars = (nb: number): VNode[] => Array(nb).fill(h('i', { attrs: { 'data-icon': licon.Star } }));
const makeStars = (rank: scoring.Rank): VNode[] =>
Array(4 - rank).fill(h('i', { attrs: { 'data-icon': licon.Star } }));

const ongoingStr = (ctrl: LearnCtrl, s: Stage): string => {
const progress = ctrl.stageProgress(s);
Expand Down

0 comments on commit 39ebba4

Please sign in to comment.