1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 09:13:19 +01:00

header & footer

This commit is contained in:
Matthias Kretschmann 2018-04-02 23:22:48 +02:00
parent 8515742fa8
commit 5498ec9ca5
Signed by: m
GPG Key ID: 606EEEF3C479A91F
11 changed files with 168 additions and 55 deletions

View File

@ -1,11 +1,13 @@
import React from 'react' import React from 'react'
import FadeIn from './components/atoms/FadeIn' import FadeIn from './components/atoms/FadeIn'
import Routes from './Routes' import Routes from './Routes'
import Footer from './components/molecules/Footer'
const App = () => ( const App = () => (
<FadeIn> <FadeIn>
<div className="app"> <div>
<Routes /> <Routes />
<Footer />
</div> </div>
</FadeIn> </FadeIn>
) )

View File

@ -0,0 +1,15 @@
import React from 'react'
import meta from '../../data/meta.json'
import './Footer.css'
const Footer = () => {
const year = new Date().getFullYear()
return (
<footer className="footer">
<small>© {year} {meta.title} &mdash; All Rights Reserved</small>
</footer>
)
}
export default Footer

View File

@ -0,0 +1,12 @@
@import 'variables';
.footer {
padding: $spacer;
text-align: center;
color: $brand-grey-light;
&,
small {
font-size: $font-size-mini;
}
}

View File

@ -1,18 +1,31 @@
import React from 'react' import React from 'react'
import Link from 'react-router-dom/Link'
import PropTypes from 'prop-types'
import Social from './Social' import Social from './Social'
import './Header.css' import './Header.css'
import meta from '../../data/meta.json' import meta from '../../data/meta.json'
const Header = () => ( class Header extends React.Component {
<header className="header"> render() {
<hgroup className="name"> const minimal = this.props.minimal
<span className="header__logo"></span> const classes = (minimal ? 'header header--minimal' : 'header')
<h1 className="header__title">{meta.title}</h1>
<p className="header__description">{meta.tagline}</p>
</hgroup>
<Social /> return (
</header> <header className={classes}>
) <Link className="header__name" to="/">
<span className="header__logo"></span>
<h1 className="header__title">{meta.title}</h1>
<p className="header__description">{meta.tagline}</p>
</Link>
<Social />
</header>
)
}
}
Header.propTypes = {
minimal: PropTypes.bool
}
export default Header export default Header

View File

@ -1,16 +1,39 @@
@import 'variables'; @import 'variables';
.header { .header {
padding: $spacer / 2; padding: $spacer;
min-height: calc(100vh - #{$spacer}); min-height: calc(100vh - #{$spacer * 3});
display: flex; display: flex;
align-content: center; align-content: center;
flex-wrap: wrap; flex-wrap: wrap;
text-align: center;
}
.header--minimal {
min-height: 0;
text-align: left;
flex-wrap: nowrap;
align-content: flex-start;
justify-content: space-between;
margin-bottom: $spacer;
.name,
.social { .social {
width: 100%; margin-top: 0;
text-align: center; text-align: right;
justify-content: flex-end;
}
.social__link {
width: 1rem;
height: 1rem;
padding: $spacer / 8;
margin-left: $spacer / 4;
margin-right: $spacer / 4;
.icon {
width: .75rem;
height: .75rem;
}
} }
} }
@ -20,20 +43,55 @@
font-size: 3rem; font-size: 3rem;
color: $brand-grey-light; color: $brand-grey-light;
margin-bottom: $spacer / 2; margin-bottom: $spacer / 2;
.header--minimal & {
margin: 0;
display: inline-block;
font-size: 2rem;
margin-top: -2rem;
margin-right: $spacer / 4;
}
} }
.header__title, .header__title,
.header__description { .header__description {
display: inline-block; display: inline-block;
margin-bottom: 0; margin-bottom: 0;
transition: .2s ease-out;
} }
.header__title { .header__title {
font-size: $font-size-h3; font-size: $font-size-h3;
margin-right: $spacer / 2; margin-right: $spacer / 2;
color: $brand-main; color: $brand-main;
.header--minimal & {
font-size: $font-size-h4;
}
} }
.header__description { .header__description {
font-size: $font-size-large; font-size: $font-size-large;
color: $brand-grey;
.header--minimal & {
font-size: $font-size-small;
}
}
.header__name {
width: 100%;
pointer-events: none;
.header--minimal & {
pointer-events: all;
}
&:hover,
&:focus {
.header__title,
.header__description {
color: $brand-cyan;
}
}
} }

View File

