mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 21:19:52 +01: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
@@ -6,7 +6,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
Checkbox,
|
|
||||||
Dialog,
|
Dialog,
|
||||||
Flex,
|
Flex,
|
||||||
Heading,
|
Heading,
|
||||||
@@ -19,6 +18,7 @@ import { go } from 'fuzzysort';
|
|||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
import { use, useRef, useState } from 'react';
|
import { use, useRef, useState } from 'react';
|
||||||
import { ModuleButton } from '../../../../../components/ModuleButton';
|
import { ModuleButton } from '../../../../../components/ModuleButton';
|
||||||
|
import { SmallTankIcon } from '../../../../../components/SmallTankIcon';
|
||||||
import {
|
import {
|
||||||
SHELL_NAMES,
|
SHELL_NAMES,
|
||||||
tankDefinitions,
|
tankDefinitions,
|
||||||
@@ -53,8 +53,11 @@ export function VersusBar() {
|
|||||||
<Dialog.Root>
|
<Dialog.Root>
|
||||||
<Dialog.Trigger>
|
<Dialog.Trigger>
|
||||||
<Button variant="ghost">
|
<Button variant="ghost">
|
||||||
{antagonist.tank.name}
|
<Flex gap="2" align="center">
|
||||||
<CaretRightIcon />
|
{antagonist.tank.name}
|
||||||
|
<SmallTankIcon id={antagonist.tank.id} size={16} />
|
||||||
|
<CaretRightIcon />
|
||||||
|
</Flex>
|
||||||
</Button>
|
</Button>
|
||||||
</Dialog.Trigger>
|
</Dialog.Trigger>
|
||||||
|
|
||||||
@@ -250,11 +253,6 @@ export function VersusBar() {
|
|||||||
</Dialog.Root>
|
</Dialog.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="2" align="center">
|
|
||||||
<Checkbox defaultChecked />
|
|
||||||
<Text>Calibrated</Text>
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
<Flex>
|
<Flex>
|
||||||
{antagonist.gun.shells.map((shell, index) => {
|
{antagonist.gun.shells.map((shell, index) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -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