Skip to content

Commit

Permalink
Merge branch 'master' into #37-singular-product-page-feature-and-spec…
Browse files Browse the repository at this point in the history
…-section
  • Loading branch information
samgildea committed Apr 16, 2021
2 parents ccab6c6 + 216d6d3 commit 165f947
Show file tree
Hide file tree
Showing 14 changed files with 436 additions and 32 deletions.
8 changes: 8 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,13 @@ module.exports = {
typePathsFilenamePrefix: "prismic-typepaths---powerhouse-site",
},
},
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /vectors/ // See below to configure properly
}
}
}
],
}
101 changes: 101 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
"gatsby": "^2.26.1",
"gatsby-plugin-exclude": "^1.0.2",
"gatsby-plugin-netlify-headers": "^1.0.1",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-sass": "^4.0.2",
"gatsby-source-prismic": "^3.3.3",
"node-sass": "^5.0.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-helmet": "^6.1.0",
"sass": "^1.32.8",
"styled-components": "^5.2.1"
},
Expand Down
1 change: 1 addition & 0 deletions src/components/footer/footer-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const FooterContainer = styled.div`
background-color: #848484;
width: 100%;
color: #ffffff;
position: relative;
`

export const FooterMainContent = styled.div`
Expand Down
85 changes: 85 additions & 0 deletions src/components/header/header-styles.js
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;
}
`
54 changes: 54 additions & 0 deletions src/components/header/header.jsx
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
Loading

0 comments on commit 165f947

Please sign in to comment.