22 lines
920 B
TypeScript
22 lines
920 B
TypeScript
export class AchievementDisplay {
|
|
static getRarityColor(rarity: string) {
|
|
switch (rarity.toLowerCase()) {
|
|
case 'common':
|
|
return { text: 'text-gray-400', surface: 'muted' as const, icon: '#9ca3af' };
|
|
case 'rare':
|
|
return { text: 'text-primary-blue', surface: 'gradient-blue' as const, icon: '#3b82f6' };
|
|
case 'epic':
|
|
return { text: 'text-purple-400', surface: 'gradient-purple' as const, icon: '#a855f7' };
|
|
case 'legendary':
|
|
return { text: 'text-yellow-400', surface: 'gradient-gold' as const, icon: '#facc15' };
|
|
default:
|
|
return { text: 'text-gray-400', surface: 'muted' as const, icon: '#9ca3af' };
|
|
}
|
|
}
|
|
|
|
static formatDate(date: Date): string {
|
|
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
return `${months[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;
|
|
}
|
|
}
|