mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: small tank icon
This commit is contained in:
1 parent
163c41f568
commit
0b697a94bd
2 files changed
+35
-8
No files matched your search
@@ -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>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user