diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/AssaultRangesVisualizer/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/AssaultRangesVisualizer/index.tsx index c3989b860..69f2133c0 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/AssaultRangesVisualizer/index.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/AssaultRangesVisualizer/index.tsx @@ -1,5 +1,5 @@ import type { AssaultRanges } from '@blitzkit/core'; -import { Box, Card, Flex, Inset, Text } from '@radix-ui/themes'; +import { Box, Card, Flex, Text } from '@radix-ui/themes'; import { clamp } from 'three/src/math/MathUtils.js'; import { Var } from '../../../../../../../core/radix/var'; @@ -7,18 +7,30 @@ interface Props { ranges: AssaultRanges; } -const ASSAULT_RANGE_BAR_HEIGHT = '8rem'; - export function AssaultRangesVisualizer({ ranges }: Props) { return ( - - - - - Assault shell damage - + + + + Assault shell damage + - + + {ranges.ranges.map((range) => ( - {ranges.ranges.map((range, index) => ( - <> + {ranges.ranges.map((range, index) => { + const mix = clamp(1.5 * (range.factor - 1) + 1, 0, 1) * 100; + const color0 = `color-mix(in hsl, ${Var('tomato-9')}, ${Var('jade-9')} ${mix}%)`; + const color1 = `color-mix(in hsl, ${Var('tomato-7')}, ${Var('jade-7')} ${mix}%)`; + + return ( + ); + })} - - + {ranges.ranges.map((range, index) => ( + ))} + + + {ranges.ranges.map((range, index) => ( + + + {range.distance}m + + + ))} + - + ); }