diff --git a/src/components/AboutSection.tsx b/src/components/AboutSection.tsx index 8813aed..76b6e31 100644 --- a/src/components/AboutSection.tsx +++ b/src/components/AboutSection.tsx @@ -13,13 +13,14 @@ function AboutSection() { -
+

MYSELF

+ +
test
-

test

); } diff --git a/src/components/LandingSection.tsx b/src/components/LandingSection.tsx index 6da1f21..448a6f6 100644 --- a/src/components/LandingSection.tsx +++ b/src/components/LandingSection.tsx @@ -3,7 +3,7 @@ import { StyledBrandName, StyledLanding, StyledLandingWrapper } from './styles/L export default function LandingSection() { return ( - + diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 22248e0..5108f6a 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -12,6 +12,14 @@ interface NavLink { href: string; } +function scrollToSection(e: React.MouseEvent, href: string) { + e.preventDefault(); + + document.querySelector(href)!.scrollIntoView({ + behavior: 'smooth', + }); +} + function NavlinkList(props: { navlinks: NavLink[] }) { const { t } = useTranslation(); @@ -19,7 +27,7 @@ function NavlinkList(props: { navlinks: NavLink[] }) { <> {props.navlinks.map((navlink) => ( - + scrollToSection(e, navlink.href)}> {t(`navbar.${navlink.title}`)} ))} @@ -68,7 +76,9 @@ export default function Navbar() { return ( - {t('navbar.title')} + scrollToSection(e, '#landing')}> + {t('navbar.title')} + ); diff --git a/src/components/styles/Global.styled.ts b/src/components/styles/Global.styled.ts index 35beced..e4a6956 100644 --- a/src/components/styles/Global.styled.ts +++ b/src/components/styles/Global.styled.ts @@ -32,7 +32,7 @@ export const GlobalStyles = createGlobalStyle` section { min-height: 100vh; - padding: 1em 2em; + padding: 3.5em 2em; } a { diff --git a/src/components/styles/Navbar.styled.ts b/src/components/styles/Navbar.styled.ts index 20621dc..b163c8c 100644 --- a/src/components/styles/Navbar.styled.ts +++ b/src/components/styles/Navbar.styled.ts @@ -1,16 +1,20 @@ import { styled } from 'styled-components'; export const StyledNavbar = styled.nav` + position: sticky; + top: 0; + display: flex; justify-content: space-between; align-items: center; height: 3.5em; color: white; + background-color: ${({ theme }) => theme.colors.nav}; padding: 0.75em 2em; `; -export const StyledNavlinkBrand = styled.div` +export const StyledNavlinkBrand = styled.a` opacity: 0.85; font-weight: 700; color: ${({ theme }) => theme.colors.primary}; diff --git a/src/theme.ts b/src/theme.ts index 09cbcab..3b52455 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -2,6 +2,7 @@ export const theme = { colors: { primary: 'lightseagreen', bg: '#242424', + nav: '#1b1b1b', }, fonts: { primary: 'Inter, system-ui, Arial, sans-serif',