Skip to content

Commit 9da65ac

Browse files
committed
"Update Home.js for responsive social media icons and styling enhancements"
1 parent 5ce6339 commit 9da65ac

File tree

1 file changed

+49
-54
lines changed

1 file changed

+49
-54
lines changed

react-temp/src/pages/Home.js

Lines changed: 49 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const ProfileCardContainer = styled.div`
7373
max-width: 320px;
7474
margin: 0 auto;
7575
perspective: 1000px;
76+
position: relative;
7677
`;
7778

7879
const ProfileCard = styled.div`
@@ -283,37 +284,36 @@ const SocialLinks = styled.div`
283284
top: 50%;
284285
transform: translateY(-50%);
285286
286-
@media (max-width: 1024px) {
287-
position: relative;
288-
left: 0;
289-
transform: none;
287+
@media (max-width: 768px) {
288+
position: static;
290289
flex-direction: row;
291290
justify-content: center;
292291
margin: 1rem 0;
293292
}
294293
`;
295294

296-
const SocialIcon = styled.a`
295+
const SocialLink = styled.a`
297296
color: ${({ theme }) => theme.text};
298297
font-size: 1.5rem;
299-
transition: all 0.3s ease;
298+
transition: color 0.3s ease;
300299
display: flex;
301300
align-items: center;
302-
gap: 0.5rem;
301+
justify-content: center;
302+
width: 2.5rem;
303+
height: 2.5rem;
304+
border-radius: 50%;
305+
background: ${({ theme }) => theme.primary};
306+
border: 1px solid ${({ theme }) => theme.border};
303307
304308
&:hover {
305-
color: ${({ theme }) => theme.link};
306-
transform: translateY(-2px);
307-
}
308-
309-
span {
310-
font-size: 0.9rem;
311-
opacity: 0;
312-
transition: opacity 0.3s ease;
309+
color: ${({ theme }) => theme.primary};
310+
background: ${({ theme }) => theme.link};
313311
}
314312
315-
&:hover span {
316-
opacity: 1;
313+
@media (max-width: 767px) {
314+
width: 2rem;
315+
height: 2rem;
316+
font-size: 1.2rem;
317317
}
318318
`;
319319

@@ -626,45 +626,40 @@ const Home = () => {
626626
<HomeGrid>
627627
<Column>
628628
<ProfileSection>
629-
<SocialLinks>
630-
<SocialIcon href={homeContent.profile.socialLinks.github} target="_blank" rel="noopener noreferrer">
631-
<i className="fab fa-github"></i>
632-
<span>GitHub</span>
633-
</SocialIcon>
634-
<SocialIcon href={homeContent.profile.socialLinks.linkedin} target="_blank" rel="noopener noreferrer">
635-
<i className="fab fa-linkedin"></i>
636-
<span>LinkedIn</span>
637-
</SocialIcon>
638-
<SocialIcon href={homeContent.profile.socialLinks.instagram} target="_blank" rel="noopener noreferrer">
639-
<i className="fab fa-instagram"></i>
640-
<span>Instagram</span>
641-
</SocialIcon>
642-
<SocialIcon href={`mailto:${homeContent.profile.socialLinks.email}`}>
643-
<i className="fas fa-envelope"></i>
644-
<span>Email</span>
645-
</SocialIcon>
646-
</SocialLinks>
647-
629+
<ProfileCardContainer>
630+
<SocialLinks>
631+
<SocialLink href={homeContent.profile.socialLinks.github} target="_blank" rel="noopener noreferrer">
632+
<i className="fab fa-github"></i>
633+
</SocialLink>
634+
<SocialLink href={homeContent.profile.socialLinks.linkedin} target="_blank" rel="noopener noreferrer">
635+
<i className="fab fa-linkedin"></i>
636+
</SocialLink>
637+
<SocialLink href={homeContent.profile.socialLinks.instagram} target="_blank" rel="noopener noreferrer">
638+
<i className="fab fa-instagram"></i>
639+
</SocialLink>
640+
<SocialLink href={`mailto:${homeContent.profile.socialLinks.email}`}>
641+
<i className="fas fa-envelope"></i>
642+
</SocialLink>
643+
</SocialLinks>
644+
<ProfileCard isFlipped={isFlipped} onClick={handleCardClick}>
645+
<CardFront>
646+
<img
647+
src={homeContent.profile.images.front}
648+
alt="Rohit in Berlin"
649+
onClick={(e) => handleImageClick(e, homeContent.profile.images.front)}
650+
/>
651+
</CardFront>
652+
<CardBack>
653+
<img
654+
src={homeContent.profile.images.back}
655+
alt="Coder"
656+
onClick={(e) => handleImageClick(e, homeContent.profile.images.back)}
657+
/>
658+
</CardBack>
659+
</ProfileCard>
660+
</ProfileCardContainer>
648661
<ProfileInfo>
649662
<p>{homeContent.profile.title}</p>
650-
<ProfileCardContainer>
651-
<ProfileCard isFlipped={isFlipped} onClick={handleCardClick}>
652-
<CardFront>
653-
<img
654-
src={homeContent.profile.images.front}
655-
alt="Rohit in Berlin"
656-
onClick={(e) => handleImageClick(e, homeContent.profile.images.front)}
657-
/>
658-
</CardFront>
659-
<CardBack>
660-
<img
661-
src={homeContent.profile.images.back}
662-
alt="Coder"
663-
onClick={(e) => handleImageClick(e, homeContent.profile.images.back)}
664-
/>
665-
</CardBack>
666-
</ProfileCard>
667-
</ProfileCardContainer>
668663
</ProfileInfo>
669664

670665
<ResumeLinks>

0 commit comments

Comments
 (0)