Files
blitzkit/src/components/SmallTankIcon.tsx
T

30 lines
608 B
TypeScript
Raw Normal View History

2024-04-23 09:57:59 -05:00
import { asset } from '../core/blitzkit/asset';
2024-01-12 20:42:10 -06:00
interface SmallTankIconProps {
id: number;
size?: number;
}
const WIDTH = 70;
const HEIGHT = 24;
export function SmallTankIcon({ id, size = HEIGHT }: SmallTankIconProps) {
return (
<div
style={{
height: size,
overflow: 'hidden',
width: WIDTH * (size / HEIGHT),
}}
>
<img
2024-05-04 16:28:12 -05:00
alt={`Tank ${id}`}
2024-01-12 20:42:10 -06:00
src={asset(`icons/tanks/small/${id}.webp`)}
style={{
transform: `scale(${(size / HEIGHT) * 100}%)`,
transformOrigin: 'top left',
}}
/>
</div>
);
}