mirror of
https://github.com/kremalicious/portfolio.git
synced 2025-02-14 21:10:41 +01:00
Merge pull request #86 from kremalicious/feature/microformats
add hcard markup
This commit is contained in:
commit
be24d54266
@ -22,6 +22,7 @@
|
|||||||
"new": "babel-node ./scripts/new.js"
|
"new": "babel-node ./scripts/new.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"classnames": "^2.2.6",
|
||||||
"file-saver": "^2.0.0",
|
"file-saver": "^2.0.0",
|
||||||
"gatsby": "^2.0.80",
|
"gatsby": "^2.0.80",
|
||||||
"gatsby-image": "^2.0.25",
|
"gatsby-image": "^2.0.25",
|
||||||
|
@ -14,6 +14,7 @@ import styles from './Layout.module.scss'
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
const timeout = 250
|
const timeout = 250
|
||||||
|
const RoutesContainer = posed.div(fadeIn)
|
||||||
|
|
||||||
export default class Layout extends PureComponent {
|
export default class Layout extends PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -25,8 +26,6 @@ export default class Layout extends PureComponent {
|
|||||||
const { children, location } = this.props
|
const { children, location } = this.props
|
||||||
const isHomepage = location.pathname === '/'
|
const isHomepage = location.pathname === '/'
|
||||||
|
|
||||||
const RoutesContainer = posed.div(fadeIn)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Typekit />
|
<Typekit />
|
||||||
|
@ -2,6 +2,7 @@ import React, { PureComponent } from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { StaticQuery, graphql } from 'gatsby'
|
import { StaticQuery, graphql } from 'gatsby'
|
||||||
import posed from 'react-pose'
|
import posed from 'react-pose'
|
||||||
|
import classNames from 'classnames'
|
||||||
import { moveInBottom } from '../atoms/Transitions'
|
import { moveInBottom } from '../atoms/Transitions'
|
||||||
import { ReactComponent as Logo } from '../../images/logo.svg'
|
import { ReactComponent as Logo } from '../../images/logo.svg'
|
||||||
import styles from './LogoUnit.module.scss'
|
import styles from './LogoUnit.module.scss'
|
||||||
@ -15,33 +16,36 @@ const query = graphql`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const Animation = posed.div(moveInBottom)
|
|
||||||
|
|
||||||
export default class LogoUnit extends PureComponent {
|
export default class LogoUnit extends PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
minimal: PropTypes.bool
|
minimal: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Animation = posed.div(moveInBottom)
|
||||||
|
nameClasses = classNames('p-name', [styles.title])
|
||||||
|
descriptionClasses = classNames('p-job-title', [styles.description])
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
let wrapClasses = classNames([styles.logounit], {
|
||||||
|
[styles.minimal]: this.props.minimal
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StaticQuery
|
<StaticQuery
|
||||||
query={query}
|
query={query}
|
||||||
render={data => {
|
render={data => {
|
||||||
const { title, tagline } = data.dataYaml
|
const { title, tagline } = data.dataYaml
|
||||||
const { minimal } = this.props
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Animation>
|
<div className={wrapClasses}>
|
||||||
<div className={minimal ? styles.minimal : styles.logounit}>
|
<this.Animation>
|
||||||
<Logo className={styles.logounit__logo} />
|
<Logo className={styles.logo} />
|
||||||
<h1 className={styles.logounit__title}>
|
<h1 className={this.nameClasses}>{title.toLowerCase()}</h1>
|
||||||
{title.toLowerCase()}
|
<p className={this.descriptionClasses}>
|
||||||
</h1>
|
|
||||||
<p className={styles.logounit__description}>
|
|
||||||
{tagline.toLowerCase()}
|
{tagline.toLowerCase()}
|
||||||
</p>
|
</p>
|
||||||
|
</this.Animation>
|
||||||
</div>
|
</div>
|
||||||
</Animation>
|
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logounit__logo {
|
.logo {
|
||||||
display: block;
|
display: block;
|
||||||
width: 1.5rem;
|
width: 1.5rem;
|
||||||
height: 1.5rem;
|
height: 1.5rem;
|
||||||
@ -14,20 +14,20 @@
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logounit__title,
|
.title,
|
||||||
.logounit__description {
|
.description {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logounit__title {
|
.title {
|
||||||
font-size: $font-size-h3;
|
font-size: $font-size-h3;
|
||||||
margin-right: $spacer / 4;
|
margin-right: $spacer / 4;
|
||||||
color: $brand-main;
|
color: $brand-main;
|
||||||
line-height: $line-height;
|
line-height: $line-height;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logounit__description {
|
.description {
|
||||||
font-size: $font-size-h4;
|
font-size: $font-size-h4;
|
||||||
color: $brand-grey-light;
|
color: $brand-grey-light;
|
||||||
|
|
||||||
@ -46,13 +46,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.minimal {
|
.minimal {
|
||||||
composes: logounit;
|
|
||||||
transform: scale(.7);
|
transform: scale(.7);
|
||||||
transform-origin: top center;
|
transform-origin: top center;
|
||||||
transform-box: border-box;
|
transform-box: border-box;
|
||||||
|
|
||||||
.logounit__title,
|
.title,
|
||||||
.logounit__description {
|
.description {
|
||||||
color: $text-color-light;
|
color: $text-color-light;
|
||||||
|
|
||||||
:global(.dark) & {
|
:global(.dark) & {
|
||||||
@ -60,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.logounit__logo {
|
.logo {
|
||||||
margin-bottom: $spacer / 3;
|
margin-bottom: $spacer / 3;
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import React, { PureComponent } from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { StaticQuery, graphql } from 'gatsby'
|
import { StaticQuery, graphql } from 'gatsby'
|
||||||
import posed from 'react-pose'
|
import posed from 'react-pose'
|
||||||
|
import classNames from 'classnames'
|
||||||
import { moveInTop } from '../atoms/Transitions'
|
import { moveInTop } from '../atoms/Transitions'
|
||||||
|
|
||||||
import { ReactComponent as Email } from '../../images/email.svg'
|
import { ReactComponent as Email } from '../../images/email.svg'
|
||||||
@ -50,33 +51,24 @@ class NetworkIcon extends PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Animation = posed.aside(moveInTop)
|
|
||||||
|
|
||||||
export default class Networks extends PureComponent {
|
export default class Networks extends PureComponent {
|
||||||
state = {
|
|
||||||
classes: styles.networks
|
|
||||||
}
|
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
minimal: PropTypes.bool,
|
minimal: PropTypes.bool,
|
||||||
hide: PropTypes.bool
|
hide: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
Animation = posed.aside(moveInTop)
|
||||||
this.toggleClasses()
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate() {
|
linkClasses = key =>
|
||||||
this.toggleClasses()
|
classNames({
|
||||||
}
|
'u-url': key !== 'Email',
|
||||||
|
'u-email': key === 'Email',
|
||||||
|
[styles.link]: true
|
||||||
|
})
|
||||||
|
|
||||||
toggleClasses = () => {
|
wrapClasses = classNames([styles.networks], {
|
||||||
if (this.props.minimal) {
|
[styles.minimal]: this.props.minimal
|
||||||
this.setState({ classes: `${styles.networks} ${styles.minimal}` })
|
})
|
||||||
} else {
|
|
||||||
this.setState({ classes: styles.networks })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
@ -87,14 +79,18 @@ export default class Networks extends PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
!this.props.hide && (
|
!this.props.hide && (
|
||||||
<Animation className={this.state.classes}>
|
<this.Animation className={this.wrapClasses}>
|
||||||
{Object.keys(meta.social).map((key, i) => (
|
{Object.keys(meta.social).map((key, i) => (
|
||||||
<a className={styles.link} href={meta.social[key]} key={i}>
|
<a
|
||||||
|
className={this.linkClasses(key)}
|
||||||
|
href={meta.social[key]}
|
||||||
|
key={i}
|
||||||
|
>
|
||||||
<NetworkIcon title={key} className={icons.icon} />
|
<NetworkIcon title={key} className={icons.icon} />
|
||||||
<span className={styles.title}>{key}</span>
|
<span className={styles.title}>{key}</span>
|
||||||
</a>
|
</a>
|
||||||
))}
|
))}
|
||||||
</Animation>
|
</this.Animation>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { PureComponent } from 'react'
|
import React, { PureComponent } from 'react'
|
||||||
import { Link, StaticQuery, graphql } from 'gatsby'
|
import { Link, StaticQuery, graphql } from 'gatsby'
|
||||||
|
import classNames from 'classnames'
|
||||||
import Vcard from '../atoms/Vcard'
|
import Vcard from '../atoms/Vcard'
|
||||||
import LogoUnit from '../molecules/LogoUnit'
|
import LogoUnit from '../molecules/LogoUnit'
|
||||||
import Networks from '../molecules/Networks'
|
import Networks from '../molecules/Networks'
|
||||||
@ -17,30 +18,39 @@ const query = graphql`
|
|||||||
|
|
||||||
dataYaml {
|
dataYaml {
|
||||||
title
|
title
|
||||||
|
url
|
||||||
gpg
|
gpg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
let classes = classNames('h-card', [styles.footer])
|
||||||
|
|
||||||
export default class Footer extends PureComponent {
|
export default class Footer extends PureComponent {
|
||||||
state = { year: new Date().getFullYear() }
|
state = { year: new Date().getFullYear() }
|
||||||
|
|
||||||
FooterMarkup = ({ meta, pkg, year }) => (
|
FooterMarkup = ({ meta, pkg, year }) => (
|
||||||
<footer className={styles.footer}>
|
<footer className={classes}>
|
||||||
<Link to={'/'}>
|
<Link to={'/'}>
|
||||||
<LogoUnit minimal />
|
<LogoUnit minimal />
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Networks minimal />
|
<Networks minimal />
|
||||||
|
|
||||||
<p className={styles.footer__actions}>
|
<p className={styles.actions}>
|
||||||
<Vcard />
|
<Vcard />
|
||||||
<a href={meta.gpg}>PGP/GPG key</a>
|
<a className="u-key" href={meta.gpg}>
|
||||||
|
PGP/GPG key
|
||||||
|
</a>
|
||||||
<a href={pkg.bugs}>Found a bug?</a>
|
<a href={pkg.bugs}>Found a bug?</a>
|
||||||
</p>
|
</p>
|
||||||
<p className={styles.footer__copyright}>
|
<p className={styles.copyright}>
|
||||||
<small>
|
<small>
|
||||||
© {year} {meta.title} — All Rights Reserved
|
© {year}{' '}
|
||||||
|
<a className="u-url" href={meta.url}>
|
||||||
|
{meta.title}
|
||||||
|
</a>{' '}
|
||||||
|
— All Rights Reserved
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer__actions {
|
.actions {
|
||||||
a {
|
a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0 $spacer / 4;
|
padding: 0 $spacer / 4;
|
||||||
@ -36,3 +36,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.copyright {
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { PureComponent } from 'react'
|
import React, { PureComponent } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Link, StaticQuery, graphql } from 'gatsby'
|
import { Link, StaticQuery, graphql } from 'gatsby'
|
||||||
|
import classNames from 'classnames'
|
||||||
import Networks from '../molecules/Networks'
|
import Networks from '../molecules/Networks'
|
||||||
import Availability from '../molecules/Availability'
|
import Availability from '../molecules/Availability'
|
||||||
import ThemeSwitch from '../molecules/ThemeSwitch'
|
import ThemeSwitch from '../molecules/ThemeSwitch'
|
||||||
@ -25,6 +26,10 @@ export default class Header extends PureComponent {
|
|||||||
render() {
|
render() {
|
||||||
const { minimal } = this.props
|
const { minimal } = this.props
|
||||||
|
|
||||||
|
let headerClasses = classNames([styles.header], {
|
||||||
|
[styles.minimal]: minimal
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StaticQuery
|
<StaticQuery
|
||||||
query={query}
|
query={query}
|
||||||
@ -32,10 +37,10 @@ export default class Header extends PureComponent {
|
|||||||
const meta = data.dataYaml
|
const meta = data.dataYaml
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className={minimal ? styles.minimal : styles.header}>
|
<header className={headerClasses}>
|
||||||
<ThemeSwitch />
|
<ThemeSwitch />
|
||||||
|
|
||||||
<Link className={styles.header__link} to={'/'}>
|
<Link className={styles.link} to={'/'}>
|
||||||
<LogoUnit minimal={minimal} />
|
<LogoUnit minimal={minimal} />
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
@ -12,19 +12,18 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header__link {
|
.link {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.minimal {
|
.minimal {
|
||||||
composes: header;
|
|
||||||
height: auto;
|
height: auto;
|
||||||
padding-top: $spacer * 2;
|
padding-top: $spacer * 2;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
|
||||||
.header__link {
|
.link {
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user