feat: nicer layer penetration indices

This commit is contained in:
TrèsAbhi committed 2024-03-13 17:34:29 -05:00
1 parent 2a169fac34
commit 340d9c2666
1 file changed
+26 -21
+26 -21
View File
@@ -1,4 +1,4 @@
import { Card, Flex, Inset, Text } from '@radix-ui/themes'; import { Card, Flex, Text } from '@radix-ui/themes';
import { Html } from '@react-three/drei'; import { Html } from '@react-three/drei';
import { useFrame } from '@react-three/fiber'; import { useFrame } from '@react-three/fiber';
import { useEffect, useRef } from 'react'; import { useEffect, useRef } from 'react';
@@ -182,33 +182,38 @@ export function ShotDisplay() {
pointerEvents: 'none', pointerEvents: 'none',
}} }}
> >
<Card <div
style={{ style={{
backgroundColor: backgroundColor:
trueStatus === 'penetration' trueStatus === 'penetration'
? '#00ff00c0' ? '#00ff0080'
: trueStatus === 'blocked' : trueStatus === 'blocked'
? '#ff0000c0' ? '#ff000080'
: '#ffff00c0', : '#ffff0080',
borderRadius: 8,
border: 'none', border: 'none',
padding: 4,
width: hasMultipleLayers ? undefined : 8,
height: hasMultipleLayers ? undefined : 8,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}} }}
> >
<Inset> {hasMultipleLayers && (
{hasMultipleLayers && ( <Text
<Text size="2"
style={{ style={{
width: '100%', width: '100%',
display: 'block', display: 'block',
textAlign: 'center', textAlign: 'center',
color: color: trueStatus === 'ricochet' ? 'black' : undefined,
trueStatus === 'ricochet' ? 'black' : undefined, }}
}} >
> <b>{layer.index + 1}</b>
<b>{layer.index + 1}</b> </Text>
</Text> )}
)} </div>
</Inset>
</Card>
</Html> </Html>
</group> </group>
</> </>