improve item hover animation perf & details

This commit is contained in:
Matt Dunn-Rankin 2020-04-21 20:41:29 -07:00
parent 6ee411fd7b
commit ea4d801b0c

View file

@ -149,37 +149,38 @@ function Item({ item, isWorn, onWear }) {
cursor="pointer"
onClick={onWear}
>
<Flex w="50px" h="50px" mr="3" align="center" justify="center">
<PseudoBox
rounded="full"
border="2px"
boxShadow="md"
border="1px"
borderColor={isWorn ? "green.700" : "gray.400"}
opacity={isWorn ? 1 : 0.7}
width={isWorn ? "50px" : "40px"}
height={isWorn ? "50px" : "40px"}
width="50px"
height="50px"
overflow="hidden"
transition="all 0.2s"
transition="all 0.15s"
transformOrigin="center"
transform={isWorn ? null : "scale(0.8)"}
_groupHover={
!isWorn && {
opacity: 0.9,
transform: "scale(1.1)",
transform: "scale(0.9)",
borderColor: "gray.600",
}
}
>
<Image src={item.thumbnailSrc} />
</PseudoBox>
</Flex>
<PseudoBox
marginLeft="3"
fontSize="md"
fontWeight={isWorn && "bold"}
color={isWorn ? "gray.800" : "gray.600"}
transition="all 0.2s"
transition="all 0.15s"
_groupHover={
!isWorn && {
color: "gray.800",
fontWeight: "medium",
}
}
>