Skip to content

Commit

Permalink
Merge branch 'master' into #38-our-impact-section
Browse files Browse the repository at this point in the history
  • Loading branch information
samgildea committed Apr 6, 2021
2 parents 0712203 + 80696ce commit cc5e2eb
Show file tree
Hide file tree
Showing 10 changed files with 259 additions and 8 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
}
}
}
],
}
80 changes: 80 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"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",
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
50 changes: 50 additions & 0 deletions src/components/header/header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 = () => {
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"}>
<Logo>PowerHouse</Logo>

<MobileIcon onClick={() => setOpen(!open)} className={open ? "open" : ""}>
<Hamburger />
</MobileIcon>
<NavLinks>
<NavLink href="/about">
<NavText>ABOUT</NavText>
</NavLink>
<NavLink href="/process">
<NavText>PROCESS</NavText>
</NavLink>
<NavLink href="/products">
<NavText>PRODUCTS</NavText>
</NavLink>
<NavLink href="/solutions">
<NavText>SOLUTIONS</NavText>
</NavLink>
</NavLinks>
</NavContainer>
)
}
export default Header
77 changes: 76 additions & 1 deletion src/components/homepage/index-styles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from "styled-components"
import dimensions from "../../style/dimensions"

import {
layoutPaddingDesktop,
layoutPaddingMobile,
Expand Down Expand Up @@ -43,7 +44,6 @@ export const HeroCTA = styled.div`
padding-bottom: 16px;
}
`
export const HomePageContainer = styled.div``

export const ImpactSection = styled.div`
@media (min-width: ${dimensions.maxwidthTablet}px) {
Expand Down Expand Up @@ -91,3 +91,78 @@ export const ImpactStatIcon = styled.div`
margin-left: auto;
margin-right: auto;
`

export const FutureSection = styled.div`
height: 100vh;
position: relative;
padding-top: 64px;
@media (min-width: ${dimensions.maxwidthTablet}px) {
display: flex;
align-items: center;
padding-top: 0px;
}
`

export const FutureText = styled.div``

export const FutureImage = styled.div`
background-color: ${colors.gray_icon};
width: 100%;
height: 450px;
margin-top: 80px;
@media (min-width: ${dimensions.maxwidthTablet}px) {
position: absolute;
right: 0;
width: 42vw;
height: 768px;
}
`

export const FutureHeader = styled.div`
font-weight: bold;
@media (min-width: ${dimensions.maxwidthTablet}px) {
}
`

export const FutureSolarIcon = styled.div`
width: 64px;
height: 64px;
border-radius: 8px;
background-color: ${colors.gray_icon};
margin-bottom: 48px;
`

export const FutureDescription = styled.div`
margin-top: 32px;
font-size: 18px;
@media (max-width: ${dimensions.maxwidthTablet}px) {
font-size: 16px;
}
`
export const FutureCTA = styled.div`
margin-top: 64px;
a {
padding-right: 60px;
padding-left: 60px;
padding-top: 16px;
padding-bottom: 16px;
border: solid ${colors.gray_CTA}; 1px;
font-size: 16px;
font-weight: bold;
text-decoration: none;
text-transform: uppercase;
color: ${colors.gray_CTA};
}
`

export const HomePageContainer = styled.div`
position: relative;
z-index: 0;
`
26 changes: 25 additions & 1 deletion src/components/homepage/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { H1, H2, P } from "../../style/type-styles"
import { H1, P, H2 } from "../../style/type-styles"
import {
HomePageContainer,
HeroContainer,
Expand All @@ -14,6 +14,13 @@ import {
ImpactExample,
ImpactStat,
ImpactStatIcon,
FutureSection,
FutureText,
FutureSolarIcon,
FutureHeader,
FutureDescription,
FutureCTA,
FutureImage,
} from "./index-styles"

export default function HomePage({ data }) {
Expand All @@ -30,6 +37,7 @@ export default function HomePage({ data }) {
<HeroCTA>
<a
target="_blank"
s
rel="noreferrer"
href={data.hero_button_destination.text}
>
Expand All @@ -38,7 +46,22 @@ export default function HomePage({ data }) {
</HeroCTA>
</HeroTextSection>
</HeroContainer>
<FutureSection>
<FutureText>
<FutureSolarIcon></FutureSolarIcon>
<FutureHeader>
<H2>{data.section_title}</H2>
</FutureHeader>
<FutureDescription>
<P>{data.section_description}</P>
</FutureDescription>

<FutureCTA>
<a href={data.button_destination}>{data.button_text}</a>
</FutureCTA>
</FutureText>
<FutureImage></FutureImage>
</FutureSection>
<ImpactSection>
<ImpactHeader>
<ImpactIcon />
Expand All @@ -57,6 +80,7 @@ export default function HomePage({ data }) {
))}
</ImpactStats>
</ImpactSection>

</HomePageContainer>
)
}
9 changes: 4 additions & 5 deletions src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import "../style/global.scss"
import dimensions from "../style/dimensions"
import { layoutPaddingDesktop, layoutPaddingMobile } from "../style/variables"
import Footer from "../components/footer/footer"
import Header from "../components/header/header"

const LayoutContainer = styled.div`
`
const LayoutContainer = styled.div``
const LayoutBody = styled.div`
@media (min-width: ${dimensions.maxwidthTablet}px) {
padding: 0 ${layoutPaddingDesktop} ${layoutPaddingDesktop};s
Expand All @@ -22,11 +21,11 @@ const LayoutBody = styled.div`
const Layout = ({ children }) => {
return (
<LayoutContainer>
<Header />
<LayoutBody>{children}</LayoutBody>

<Footer />
</LayoutContainer>
)
}

export default Layout
export default Layout
Loading

0 comments on commit cc5e2eb

Please sign in to comment.