From 3fe41d2071987980cfe472b5d272ec75bbbba88b Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 8 Dec 2021 19:10:44 +0100 Subject: [PATCH] Change hover interactions for mobile --- components/links-list-item.tsx | 9 ++ components/roadmap/home-roadmap-item.tsx | 4 +- pages/index.tsx | 109 +++++++++++++++-------- 3 files changed, 81 insertions(+), 41 deletions(-) diff --git a/components/links-list-item.tsx b/components/links-list-item.tsx index 06aefa826..5577a09e1 100644 --- a/components/links-list-item.tsx +++ b/components/links-list-item.tsx @@ -26,6 +26,15 @@ export function LinksListItem(props: LinksListItemProps) { color='gray.600' alignItems={['flex-start', 'center']} justifyContent={'space-between'} + sx={{ + '@media (hover: none)': { + '&:hover': { + '& .list-item-title': { + transform: 'none' + } + } + } + }} _hover={{ textDecoration: 'none', color: 'blue.400', diff --git a/components/roadmap/home-roadmap-item.tsx b/components/roadmap/home-roadmap-item.tsx index c1e35485e..bed4a6c9a 100644 --- a/components/roadmap/home-roadmap-item.tsx +++ b/components/roadmap/home-roadmap-item.tsx @@ -40,13 +40,13 @@ export function HomeRoadmapItem(props: RoadmapGridItemProps) { href={url} _hover={{ textDecoration: 'none', - bg: 'rgba(255,255,255,.10)' + bg: 'rgba(255,255,255,.10)', }} sx={{ // On mobile devices, don't change the scale '@media (hover: none)': { '&:hover': { - transform: 'scale(1)', + bg: 'rgba(255,255,255,.05)', }, }, }} diff --git a/pages/index.tsx b/pages/index.tsx index 8fb05a162..73ca295fd 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,4 +1,12 @@ -import { Box, Container, Heading, Link, SimpleGrid, Text, useMediaQuery } from '@chakra-ui/react'; +import { + Box, + Container, + Heading, + Link, + SimpleGrid, + Text, + useMediaQuery, +} from '@chakra-ui/react'; import { GlobalHeader } from '../components/global-header'; import { Footer } from '../components/footer'; import { UpdatesBanner } from '../components/updates-banner'; @@ -20,7 +28,7 @@ type HomeProps = { roadmaps: RoadmapType[]; guides: GuideType[]; videos: VideoType[]; -} +}; export default function Home(props: HomeProps) { const { roadmaps, guides, videos } = props; @@ -28,32 +36,47 @@ export default function Home(props: HomeProps) { return ( - + - - - Hey there! 👋 - - roadmap.sh is a community effort to create roadmaps, guides and - other educational content - to help guide the developers in picking up the path and guide their learnings. + + + + Hey there! 👋 + + + + roadmap.sh + {' '} + is a community effort to create roadmaps, guides and other + educational content to help guide the developers in picking up the + path and guide their learnings. - We also have a event({ - category: 'Subscription', - action: 'Clicked the YouTube link', - label: 'YouTube link on home' - })} - target='_blank' - fontWeight={600}>YouTube - channel which we hope you are going to love. + + We also have a{' '} + + event({ + category: 'Subscription', + action: 'Clicked the YouTube link', + label: 'YouTube link on home', + }) + } + target="_blank" + fontWeight={600} + > + YouTube channel + {' '} + which we hope you are going to love. + - + {roadmaps.map((roadmap: RoadmapType, counter: number) => ( - - - - Video Explanations + + + + + Video Explanations + - {videos.map(video => ( + {videos.map((video) => ( } /> ))} - + - - - - Visual Guides + + + + + Visual Guides + - {guides.map(guide => ( + {guides.map((guide) => ( ))} - + @@ -135,7 +166,7 @@ export async function getStaticProps() { props: { roadmaps: getFeaturedRoadmaps(), guides: getAllGuides(10), - videos: getAllVideos(10) - } + videos: getAllVideos(10), + }, }; }