Spaces:
Running
Running
File size: 632 Bytes
542c765 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | // OWNER: Member 3
// Health bar — CSS liquid fill animation (uses .health-bar-inner from globals.css)
// percent: 0-100, driven by avatarLevel / 5 * 100
interface HealthBarProps {
percent: number
color?: string
}
export default function HealthBar({ percent, color = "#22c55e" }: HealthBarProps) {
// TODO Member 3: implement with CSS animation + shimmer
return (
<div className="w-full h-5 bg-slate-700 rounded-full overflow-hidden">
<div
className="h-full rounded-full transition-all duration-1000"
style={{ width: `${Math.min(percent, 100)}%`, background: color }}
/>
</div>
)
}
|