@ -2,6 +2,9 @@
.social { .social {
margin-top: $spacer; margin-top: $spacer;
display: flex;
justify-content: center;
width: 100%;
} }
.social__link { .social__link {
@ -10,7 +13,9 @@
background: $brand-grey-dimmed; background: $brand-grey-dimmed;
padding: $spacer / 4; padding: $spacer / 4;
text-align: center; text-align: center;
display: inline-block; display: flex;
align-items: center;
justify-content: center;
width: 1.35rem; width: 1.35rem;
height: 1.35rem; height: 1.35rem;
box-shadow: 0 3px 5px rgba($brand-main, .1), 0 5px 16px rgba($brand-main, .1); box-shadow: 0 3px 5px rgba($brand-main, .1), 0 5px 16px rgba($brand-main, .1);

View File

@ -1,5 +1,6 @@
import React from 'react' import React, { Fragment } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Header from '../molecules/Header'
import Content from '../atoms/Content' import Content from '../atoms/Content'
const Project = ({ project }) => { const Project = ({ project }) => {
@ -9,22 +10,25 @@ const Project = ({ project }) => {
const links = project.links const links = project.links
return ( return (
<main className="screen screen--project"> <Fragment>
<Content> <Header minimal />
<h1>{title}</h1> <main className="screen screen--project">
<p>{description}</p> <Content>
<h1>{title}</h1>
<p>{description}</p>
{img} {img}
<ul> <ul>
{Object.keys(links).map(key => ( {Object.keys(links).map(key => (
<li key={key}> <li key={key}>
<a href={links[key]}>{key}</a> <a href={links[key]}>{key}</a>
</li> </li>
))} ))}
</ul> </ul>
</Content> </Content>
</main> </main>
</Fragment>
) )
} }

View File

@ -1,4 +1,4 @@
import React, { Component } from 'react' import React, { Component, Fragment } from 'react'
import Link from 'react-router-dom/Link' import Link from 'react-router-dom/Link'
import LazyLoad from 'react-lazyload' import LazyLoad from 'react-lazyload'
import Header from '../molecules/Header' import Header from '../molecules/Header'
@ -9,28 +9,30 @@ import './Home.css'
class Home extends Component { class Home extends Component {
render() { render() {
return ( return (
<main className="screen screen--home"> <Fragment>
<Header /> <Header />
<div className="projects"> <main className="screen screen--home">
{projects.map(project => (
<LazyLoad key={project.slug} height={700} offset={200} once>
<FadeIn>
<Link
key={project.slug}
to={{pathname: `/${project.slug}`}}
>
<article className="project">
<h1 className="project__title">{project.title}</h1>
</article>
</Link>
</FadeIn>
</LazyLoad>
))}
</div>
</main> <div className="projects">
{projects.map(project => (
<LazyLoad key={project.slug} height={700} offset={200} once>
<FadeIn>
<Link
key={project.slug}
to={{pathname: `/${project.slug}`}}
>
<article className="project">
<h1 className="project__title">{project.title}</h1>
</article>
</Link>
</FadeIn>
</LazyLoad>
))}
</div>
</main>
</Fragment>
) )
} }
} }

View File

@ -9,6 +9,8 @@
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
background-color: $brand-grey; background-color: $brand-grey;
margin-left: -$spacer;
margin-right: -$spacer;
} }
.project__title { .project__title {

View File

@ -7,7 +7,7 @@
"links": { "links": {
"Link": "https://oceanprotocol.com" "Link": "https://oceanprotocol.com"
}, },
"description": "" "description": "Laudem antiopam mea eu. Nam in accusam mediocritatem, eos ad paulo putent, pericula appellantur te ius. Magna debet id cum, probo eloquentiam sea ut. Cu eam graeco disputationi, graece theophrastus no his, duo errem expetendis te. Duo ea soleat ignota temporibus, in vim scaevola salutandi. Postea possit est at, ea vitae necessitatibus vix."
}, },
{ {
"title": "IPDB", "title": "IPDB",
@ -18,7 +18,7 @@
"Link": "https://ipdb.io", "Link": "https://ipdb.io",
"GitHub": "https://github.com/ipdb/website" "GitHub": "https://github.com/ipdb/website"
}, },
"description": "Bla Bla Bla" "description": "Laudem antiopam mea eu. Nam in accusam mediocritatem, eos ad paulo putent, pericula appellantur te ius. Magna debet id cum, probo eloquentiam sea ut. Cu eam graeco disputationi, graece theophrastus no his, duo errem expetendis te. Duo ea soleat ignota temporibus, in vim scaevola salutandi. Postea possit est at, ea vitae necessitatibus vix."
}, },
{ {
"title": "9984 >> Summit 2017", "title": "9984 >> Summit 2017",

View File

@ -97,5 +97,5 @@ svg {
} }
.screen { .screen {
padding: $spacer / 2 0; padding: $spacer;
} }