feat: Reminders #44

Merged
Anri merged 54 commits from feat/reminders into main 2023-01-17 12:15:15 +01:00
Showing only changes of commit c6120bf8b4 - Show all commits

View file

@ -146,9 +146,9 @@ async (locales: Map<string, Map<string, string>>, default_lang: string) => {
locales_size.forEach((size, lang) => {
const percentage = (size / max_size) * 100;
// Colored bar part
const blocks = ' '.repeat(percentage / bar_size);
const blocks = ' '.repeat(Math.floor(percentage / bar_size));
// Blank bar part
const blank = ' '.repeat((100 - percentage) / bar_size);
const blank = ' '.repeat(Math.ceil((100 - percentage) / bar_size));
const color = () => {
switch (true) {
case percentage <= 25:
@ -167,7 +167,8 @@ async (locales: Map<string, Map<string, string>>, default_lang: string) => {
return '';
}
};
const padding = ' '.repeat(lang.length === 5 ? 1 : 4);
console.log(`${lang} | ${color()}${blocks}\x1b[0m${blank} | ${percentage.toPrecision(3)}%`);
console.log(`${padding}${lang} | ${color()}${blocks}\x1b[0m${blank} | ${percentage.toPrecision(3)}%`);
});
};