Refactor code structure for improved readability and maintainability
All checks were successful
Build and Push Docker Image / docker (push) Successful in 21s

This commit is contained in:
2025-09-04 21:53:54 +02:00
parent 80f8c4ca90
commit 8c5ca0044f
27 changed files with 3398 additions and 326 deletions

View File

@@ -1,11 +1,11 @@
// Stable distinct color per year for the year badge
export function badgeColorForYear(y) {
const val = (y === undefined || y === null) ? '?' : y;
const val = y === undefined || y === null ? '?' : y;
if (val === '?' || Number.isNaN(Number(val))) {
// Neutral slate for unknown years
return 'background-color: hsl(215 16% 34%);';
}
const n = Number(val);
const hue = ((n * 23) % 360 + 360) % 360; // spread hues deterministically
const hue = (((n * 23) % 360) + 360) % 360; // spread hues deterministically
return `background-color: hsl(${hue} 70% 42%);`;
}