Skip to content

Commit

Permalink
Merge branch 'master' into #13-footer-component
Browse files Browse the repository at this point in the history
  • Loading branch information
samgildea committed Apr 15, 2021
2 parents 3edc42d + 216d6d3 commit cee1c87
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 56 deletions.
21 changes: 21 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 @@ -27,6 +27,7 @@
"npm": "^7.9.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
31 changes: 28 additions & 3 deletions src/components/header/header-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,72 @@ import colors from "../../style/colors"

export const NavContainer = styled.div`
z-index: 1;
background-color: ${colors.gray_image};
padding-bottom: 32px;
&.colorChange {
background-color: ${colors.gray_CTA};
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.div`
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`
Expand Down
18 changes: 11 additions & 7 deletions src/components/header/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { NavText } from "../../style/type-styles"

export const Header = () => {
export const Header = ({ home }) => {
const [open, setOpen] = useState(false)
const [colorChange, setColorchange] = useState(false)
const changeNavbarColor = () => {
Expand All @@ -22,15 +22,19 @@ export const Header = () => {
}
typeof window !== "undefined" &&
window.addEventListener("scroll", changeNavbarColor)

return (
<NavContainer className={colorChange ? "navbar colorChange" : "navbar"}>
<Logo>PowerHouse</Logo>
<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 />
<Hamburger className="hamburger" />
</MobileIcon>
<NavLinks>
<NavLinks className={home === true ? "home-header" : ""}>
<NavLink href="/about">
<NavText>ABOUT</NavText>
</NavLink>
Expand All @@ -40,7 +44,7 @@ export const Header = () => {
<NavLink href="/products">
<NavText>PRODUCTS</NavText>
</NavLink>
<NavLink href="/solutions">
<NavLink href="/UseCases">
<NavText>SOLUTIONS</NavText>
</NavLink>
</NavLinks>
Expand Down
19 changes: 18 additions & 1 deletion src/components/homepage/index-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ import {
import "../../style/colors"
import colors from "../../style/colors"


export const HeroImage = styled.div`
position: absolute;
top: 0;
z-index: 0;
img {
width: 100vw;
height: 100vh;
object-fit: cover;
}
`

export const HeroContainer = styled.div`
height: 100vh;
background-color: ${colors.gray_image};
Expand All @@ -21,6 +35,9 @@ export const HeroContainer = styled.div`

export const HeroTextSection = styled.div`
padding-top: 275px;
z-index: 2;
color: ${colors.white900};
position: relative;
padding-left: ${layoutPaddingDesktop};
@media (max-width: ${dimensions.maxwidthTablet}px) {
padding-left: ${layoutPaddingMobile};
Expand All @@ -34,7 +51,7 @@ export const HeroDescription = styled.div``
export const HeroCTA = styled.div`
margin-top: 64px;
a {
background-color: ${colors.gray_CTA};
background-color: ${colors.orange900};
text-transform: uppercase;
color: ${colors.white900};
padding-left: 48px;
Expand Down
84 changes: 47 additions & 37 deletions src/components/homepage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,58 @@ import {
FutureCTA,
FutureImage,
HomePageContainer,
HeroImage,
} from "./index-styles"

import { Helmet } from "react-helmet"

export default function HomePage({ data }) {
return (
<HomePageContainer>
<HeroContainer>
<HeroTextSection>
<HeroHeadline>
<H1>{data.hero_headline}</H1>
</HeroHeadline>
<HeroDescription>
<P>{data.hero_subtext}</P>
</HeroDescription>
<HeroCTA>
<a
target="_blank"
s
rel="noreferrer"
href={data.hero_button_destination.text}
>
{data.hero_cta_text}
</a>
</HeroCTA>
</HeroTextSection>
</HeroContainer>
<>
<Helmet bodyAttributes={{ class: "home-header" }} />

<HomePageContainer>
<HeroContainer>
<HeroImage>
<img alt="hero image" src={data.hero_background_image.url} />
</HeroImage>
<HeroTextSection>
<HeroHeadline>
<H1>{data.hero_headline}</H1>
</HeroHeadline>
<HeroDescription>
<P>{data.hero_subtext}</P>
</HeroDescription>
<HeroCTA>
<a
target="_blank"
s
rel="noreferrer"
href={data.hero_button_destination.text}
>
{data.hero_cta_text}
</a>
</HeroCTA>
</HeroTextSection>
</HeroContainer>

<FutureSection>
<FutureText>
<FutureSolarIcon></FutureSolarIcon>
<FutureHeader>
<H2>{data.section_title}</H2>
</FutureHeader>
<FutureDescription>
<P>{data.section_description}</P>
</FutureDescription>
<FutureSection>
<FutureText>
<FutureSolarIcon alt="Future of Solar Icon"></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>
</HomePageContainer>
<FutureCTA>
<a href={data.button_destination}>{data.button_text}</a>
</FutureCTA>
</FutureText>
<FutureImage></FutureImage>
</FutureSection>
</HomePageContainer>
</>
)
}
4 changes: 2 additions & 2 deletions src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const LayoutBody = styled.div`
}
`

const Layout = ({ children }) => {
const Layout = ({ children, home }) => {
return (
<LayoutContainer>
<Header />
<Header home={home} />
<LayoutBody>{children}</LayoutBody>
<Footer />
</LayoutContainer>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { graphql } from "gatsby"

import React from "react"
import Layout from "../components/layout"

export default function About({ data }) {
const aboutData = data.prismicAboutPage.data

return (
<div>
<Layout>
<h1>{aboutData.company_background_section_heading}</h1>
</div>
</Layout>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Home({ data }) {
const homepageData = data.prismicHomepage.data

return (
<Layout>
<Layout home={true}>
<Homepage data={homepageData} />
</Layout>
)
Expand Down
6 changes: 3 additions & 3 deletions src/vectors/hamburger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cee1c87

Please sign in to comment.