mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: large tank icons
This commit is contained in:
1 parent
3f8c2ba322
commit
def470e805
3 files changed
+19
-13
No files matched your search
@@ -6,7 +6,6 @@ import {
|
|||||||
IconButton,
|
IconButton,
|
||||||
Link,
|
Link,
|
||||||
Text,
|
Text,
|
||||||
Theme,
|
|
||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import { use } from 'react';
|
import { use } from 'react';
|
||||||
import { asset } from '../../../../../../../core/blitzkit/asset';
|
import { asset } from '../../../../../../../core/blitzkit/asset';
|
||||||
@@ -38,6 +37,7 @@ function ModuleButton({
|
|||||||
notation: 'compact',
|
notation: 'compact',
|
||||||
maximumFractionDigits: 0,
|
maximumFractionDigits: 0,
|
||||||
});
|
});
|
||||||
|
const isTank = unlock.type === 'vehicle';
|
||||||
const button = (
|
const button = (
|
||||||
<IconButton
|
<IconButton
|
||||||
size="4"
|
size="4"
|
||||||
@@ -47,6 +47,8 @@ function ModuleButton({
|
|||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
style={{
|
style={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
|
width: isTank ? 72 : undefined,
|
||||||
|
height: isTank ? 72 : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
@@ -54,8 +56,8 @@ function ModuleButton({
|
|||||||
color="gray"
|
color="gray"
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 4,
|
left: isTank ? 8 : 4,
|
||||||
top: 4,
|
top: isTank ? 8 : 4,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{TIER_ROMAN_NUMERALS[tier]}
|
{TIER_ROMAN_NUMERALS[tier]}
|
||||||
@@ -70,6 +72,7 @@ function ModuleButton({
|
|||||||
transform: 'translateX(-50%)',
|
transform: 'translateX(-50%)',
|
||||||
}}
|
}}
|
||||||
align="center"
|
align="center"
|
||||||
|
gap={isTank ? '1' : undefined}
|
||||||
>
|
>
|
||||||
<Text size="1" color="gray">
|
<Text size="1" color="gray">
|
||||||
{numberFormat.format(unlock.cost.value)}
|
{numberFormat.format(unlock.cost.value)}
|
||||||
@@ -90,23 +93,21 @@ function ModuleButton({
|
|||||||
<img
|
<img
|
||||||
alt={unlock.type}
|
alt={unlock.type}
|
||||||
src={
|
src={
|
||||||
unlock.type === 'vehicle'
|
isTank
|
||||||
? tankIcon(unlock.id)
|
? tankIcon(unlock.id)
|
||||||
: asset(`icons/modules/${unlock.type}.webp`)
|
: asset(`icons/modules/${unlock.type}.webp`)
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
width: 32,
|
width: isTank ? 64 : 32,
|
||||||
height: 32,
|
height: isTank ? 64 : 32,
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
);
|
);
|
||||||
|
|
||||||
return unlock.type === 'vehicle' ? (
|
return isTank ? (
|
||||||
<Link href={`/tools/tankopedia/${unlock.id}`}>
|
<Link href={`/tools/tankopedia/${unlock.id}`}>{button}</Link>
|
||||||
<Theme scaling="110%">{button}</Theme>
|
|
||||||
</Link>
|
|
||||||
) : (
|
) : (
|
||||||
button
|
button
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { Provisions } from '../Characteristics/components/Provisions';
|
|||||||
import { Skills } from '../Characteristics/components/Skills';
|
import { Skills } from '../Characteristics/components/Skills';
|
||||||
|
|
||||||
export function CharacteristicsSection() {
|
export function CharacteristicsSection() {
|
||||||
const wideFormat = useWideFormat(700);
|
const wideFormat = useWideFormat(880);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
@@ -27,7 +27,7 @@ export function CharacteristicsSection() {
|
|||||||
direction={wideFormat ? 'row' : 'column'}
|
direction={wideFormat ? 'row' : 'column'}
|
||||||
justify="center"
|
justify="center"
|
||||||
>
|
>
|
||||||
<Flex style={{ flex: 1, maxWidth: 380 }} direction="column" gap="4">
|
<Flex direction="column" gap="4">
|
||||||
<Heading>Configure</Heading>
|
<Heading>Configure</Heading>
|
||||||
<Modules />
|
<Modules />
|
||||||
<Equipment />
|
<Equipment />
|
||||||
|
|||||||
@@ -24,7 +24,12 @@ export function ConsumablesManager({
|
|||||||
hasHighEndConsumables,
|
hasHighEndConsumables,
|
||||||
}: ConsumablesManagerProps) {
|
}: ConsumablesManagerProps) {
|
||||||
return (
|
return (
|
||||||
<Flex wrap="wrap">
|
<Flex
|
||||||
|
wrap="wrap"
|
||||||
|
style={{
|
||||||
|
maxWidth: 360,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{consumables.map((consumable, index) => {
|
{consumables.map((consumable, index) => {
|
||||||
const isSelected = selected.some((id) => id === consumable.id);
|
const isSelected = selected.some((id) => id === consumable.id);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user