mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
9 lines
388 B
TypeScript
9 lines
388 B
TypeScript
export function calculateExpStyles(exp: number, isSupporter = false) {
|
|
const bgColor = exp > -1 ? (exp < 2 ? '#26B0D9' : `hsl(${-exp * 5 + 100}, 85%, 50%)`) : '#666';
|
|
|
|
const fontColor = exp > 14 || exp == -1 ? 'white' : 'black';
|
|
const boxShadow = isSupporter ? `0 0 6px 2px ${bgColor};` : '';
|
|
|
|
return { 'background-color': bgColor, color: fontColor, 'box-shadow': boxShadow };
|
|
}
|