mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: better tech tree layout
This commit is contained in:
1 parent
fe98d52c31
commit
e86dc4ecc5
1 file changed
+29
-48
@@ -2,7 +2,6 @@ import { ChevronRightIcon } from '@radix-ui/react-icons';
|
|||||||
import { Box, ChevronDownIcon, Flex, Heading, Text } from '@radix-ui/themes';
|
import { Box, ChevronDownIcon, Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { ComponentProps, use } from 'react';
|
import { ComponentProps, use } from 'react';
|
||||||
import PageWrapper from '../../../../../../components/PageWrapper';
|
|
||||||
import { asset } from '../../../../../../core/blitzkit/asset';
|
import { asset } from '../../../../../../core/blitzkit/asset';
|
||||||
import { tankDefinitions } from '../../../../../../core/blitzkit/tankDefinitions';
|
import { tankDefinitions } from '../../../../../../core/blitzkit/tankDefinitions';
|
||||||
import { TIER_ROMAN_NUMERALS } from '../../../../../../core/blitzkit/tankDefinitions/constants';
|
import { TIER_ROMAN_NUMERALS } from '../../../../../../core/blitzkit/tankDefinitions/constants';
|
||||||
@@ -126,34 +125,40 @@ export function TechTreeSection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrapper
|
<Flex
|
||||||
noFlex1
|
p="5"
|
||||||
containerProps={{
|
style={{
|
||||||
style: {
|
overflow: 'hidden',
|
||||||
overflow: 'hidden',
|
backgroundColor: 'var(--color-surface)',
|
||||||
marginTop: 16,
|
|
||||||
backgroundColor: 'var(--color-surface)',
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
size={tank.ancestors && tank.successors ? 880 : 480}
|
align="center"
|
||||||
gap="0"
|
direction="column"
|
||||||
|
position="relative"
|
||||||
>
|
>
|
||||||
<Flex justify="center" py="2" mb="4">
|
<img
|
||||||
<Heading>Tech tree</Heading>
|
src={asset(`flags/scratched/${tank.nation}.webp`)}
|
||||||
</Flex>
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: '50%',
|
||||||
|
left: '50%',
|
||||||
|
transform: 'translate(-40%, -50%)',
|
||||||
|
filter: 'blur(2px)',
|
||||||
|
opacity: 0.25,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Heading mb="4">Tech tree</Heading>
|
||||||
|
|
||||||
<Flex align="center" gap="6" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex align="center" gap="6" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
{tank.ancestors && (
|
{tank.ancestors && (
|
||||||
<>
|
<>
|
||||||
<Flex
|
<Flex
|
||||||
wrap="wrap"
|
wrap="wrap"
|
||||||
direction={{ initial: 'column', sm: 'row' }}
|
direction={{ initial: 'row', sm: 'column' }}
|
||||||
|
maxHeight={{ initial: 'unset', sm: '320px' }}
|
||||||
align="center"
|
align="center"
|
||||||
justify="center"
|
justify="center"
|
||||||
style={{
|
gap="6"
|
||||||
maxHeight: 360,
|
|
||||||
}}
|
|
||||||
gap="4"
|
|
||||||
>
|
>
|
||||||
{tank.ancestors.map((id) => (
|
{tank.ancestors.map((id) => (
|
||||||
<Card key={id} id={id} />
|
<Card key={id} id={id} />
|
||||||
@@ -169,29 +174,7 @@ export function TechTreeSection() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Flex
|
<Card id={tank.id} />
|
||||||
direction="column"
|
|
||||||
style={{
|
|
||||||
position: 'relative',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
alt={tank.nation}
|
|
||||||
src={asset(`flags/scratched/${tank.nation}.webp`)}
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: '50%',
|
|
||||||
left: '50%',
|
|
||||||
height: '200%',
|
|
||||||
transform: 'translate(-40%, -50%)',
|
|
||||||
backgroundRepeat: 'no-repeat',
|
|
||||||
opacity: 1 / 4,
|
|
||||||
filter: 'blur(4px)',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Card id={tank.id} />
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
{tank.successors && (
|
{tank.successors && (
|
||||||
<>
|
<>
|
||||||
@@ -204,13 +187,11 @@ export function TechTreeSection() {
|
|||||||
|
|
||||||
<Flex
|
<Flex
|
||||||
wrap="wrap"
|
wrap="wrap"
|
||||||
direction={{ initial: 'column', sm: 'row' }}
|
direction={{ initial: 'row', sm: 'column' }}
|
||||||
|
maxHeight={{ initial: 'unset', sm: '320px' }}
|
||||||
align="center"
|
align="center"
|
||||||
justify="center"
|
justify="center"
|
||||||
style={{
|
gap="6"
|
||||||
maxHeight: 360,
|
|
||||||
}}
|
|
||||||
gap="4"
|
|
||||||
>
|
>
|
||||||
{tank.successors.map((id) => (
|
{tank.successors.map((id) => (
|
||||||
<Card key={id} id={id} />
|
<Card key={id} id={id} />
|
||||||
@@ -219,6 +200,6 @@ export function TechTreeSection() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
</PageWrapper>
|
</Flex>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user