style: Avatar for header and main section. Also fixed header

This commit is contained in:
GiovaniFZ 2025-01-25 22:20:27 -03:00
parent 7864777533
commit 1a475d7b7e
No known key found for this signature in database
GPG Key ID: 63DD92181B575322
5 changed files with 45 additions and 10 deletions

View File

@ -0,0 +1,13 @@
import styled from "styled-components";
export const Avatar = styled.img`
border-radius: 50%;
width: 5rem;
height: 5rem;
`
export const AvatarHeader = styled.img`
border-radius: 50%;
width: 2rem;
height: 2rem;
margin-right: 10px;
`

View File

@ -1,17 +1,21 @@
import { HashRouter } from "react-router-dom"; import { HashRouter } from "react-router-dom";
import { HeaderContainer, NavLink, HomeLink } from "./styles"; import { HeaderContainer, NavLink, HomeLink } from "./styles";
import { AvatarHeader } from "../Avatar/avatar";
export default function Header(){ export default function Header() {
return( return (
<HashRouter> <HashRouter>
<HeaderContainer> <HeaderContainer>
<HomeLink href="/">Giv's Website</HomeLink> <HomeLink href="/">
<AvatarHeader src="https://avatars.githubusercontent.com/u/53719063?v=4" alt="Giv's Gh picture" />
Giv's Website
</HomeLink>
<nav> <nav>
<NavLink href="#about">About Me</NavLink> <NavLink href="#about">About Me</NavLink>
<NavLink href="#contact">Contact</NavLink> <NavLink href="#contact">Contact</NavLink>
<NavLink href="#projects">Projects</NavLink> <NavLink href="#projects">Projects</NavLink>
</nav> </nav>
</HeaderContainer> </HeaderContainer>
</HashRouter> </HashRouter>
) )
} }

View File

@ -1,6 +1,8 @@
import styled from "styled-components"; import styled from "styled-components";
export const HomeLink = styled.a` export const HomeLink = styled.a`
display: flex;
align-items: center;
font-size: 1.5rem; font-size: 1.5rem;
font-weight: bold; font-weight: bold;
color: ${props => props.theme.white}; color: ${props => props.theme.white};
@ -24,7 +26,10 @@ export const NavLink = styled.a`
`; `;
export const HeaderContainer = styled.div` export const HeaderContainer = styled.div`
position: fixed;
display: flex; display: flex;
top: 0;
left: 0;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0 2rem; padding: 0 2rem;

View File

@ -2,8 +2,9 @@ import Typed from 'typed.js';
import { useEffect, useRef } from 'react'; import { useEffect, useRef } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTelegram, faGithub } from '@fortawesome/free-brands-svg-icons'; import { faTelegram, faGithub } from '@fortawesome/free-brands-svg-icons';
import { IconContainer, IconLink, HomeLabel } from './styles'; import { IconContainer, IconLink, HomeLabel, TopSection } from './styles';
import { MainContainer } from '../../components/MainContent/styles'; import { MainContainer } from '../../components/MainContent/styles';
import { Avatar } from '../../components/Avatar/avatar';
export default function Home() { export default function Home() {
const typedElement = useRef(null); const typedElement = useRef(null);
@ -23,9 +24,12 @@ export default function Home() {
return ( return (
<MainContainer> <MainContainer>
<h1> <TopSection>
<span ref={typedElement} /> <Avatar src="https://avatars.githubusercontent.com/u/53719063?v=4" alt="Giv's Gh picture" />
</h1> <strong>
<span ref={typedElement} />
</strong>
</TopSection>
<HomeLabel> <HomeLabel>
Hey, check My social links! Hey, check My social links!
</HomeLabel> </HomeLabel>

View File

@ -18,3 +18,12 @@ export const IconLink = styled.a`
export const HomeLabel = styled.p` export const HomeLabel = styled.p`
margin-top: 1rem; margin-top: 1rem;
`; `;
export const TopSection = styled.div`
display: flex;
align-items: center;
gap: 1rem;
span{
font-size: 2.3rem;
}
`