feat: small tank icon

This commit is contained in:
TrèsAbhi committed 2024-01-12 20:42:10 -06:00
1 parent 163c41f568
commit 0b697a94bd
2 files changed
+35 -8

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import { asset } from '../core/blitzkrieg/asset';
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
src={asset(`icons/tanks/small/${id}.webp`)}
style={{
transform: `scale(${(size / HEIGHT) * 100}%)`,
transformOrigin: 'top left',
}}
/>
</div>
);
}