Skip to content

Commit

Permalink
Tweaks to the hero
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwiemer committed Apr 27, 2018
1 parent e7e3161 commit 3aa6be3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# [workshop - URL TBD](https://www.knw.io)
# [workshop - URL TBD](TBD)

**NOTE:** This repo is mostly just for me. If you are interested in a starter template for Gatsby, Contentful and Netlify checkout: https://github.com/ryanwiemer/gatsby-starter-gcn.

Expand Down
22 changes: 21 additions & 1 deletion src/components/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import styled from 'styled-components'
import Img from 'gatsby-image'
import Plx from 'react-plx'
import Helmet from 'react-helmet'

const Wrapper = styled.div`
position: relative;
Expand Down Expand Up @@ -57,6 +58,9 @@ const Logo = styled.div`
const Hero = (props) => {
return (
<Wrapper className="hero">
<Helmet>
<meta property="og:image" content={props.image.sizes.src}/>
</Helmet>
<Plx
parallaxData={[{
start: 0,
Expand All @@ -71,8 +75,24 @@ const Hero = (props) => {
}]}
>
<BgImg sizes={props.image.sizes} position={props.position} alt={props.image.title} title={props.image.title} backgroundColor={"#aaaea2"} />
{props.logo && (<Logo><Img sizes={props.logo.sizes} alt={props.logo.title} title={props.logo.title} /></Logo>)}
</Plx>
{props.logo && (
<Plx
parallaxData={[{
start: 0,
duration: '75vh',
properties: [
{
startValue: 1,
endValue: 0,
property: 'opacity'
}
]
}]}
>
<Logo><Img sizes={props.logo.sizes} alt={props.logo.title} title={props.logo.title} /></Logo>
</Plx>
)}
</Wrapper>
)
}
Expand Down

0 comments on commit 3aa6be3

Please sign in to comment.