Fix broken hover state on mobile

pull/1331/head
Kamran Ahmed 3 years ago
parent 5733476fd9
commit dbedae78ca
  1. 14
      components/roadmap/home-roadmap-item.tsx
  2. 12
      pages/index.tsx

@ -31,7 +31,19 @@ export function HomeRoadmapItem(props: RoadmapGridItemProps) {
<Box <Box
as={Link} as={Link}
href={url} href={url}
_hover={{ textDecoration: 'none', transform: 'scale(1.02)', opacity: '1 !important' }} _hover={{
textDecoration: 'none',
transform: 'scale(1.02)',
opacity: '1 !important'
}}
sx={{
// On mobile devices, don't change the scale
'@media (hover: none)': {
'&:hover': {
transform: 'scale(1)'
}
}
}}
flex={1} flex={1}
shadow='2xl' shadow='2xl'
className={'home-roadmap-item'} className={'home-roadmap-item'}

@ -1,4 +1,4 @@
import { Box, Container, Heading, Link, SimpleGrid, Text } from '@chakra-ui/react'; import { Box, Container, Heading, Link, SimpleGrid, Text, useMediaQuery } from '@chakra-ui/react';
import { GlobalHeader } from '../components/global-header'; import { GlobalHeader } from '../components/global-header';
import { Footer } from '../components/footer'; import { Footer } from '../components/footer';
import { UpdatesBanner } from '../components/updates-banner'; import { UpdatesBanner } from '../components/updates-banner';
@ -53,6 +53,16 @@ export default function Home(props: HomeProps) {
<SimpleGrid <SimpleGrid
columns={[1, 2, 3]} columns={[1, 2, 3]}
spacing={['10px', '10px', '15px']} spacing={['10px', '10px', '15px']}
sx={{
// Don't change the opacity on mobile devices
'@media (hover: none)': {
'&:hover': {
'.home-roadmap-item': {
opacity: 1
}
}
}
}}
_hover={{ '& .home-roadmap-item': { opacity: '0.5'} }} _hover={{ '& .home-roadmap-item': { opacity: '0.5'} }}
> >
{roadmaps.map((roadmap: RoadmapType, counter: number) => ( {roadmaps.map((roadmap: RoadmapType, counter: number) => (

Loading…
Cancel
Save