Section intro structure and styling

This commit is contained in:
Moris Zen
2018-07-06 23:32:12 +02:00
parent 9639fd9d1a
commit 3ec8275596
5 changed files with 59 additions and 50 deletions

View File

@@ -6,14 +6,10 @@ let defaultClasses =
let standardBtn = 'border hover:bg-teal hover:text-white hover:border-teal' let standardBtn = 'border hover:bg-teal hover:text-white hover:border-teal'
let filledBtn = 'text-grey-lightest bg-grey-darkest hover:bg-teal'
const Button = ({ ...props }) => ( const Button = ({ ...props }) => (
<Link <Link
to={props.url} to={props.url}
className={`${props.standard ? standardBtn : ''} ${ className={`${props.standard ? standardBtn : ''} ${defaultClasses} ${props.classes}`}
props.filled ? filledBtn : ''
} ${defaultClasses} ${props.classes}`}
> >
{props.text} {props.text}
</Link> </Link>

View File

@@ -9,23 +9,26 @@ const PageIntro = ({ ...props }) => (
<div className="text-center lg:text-left lg:mt-4"> <div className="text-center lg:text-left lg:mt-4">
<SectionIntro <SectionIntro
light light
intro="Welcome To Saburly" intro={props.intro}
classes="lg:text-left lg:max-w-xs content-center" classes="lg:text-left lg:max-w-xs content-center"
headline="We build the right software for your needs" headline={props.headline}
text="We are a team of creative, open minded, skilled and passionate engineers that ship success every day." text={props.text}
/> />
{ props.button &&
<Button <Button
filled text={props.buttonText}
text="Let's Build Together" url={props.url}
url="/proposal" classes={props.buttonClasses}
classes="shadow-md hover:shadow-lg rounded-full mt-4 font-light btn-saburly-green mb-20"
/> />
}
</div> </div>
<img {props.image && (
src={props.image} <img
className="lg:-mt-4 md:max-w-md xl:max-w-full z-10" src={props.image}
alt="Software Development Agency" className="lg:-mt-4 md:max-w-md xl:max-w-full z-10"
/> alt="Software Development Agency"
/>
)}
</div> </div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400.8 96.4"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400.8 96.4">
<title>bg-saburly-white</title> <title>bg-saburly-white</title>

View File

@@ -6,26 +6,32 @@ let headlineLight = 'text-indigo'
const IntroDefault = ({ ...props }) => ( const IntroDefault = ({ ...props }) => (
<div className={`${props.classes}`}> <div className={`${props.classes}`}>
<h3 {props.intro && (
className={` <h3
className={`
${ ${
props.light ? headlineDark : headlineLight props.light ? headlineDark : headlineLight
} opacity-50 text-sm font-light uppercase pt-2 pb-1`} } opacity-50 text-sm font-light uppercase pt-2 pb-1`}
> >
{props.intro} {props.intro}
</h3> </h3>
<h1 )}
className={`${props.light ? headlineDark : ''} {props.headline && (
<h1
className={`${props.light ? headlineDark : ''}
font-light pt-1 pb-2`} font-light pt-1 pb-2`}
> >
{props.headline} {props.headline}
</h1> </h1>
<p )}
className={`${props.light ? headlineDark : ''} {props.text && (
<p
className={`${props.light ? headlineDark : ''}
font-light leading-normal opacity-70`} font-light leading-normal opacity-70`}
> >
{props.text} {props.text}
</p> </p>
)}
</div> </div>
) )

View File

@@ -17,7 +17,7 @@ import LogoCoor from '../images/logo-coor-color.svg'
const IndexPage = ({ ...props }) => ( const IndexPage = ({ ...props }) => (
<main> <main>
<PageIntro image={ImgIntro} /> <PageIntro button buttonText="Let's Build Together" buttonUrl="/proposal" buttonClasses="text-white shadow-md hover:shadow-lg rounded-full mt-4 font-light btn-saburly-green mb-20" intro="Welcome To Saburly" headline="We build the right software for your needs" text="We are a team of creative, open minded, skilled and passionate engineers that ship success every day" image={ImgIntro} />
<section className="container mx-auto text-center my-12 p-4"> <section className="container mx-auto text-center my-12 p-4">
<SectionIntro <SectionIntro
@@ -106,7 +106,7 @@ const IndexPage = ({ ...props }) => (
filled filled
text="Get a free proposal" text="Get a free proposal"
url="/proposal" url="/proposal"
classes="shadow-md hover:shadow-lg rounded-full mt-4 font-light btn-saburly-green" classes="text-white shadow-md hover:shadow-lg rounded-full mt-4 font-light btn-saburly-green"
/> />
</section> </section>

View File

@@ -1,28 +1,32 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import Link from 'gatsby-link' import Link from 'gatsby-link'
import PageIntro from '../components/PageIntro'
import Card from '../components/Card' import Card from '../components/Card'
class Blog extends Component { class Blog extends Component {
render() { render() {
const data = this.props.data const data = this.props.data
return ( return (
<div className="container mx-auto p-4 w-full md:flex md:flex-wrap items-stretch w-full"> <div>
{data.allWordpressPost.edges.map(({ node }) => ( <PageIntro intro="Blog" headline="Occasionally we find the time to have fun and publish" />
<div key={node.id} className="md:w-1/2 p-2"> <div className="container mx-auto p-4 w-full md:flex md:flex-wrap items-stretch w-full">
<Card {data.allWordpressPost.edges.map(({ node }) => (
url={`blog/${node.slug}`} <div key={node.id} className="md:w-1/2 p-2">
title={node.title} <Card
date={node.date} url={`blog/${node.slug}`}
excerpt={node.excerpt} title={node.title}
image={ date={node.date}
node.featured_media excerpt={node.excerpt}
? node.featured_media.localFile.childImageSharp.resolutions image={
: undefined node.featured_media
} ? node.featured_media.localFile.childImageSharp.resolutions
/> : undefined
</div> }
))} />
</div>
))}
</div>
</div> </div>
) )
} }