Skip to content

Commit

Permalink
fix: make day label seem less noisy
Browse files Browse the repository at this point in the history
fading-out the prefix numbers that are there to avoid layout drift helps with understanding what the label is saying (if there are leading zeros, make them less obvious but still take up space)

to achieve this, needed to update the timeline logic to produce an array of digits

this will only work so long as we only have 3 digits to work with but that'll be a wider layout issue anyway to add another prefix digit and.. let's hope we never get there...
  • Loading branch information
sterlingwes committed Jan 29, 2024
1 parent b1dae6d commit c28bafa
Show file tree
Hide file tree
Showing 4 changed files with 542 additions and 113 deletions.
8 changes: 4 additions & 4 deletions site/src/lib/formatting.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const leftPadTwoDigits = (n: number) => {
export const leftPadTwoDigits = (n: number): string[] => {
if (n < 10) {
return `00${n}`;
return `00${n}`.split("");
}

if (n < 100) {
return `0${n}`;
return `0${n}`.split("");
}

return `${n}`;
return `${n}`.split("");
};
Loading

0 comments on commit c28bafa

Please sign in to comment.