diff --git a/src/components/Container/styles.tsx b/src/components/Container/styles.tsx index 7c6616c..6217b65 100644 --- a/src/components/Container/styles.tsx +++ b/src/components/Container/styles.tsx @@ -3,10 +3,13 @@ import styled from "styled-components" export const ContainerWrapper = styled.div` display: flex; flex-direction: column; - padding: 0 32px; + /* the 172px is necessary because the logo is offset by that much */ + /* this ensures the logo never goes off screen */ + /* TODO: most likely extract this number */ + padding: 0 calc(172px + 32px); margin: 0 auto; width: 100%; - max-width: 1015px; + max-width: 800px; & > :first-child { margin-top: 0; diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx new file mode 100644 index 0000000..aebd2b4 --- /dev/null +++ b/src/components/Header/index.tsx @@ -0,0 +1,33 @@ +import React, { PropsWithChildren } from "react" +import { Container } from "../Container" +import logo from "../../images/tph-logo.png" +import * as SC from "./styles" + +function MenuItem({ children, to }: PropsWithChildren<{ to: string }>) { + return ( + + {children} + + ) +} + +export function Header() { + return ( + + + + + + + about + rules + faq + hotbot + documentation + tech spotlight + + + + + ) +} diff --git a/src/components/Header/styles.tsx b/src/components/Header/styles.tsx new file mode 100644 index 0000000..e0970c7 --- /dev/null +++ b/src/components/Header/styles.tsx @@ -0,0 +1,83 @@ +import { Link } from "gatsby" +import styled from "styled-components" + +export const HeaderWrapper = styled.header`` + +export const InnerWrapper = styled.div` + position: relative; + display: flex; + align-items: center; + height: 122px; +` + +export const Logo = styled.img` + position: absolute; + margin-right: 50px; + left: calc(-122px - 50px); + width: 122px; + height: 122px; +` + +export const Menu = styled.nav` + margin-top: 16px; + display: flex; + align-items: flex-start; +` + +export const MenuItem = styled(Link)` + display: flex; + align-items: center; + font-size: 22px; + text-decoration: none; + color: #555; + position: relative; + transition: color 0.3s; + + /* underline bar, getting animated through hover */ + &::after { + z-index: -1; + position: absolute; + content: ""; + height: 2px; + width: 100%; + margin-top: -3px; + bottom: 0; + background: #555; + transition: all 0.3s; + } + + &:hover { + color: #fff; + } + + &:hover::after { + padding: 8px; + height: 100%; + background: #000; + box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1), 0 5px 11px rgba(0, 0, 0, 0.25); + margin-left: -8px; + margin-bottom: -8px; + border-radius: 3px; + } + + &.active { + font-weight: 700; + color: #d33636; + + &::after { + background: #d33636; + } + + &:hover { + color: #fff; + } + + &:hover::after { + background: #d33636; + } + } + + & + & { + margin-left: 48px; + } +` diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 796e261..bd7c76f 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -10,7 +10,7 @@ import { useStaticQuery, graphql } from "gatsby" import { Container } from "../Container" import { Footer } from "../Footer" -import { Sidebar } from "../Sidebar" +import { Header } from "../Header" import "./layout.scss" import * as SC from "./styles" import Scrollbar from "react-perfect-scrollbar" @@ -29,15 +29,15 @@ export function Layout({ children }: PropsWithChildren<{}>) { return ( - - - - + +
+ +

{data.site.siteMetadata.title}

{children} -
- - + + +