From a5ea46790b5cb4b3ccbf15870aa336c0f1494692 Mon Sep 17 00:00:00 2001 From: ryo-ma Date: Tue, 25 Aug 2020 23:40:15 +0900 Subject: [PATCH] Fix small trophy position --- src/icons.ts | 16 ++++++++-------- src/trophies.ts | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/icons.ts b/src/icons.ts index 8149f02..efcc072 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -1,7 +1,7 @@ import { RANK } from "./utils.ts"; -const goldColor = "#FFD700"; -const silverColor = "#C0C0C0"; +const goldColor = "#FAD200"; +const silverColor = "#B0B0B0"; const bronzeColor = "#816D46"; const leafIcon = ` @@ -27,11 +27,11 @@ Created by potrace 1.15, written by Peter Selinger 2001-2017 `; -function getSmallTropyIcon(icon: string, color: string, count: number): string { - const leftXPosition = 2; - const rightXPosition = 73; +function getSmallTrophyIcon(icon: string, color: string, count: number): string { + const leftXPosition = 4; + const rightXPosition = 71; const getIcon = (x: number) => { - return ` + return ` ${icon} ` }; @@ -46,7 +46,7 @@ function getSmallTropyIcon(icon: string, color: string, count: number): string { return '' } -export function getTropyIcon(rank = RANK.UNKNOWN) { +export function getTrophyIcon(rank = RANK.UNKNOWN) { const icon = ` @@ -67,7 +67,7 @@ export function getTropyIcon(rank = RANK.UNKNOWN) { } else if (rank === RANK.B) { color = bronzeColor; } - const optionRankIcon = getSmallTropyIcon(icon, color, rank.length - 1); + const optionRankIcon = getSmallTrophyIcon(icon, color, rank.length - 1); return ` ${backgroundIcon} ${optionRankIcon} diff --git a/src/trophies.ts b/src/trophies.ts index a5062e3..935aacd 100644 --- a/src/trophies.ts +++ b/src/trophies.ts @@ -1,4 +1,4 @@ -import { getTropyIcon } from "./icons.ts"; +import { getTrophyIcon } from "./icons.ts"; import { CONSTANTS, RANK, abridgeScore } from "./utils.ts"; export abstract class Trophy { @@ -31,7 +31,7 @@ export abstract class Trophy { fill="#fff" stroke-opacity="1" /> - ${getTropyIcon(this.rank)} + ${getTrophyIcon(this.rank)} ${this.title} ${this.topMessage} ${this.bottomMessage}