a
This commit is contained in:
parent
f300641dd3
commit
5c04d3da51
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.4 MiB |
@ -6,7 +6,9 @@ import {
|
|||||||
Badge,
|
Badge,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
HStack,
|
HStack,
|
||||||
Image
|
Image,
|
||||||
|
Flex,
|
||||||
|
AspectRatio
|
||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
import { useGameStore } from '../store/gameStore'
|
import { useGameStore } from '../store/gameStore'
|
||||||
|
|
||||||
@ -92,30 +94,51 @@ export function BuildingButton({
|
|||||||
borderColor="gray.600"
|
borderColor="gray.600"
|
||||||
>
|
>
|
||||||
<VStack align="stretch" spacing={2}>
|
<VStack align="stretch" spacing={2}>
|
||||||
<Box display="flex" justifyContent="space-between" alignItems="center">
|
{/* Image with overlapping title and stats */}
|
||||||
<Text fontWeight="bold">{title}</Text>
|
<Box position="relative">
|
||||||
<HStack>
|
<AspectRatio ratio={1} w="100%">
|
||||||
<Text>Owned: {owned}</Text>
|
<Box
|
||||||
<Text>Level: {level}</Text>
|
borderRadius="md"
|
||||||
</HStack>
|
overflow="hidden"
|
||||||
</Box>
|
>
|
||||||
|
<Image
|
||||||
|
src={buildingImages[buildingType as keyof typeof buildingImages]}
|
||||||
|
alt={title}
|
||||||
|
objectFit="cover"
|
||||||
|
w="100%"
|
||||||
|
h="100%"
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</AspectRatio>
|
||||||
|
|
||||||
{/* Add the building image */}
|
{/* Overlay for title */}
|
||||||
<Box
|
<Box
|
||||||
display="flex"
|
position="absolute"
|
||||||
justifyContent="center"
|
top="0"
|
||||||
bg="gray.800"
|
left="0"
|
||||||
borderRadius="md"
|
p={2}
|
||||||
p={2}
|
bg="blackAlpha.700"
|
||||||
height="120px"
|
borderTopLeftRadius="md"
|
||||||
overflow="hidden"
|
borderBottomRightRadius="md"
|
||||||
>
|
>
|
||||||
<Image
|
<Text fontWeight="bold" fontSize="md">{title}</Text>
|
||||||
src={buildingImages[buildingType as keyof typeof buildingImages]}
|
</Box>
|
||||||
alt={title}
|
|
||||||
objectFit="contain"
|
{/* Overlay for owned and level */}
|
||||||
maxHeight="100%"
|
<Box
|
||||||
/>
|
position="absolute"
|
||||||
|
bottom="0"
|
||||||
|
right="0"
|
||||||
|
p={2}
|
||||||
|
bg="blackAlpha.700"
|
||||||
|
borderTopLeftRadius="md"
|
||||||
|
borderBottomRightRadius="md"
|
||||||
|
>
|
||||||
|
<HStack spacing={3}>
|
||||||
|
<Text fontSize="sm">Owned: {owned}</Text>
|
||||||
|
<Text fontSize="sm">Level: {level}</Text>
|
||||||
|
</HStack>
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Text fontSize="sm" color="gray.400">{description}</Text>
|
<Text fontSize="sm" color="gray.400">{description}</Text>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user