-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into #37-singular-product-page-feature-and-spec…
…-section
- Loading branch information
Showing
14 changed files
with
436 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import styled from "styled-components" | ||
import dimensions from "../../style/dimensions" | ||
import colors from "../../style/colors" | ||
|
||
export const NavContainer = styled.div` | ||
z-index: 1; | ||
padding-bottom: 32px; | ||
&.colorChange { | ||
background-color: rgb(0, 0, 0, 0.55); | ||
color: ${colors.white900}; | ||
} | ||
position: fixed; | ||
width: 100%; | ||
transition: 0.5s all ease; | ||
color: ${colors.black900}; | ||
&.home-header { | ||
color: ${colors.white900}; | ||
} | ||
` | ||
|
||
export const Logo = styled.div` | ||
font-weight: bold; | ||
font-size: 24px; | ||
padding-top: 32px; | ||
padding-left: 80px; | ||
color: ${colors.black900}; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
text-align: center; | ||
font-size: 20px; | ||
padding-top: 24px; | ||
padding-left: 0px; | ||
} | ||
&.home-header { | ||
color: ${colors.white900}; | ||
} | ||
` | ||
|
||
export const NavLinks = styled.div` | ||
position: absolute; | ||
right: 80px; | ||
top: 40px; | ||
display: flex; | ||
color: ${colors.black900}; | ||
&.home-header { | ||
a { | ||
color: ${colors.white900}; | ||
} | ||
} | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
display: none; | ||
} | ||
` | ||
|
||
export const NavLink = styled.a` | ||
font-weight: bold; | ||
padding-left: 100px; | ||
text-decoration: none; | ||
color: ${colors.black900}; | ||
&.home-header { | ||
color: ${colors.white900}; | ||
} | ||
` | ||
|
||
export const MobileIcon = styled.div` | ||
@media (min-width: ${dimensions.maxwidthTablet}px) { | ||
display: none; | ||
} | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
left: 24px; | ||
top: 32px; | ||
position: absolute; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, { useState } from "react" | ||
import Hamburger from "../../vectors/hamburger.svg" | ||
import { | ||
NavContainer, | ||
Logo, | ||
MobileIcon, | ||
NavLinks, | ||
NavLink, | ||
} from "./header-styles" | ||
|
||
import { NavText } from "../../style/type-styles" | ||
|
||
export const Header = ({ home }) => { | ||
const [open, setOpen] = useState(false) | ||
const [colorChange, setColorchange] = useState(false) | ||
const changeNavbarColor = () => { | ||
if (typeof window !== "undefined" && window.scrollY >= 80) { | ||
setColorchange(true) | ||
} else { | ||
setColorchange(false) | ||
} | ||
} | ||
typeof window !== "undefined" && | ||
window.addEventListener("scroll", changeNavbarColor) | ||
return ( | ||
<NavContainer | ||
className={ | ||
(colorChange ? "navbar colorChange" : "navbar") || | ||
(home === true ? "home-header" : "") | ||
} | ||
> | ||
<Logo alt="PowerHouse Logo" className={home === true ? "home-header" : ""}>PowerHouse</Logo> | ||
|
||
<MobileIcon onClick={() => setOpen(!open)} className={open ? "open" : ""}> | ||
<Hamburger className="hamburger" /> | ||
</MobileIcon> | ||
<NavLinks className={home === true ? "home-header" : ""}> | ||
<NavLink href="/about"> | ||
<NavText>ABOUT</NavText> | ||
</NavLink> | ||
<NavLink href="/process"> | ||
<NavText>PROCESS</NavText> | ||
</NavLink> | ||
<NavLink href="/products"> | ||
<NavText>PRODUCTS</NavText> | ||
</NavLink> | ||
<NavLink href="/UseCases"> | ||
<NavText>SOLUTIONS</NavText> | ||
</NavLink> | ||
</NavLinks> | ||
</NavContainer> | ||
) | ||
} | ||
export default Header |
Oops, something went wrong.