1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-11-16 01:55:15 +01:00

make images work

This commit is contained in:
Matthias Kretschmann 2018-05-04 01:58:43 +02:00
parent 40358ddbfe
commit df83594ae3
Signed by: m
GPG Key ID: 606EEEF3C479A91F
50 changed files with 426 additions and 117 deletions

View File

@ -1,12 +1,10 @@
[ [
{ {
"title": "Ocean Protocol", "title": "Ocean Protocol",
"slug": "oceanprotocol", "slug": "/oceanprotocol/",
"img": "portfolio-oceanprotocol.png", "img": "../src/images/portfolio-oceanprotocol-01.png",
"img_more": [ "description":
"portfolio-oceanprotocol-01.png", "Conceptualizing, executing and iterating on the creative and visual direction of the Ocean Protocol brand. Leading the UI design & development of all Ocean Protocol web properties.\n\nInitial website in collaboration with [Balance](https://balance.io/). Key visuals in collaboration with [Wojciech Hupert](https://twitter.com/wojciechhupert).",
"portfolio-oceanprotocol-02.png"
],
"links": [ "links": [
{ {
"title": "Link", "title": "Link",
@ -21,7 +19,6 @@
"url": "https://github.com/oceanprotocol/art" "url": "https://github.com/oceanprotocol/art"
} }
], ],
"description": "Conceptualizing, executing and iterating on the creative and visual direction of the Ocean Protocol brand. Leading the UI design & development of all Ocean Protocol web properties.\n\nInitial website in collaboration with [Balance](https://balance.io/). Key visuals in collaboration with [Wojciech Hupert](https://twitter.com/wojciechhupert).",
"techstack": [ "techstack": [
"Sketch", "Sketch",
"Affinity Designer", "Affinity Designer",
@ -33,5 +30,315 @@
"AWS S3", "AWS S3",
"Cloudflare" "Cloudflare"
] ]
},
{
"title": "IPDB",
"slug": "/ipdb/",
"img": "../src/images/portfolio-ipdb-01.png",
"description":
"Iterating on the creative and visual direction of the IPDB brand and leading the UI design & development of all IPDB web properties.\n\nKey visuals in collaboration with [Wojciech Hupert](https://twitter.com/wojciechhupert).",
"links": [
{
"title": "Link",
"url": "https://ipdb.io"
},
{
"title": "Styleguide",
"url": "https://ipdb.io/styleguide/"
},
{
"title": "GitHub",
"url": "https://github.com/ipdb/website"
}
],
"techstack": [
"Sketch",
"Jekyll",
"Gulp",
"HTML",
"SCSS",
"JavaScript",
"Travis",
"AWS S3",
"Cloudflare"
]
},
{
"title": "Berlin Innovation Ventures",
"slug": "/biv/",
"img": "../src/images/portfolio-biv.png",
"links": [
{
"title": "Link",
"url": "http://berlininnovation.vc"
}
],
"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.",
"techstack": [
"Sketch",
"Jekyll",
"Gulp",
"HTML",
"SCSS",
"JavaScript"
]
},
{
"title": "9984 >> Summit 2017",
"slug": "/9984/",
"img": "../src/images/portfolio-9984.png",
"links": [
{
"title": "Link",
"url": "https://2017.9984.io"
},
{
"title": "Styleguide",
"url": "https://2017.9984.io/styleguide/"
},
{
"title": "GitHub",
"url": "https://github.com/9984/2017.9984.io"
}
],
"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.",
"techstack": [
"Sketch",
"Jekyll",
"Gulp",
"HTML",
"SCSS",
"JavaScript",
"Travis",
"AWS S3",
"Cloudflare"
]
},
{
"title": "BigchainDB",
"slug": "/bigchaindb/",
"img": "../src/images/portfolio-bigchaindb-01.png",
"links": [
{
"title": "Link",
"url": "https://www.bigchaindb.com"
},
{
"title": "Styleguide",
"url": "https://www.bigchaindb.com/styleguide/"
},
{
"title": "GitHub",
"url": "https://github.com/bigchaindb/site"
},
{
"title": "Dribbble",
"url": "https://dribbble.com/shots/2522184-BigchainDB-site"
}
],
"description": "Conceptualizing and executing the creative and visual direction of the BigchainDB brand. Leading the UI design & development of all BigchainDB web properties.\n\nKey visuals in collaboration with [Wojciech Hupert](https://twitter.com/wojciechhupert).",
"techstack": [
"Sketch",
"Affinity Designer",
"Illustrator",
"Jekyll",
"Gulp",
"HTML",
"SCSS",
"JavaScript",
"Travis",
"AWS S3",
"Cloudflare"
]
},
{
"title": "ChartMogul",
"slug": "/chartmogul/",
"img": "../src/images/portfolio-chartmogul-01.png",
"links": [
{
"title": "Link",
"url": "https://chartmogul.com/"
},
{
"title": "Styleguide",
"url": "https://chartmogul.com/styleguide/"
},
{
"title": "Dribbble",
"url": "https://dribbble.com/kremalicious/projects/311439-ChartMogul"
}
],
"description": "Co-designing and leading the front-end development of various ChartMogul web properties. Creating and implementing a UI design system into the ChartMogul application.",
"techstack": [
"Sketch",
"Affinity Designer",
"Illustrator",
"HTML",
"SCSS",
"JavaScript",
"PHP",
"Jekyll",
"Gulp",
"WordPress",
"Travis",
"AWS S3",
"Cloudflare",
"Ruby on Rails",
"Backbone.js"
]
},
{
"title": "ShareTheMeal",
"slug": "/sharethemeal/",
"img": "../src/images/portfolio-sharethemeal.png",
"links": [
{
"title": "Link",
"url": "https://sharethemeal.org/"
}
],
"description": "Co-designing and leading the front-end development of the ShareTheMeal website.",
"techstack": [
"Sketch",
"Illustrator",
"Jekyll",
"Gulp",
"HTML",
"SCSS",
"JavaScript",
"Travis",
"AWS S3",
"Cloudflare",
"Node.js"
]
},
{
"title": "ezeep",
"slug": "/ezeep/",
"img": "../src/images/portfolio-ezeep-01.png",
"description": "From 2012 to 2015 I worked at ezeep, where I created an unprecedented, market-leading & award-winning user experience based on the principles of emotional design way ahead of all competitors. This included conceptualizing executing, and iterating on the creative & visual direction of the ezeep brand.\n\nI was leading the UI design & development of all ezeep touch points and - as a product designer - defined the ezeep product based on user and market research in an iterative process. On top of that, I designed and helped building all app experiences of ezeep on Windows, macOS, iOS, and Android.\n\nezeep was acquired by [Cortado AG](https://www.cortado.com) in 2015 and became part of their [ThinPrint Cloud Services](https://www.thinprintcloud.com) suite of products.",
"links": [
{
"title": "Info",
"url": "https://kremalicious.com/enterprise-software-sucks/"
},
{
"title": "Dribbble",
"url": "https://dribbble.com/kremalicious/projects/84318-ezeep"
}
],
"techstack": [
"Photoshop",
"Illustrator",
"InDesign",
"Sketch",
"HTML",
"SCSS",
"JavaScript",
"PHP",
"WordPress",
"Travis",
"AWS",
"Cloudflare",
"Node.js",
"Backbone.js",
"Electron"
]
},
{
"title": "Mr. Reader",
"slug": "/mrreader/",
"img": "../src/images/portfolio-mrreader.png",
"description": "I designed the app icon, a custom theme, and various promotion materials for Mr. Reader, a powerful RSS feed reader for iPad.",
"techstack": [
"Photoshop"
]
},
{
"title": "iPixelPad",
"slug": "/ipixelpad/",
"img": "../src/images/portfolio-ipixelpad.png",
"links": [
{
"title": "Download",
"url": "https://kremalicious.com/ipixelpad/"
}
],
"description": "So, what to do when everyone seem to release iPad icons but fail to include some crisp small size icons? Pushing the pixels for yourself of course. So heres my take on the smaller sizes of an Apple iPad icon, called iPixelPad in the sizes 48px, 32px and 16px.",
"techstack": [
"Photoshop"
]
},
{
"title": "Out Of Whale Oil",
"slug": "/outofwhaleoil/",
"img": "../src/images/portfolio-outofwhaleoil-01.png",
"description": "Tribute wallpaper pack inspired by the Futurama movie _Into The Wild Green Yonder_.",
"links": [
{
"title": "Download",
"url": "https://kremalicious.com/out-of-whale-oil/"
}
],
"techstack": [
"Photoshop"
]
},
{
"title": "Martin-Luther-Universität Halle-Wittenberg",
"slug": "/unihalle/",
"img": "../src/images/portfolio-unihalle-01.png",
"links": [
{
"title": "Link",
"url": "http://blogs.urz-uni-halle.de"
},
{
"title": "Dribbble",
"url": "https://dribbble.com/kremalicious/projects/690029-MLU"
}
],
"description": "From 2009 to 2012 I worked at the IT services department of [Martin-Luther-Universität Halle-Wittenberg](http://www.uni-halle.de) where I conceptualized & implemented numerous in-house and public facing interfaces for thousands of students and staff.\n\nAdditionally, I conceptualized, designed, created, and maintained the blog network & community for all students & staff.",
"techstack": [
"Photoshop",
"Illustrator",
"HTML",
"SCSS",
"JavaScript",
"PHP",
"Ruby on Rails",
"WordPress",
"Ilias",
"Stud.IP"
]
},
{
"title": "Coffee Cup",
"slug": "/coffeecup/",
"img": "../src/images/portfolio-coffeecup.png",
"links": [
{
"title": "Download",
"url": "https://kremalicious.com/coffee-cup-icon/"
}
],
"description": "Desktop icons showing the fuel of most designers. Released as a goodie on [kremalicious.com](https://kremalicious.com/coffee-cup-icon/).",
"techstack": [
"Photoshop"
]
},
{
"title": "Allinnia Creative Group",
"slug": "/allinnia/",
"img": "../src/images/portfolio-allinnia-01.png",
"description": "",
"techstack": [
"Photoshop",
"HTML",
"CSS",
"JavaScript",
"PHP"
]
} }
] ]

View File

@ -1,3 +1,4 @@
const path = require('path')
const meta = require('./data/meta.json') const meta = require('./data/meta.json')
const { url, googleanalytics } = meta const { url, googleanalytics } = meta
@ -6,6 +7,11 @@ module.exports = {
siteUrl: `${url}`, siteUrl: `${url}`,
}, },
plugins: [ plugins: [
'gatsby-plugin-react-next',
'gatsby-plugin-react-helmet',
'gatsby-transformer-json',
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
{ {
resolve: 'gatsby-plugin-sass', resolve: 'gatsby-plugin-sass',
options: { options: {
@ -16,14 +22,14 @@ module.exports = {
resolve: 'gatsby-source-filesystem', resolve: 'gatsby-source-filesystem',
options: { options: {
name: 'data', name: 'data',
path: `${__dirname}/data/`, path: path.join(__dirname, 'data'),
}, },
}, },
{ {
resolve: 'gatsby-source-filesystem', resolve: 'gatsby-source-filesystem',
options: { options: {
name: 'images', name: 'images',
path: `${__dirname}/src/images/`, path: path.join(__dirname, 'src', 'images'),
}, },
}, },
{ {
@ -43,10 +49,5 @@ module.exports = {
// see https://github.com/smooth-code/svgr for a list of all options // see https://github.com/smooth-code/svgr for a list of all options
}, },
}, },
'gatsby-plugin-react-next',
'gatsby-plugin-react-helmet',
'gatsby-transformer-json',
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
], ],
} }

View File

@ -25,26 +25,15 @@ exports.createPages = ({ boundActionCreators, graphql }) => {
allProjectsJson { allProjectsJson {
edges { edges {
node { node {
title
slug slug
description
img
img_more
techstack
links {
title
url
}
} }
previous { previous {
title title
slug slug
img
} }
next { next {
title title
slug slug
img
} }
} }
} }
@ -57,16 +46,12 @@ exports.createPages = ({ boundActionCreators, graphql }) => {
result.data.allProjectsJson.edges.forEach( result.data.allProjectsJson.edges.forEach(
({ node, previous, next }) => { ({ node, previous, next }) => {
const slug = node.slug const slug = node.slug
const img = node.img
const img_more = node.img_more
createPage({ createPage({
path: slug, path: slug,
component: template, component: template,
context: { context: {
slug, slug,
img,
img_more,
previous, previous,
next, next,
}, },

View File

@ -13,7 +13,7 @@
"deploy": "./deploy.sh" "deploy": "./deploy.sh"
}, },
"dependencies": { "dependencies": {
"gatsby": "^1.9.255", "gatsby": "^1.9.256",
"gatsby-image": "^1.0.47", "gatsby-image": "^1.0.47",
"gatsby-link": "^1.6.41", "gatsby-link": "^1.6.41",
"gatsby-plugin-google-analytics": "^1.0.31", "gatsby-plugin-google-analytics": "^1.0.31",
@ -21,11 +21,11 @@
"gatsby-plugin-react-next": "^1.0.11", "gatsby-plugin-react-next": "^1.0.11",
"gatsby-plugin-remove-trailing-slashes": "^1.0.9", "gatsby-plugin-remove-trailing-slashes": "^1.0.9",
"gatsby-plugin-sass": "^1.0.26", "gatsby-plugin-sass": "^1.0.26",
"gatsby-plugin-sharp": "^1.6.43", "gatsby-plugin-sharp": "^1.6.44",
"gatsby-plugin-svgr": "^1.0.0", "gatsby-plugin-svgr": "^1.0.0",
"gatsby-source-filesystem": "^1.5.33", "gatsby-source-filesystem": "^1.5.35",
"gatsby-transformer-json": "^1.0.16", "gatsby-transformer-json": "^1.0.17",
"gatsby-transformer-sharp": "^1.6.23", "gatsby-transformer-sharp": "^1.6.24",
"react-helmet": "^5.2.0", "react-helmet": "^5.2.0",
"react-markdown": "^3.3.0", "react-markdown": "^3.3.0",
"react-transition-group": "^2.3.1" "react-transition-group": "^2.3.1"
@ -35,7 +35,7 @@
"eslint": "^4.19.1", "eslint": "^4.19.1",
"eslint-loader": "^2.0.0", "eslint-loader": "^2.0.0",
"eslint-plugin-compat": "^2.2.0", "eslint-plugin-compat": "^2.2.0",
"eslint-plugin-graphql": "^2.1.0", "eslint-plugin-graphql": "^2.1.1",
"eslint-plugin-prettier": "^2.6.0", "eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.7.0", "eslint-plugin-react": "^7.7.0",
"prettier": "^1.12.1", "prettier": "^1.12.1",

View File

@ -5,13 +5,13 @@
&.fadein-appear-active, &.fadein-appear-active,
&.fadein-enter-active { &.fadein-enter-active {
opacity: 1; opacity: 1;
transition: 400ms ease-in; transition: 200ms ease-in;
} }
} }
.fadein-exit { .fadein-exit {
opacity: 1; opacity: 1;
transition: 300ms ease-in; transition: 200ms ease-in;
&.fadein-exit-active { &.fadein-exit-active {
opacity: .01; opacity: .01;

View File

@ -6,6 +6,9 @@ import './ProjectImage.scss'
const ProjectImage = ({ sizes, alt }) => ( const ProjectImage = ({ sizes, alt }) => (
<Img <Img
className="project__image" className="project__image"
outerWrapperClassName="project__image-wrap"
backgroundColor="#6b7f88"
fadeIn={false}
sizes={sizes} sizes={sizes}
alt={alt} alt={alt}
/> />

View File

@ -1,14 +1,20 @@
@import 'variables'; @import 'variables';
.project__image { .project__image-wrap {
max-height: 100vh; max-height: 100vh;
width: auto;
display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
display: block;
box-shadow: 0 3px 5px rgba($brand-main, .2), 0 5px 16px rgba($brand-main, .2); box-shadow: 0 3px 5px rgba($brand-main, .2), 0 5px 16px rgba($brand-main, .2);
@media (min-width: 1440px) { @media (min-width: 1440px) {
max-width: 1440px; max-width: 1440px;
} }
} }
.project__image {
img {
max-height: 100vh;
display: block;
}
}

View File

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Link from 'gatsby-link' import Link from 'gatsby-link'
import images from '../../images' import Img from 'gatsby-image'
import { ReactComponent as Index } from '../../images/index.svg' import { ReactComponent as Index } from '../../images/index.svg'
import '../atoms/Icons.scss' import '../atoms/Icons.scss'
@ -12,9 +12,9 @@ const ProjectNav = ({ previous, next }) => (
{previous && ( {previous && (
<div className="project__nav__item"> <div className="project__nav__item">
<Link className="project__nav__link prev" to={`/${previous.slug}`}> <Link className="project__nav__link prev" to={`/${previous.slug}`}>
<img <Img
className="project__nav__image" className="project__nav__image"
src={images[previous.img]} sizes={previous.img.childImageSharp.sizes}
alt={previous.title} alt={previous.title}
/> />
<h1 className="project__nav__title">{previous.title}</h1> <h1 className="project__nav__title">{previous.title}</h1>
@ -31,9 +31,9 @@ const ProjectNav = ({ previous, next }) => (
{next && ( {next && (
<div className="project__nav__item"> <div className="project__nav__item">
<Link className="project__nav__link next" to={`/${next.slug}`}> <Link className="project__nav__link next" to={`/${next.slug}`}>
<img <Img
className="project__nav__image" className="project__nav__image"
src={images[next.img]} sizes={next.img.childImageSharp.sizes}
alt={next.title} alt={next.title}
/> />
<h1 className="project__nav__title">{next.title}</h1> <h1 className="project__nav__title">{next.title}</h1>

View File

@ -1,30 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Link from 'gatsby-link'
// import Img from 'gatsby-image'
import './Projects.scss'
const Projects = ({ data }) => {
const projects = data.allProjectsJson.edges
return <div className="projects full-width" id="projects">
{projects.map(({ node }) => {
return (
<Link
key={node.slug}
to={`/${node.slug}`}
className="projects__project"
>
<h1 className="projects__project__title">{node.title}</h1>
<img src={`/static/${node.img}`} alt={node.title} />
</Link>
)
})}
</div>
}
Projects.propTypes = {
data: PropTypes.object,
}
export default Projects

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 KiB

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 KiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 KiB

After

Width:  |  Height:  |  Size: 779 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 KiB

After

Width:  |  Height:  |  Size: 797 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 KiB

After

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 KiB

After

Width:  |  Height:  |  Size: 795 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 KiB

After

Width:  |  Height:  |  Size: 742 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 KiB

View File

@ -1,8 +1,31 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Projects from '../components/organisms/Projects' import Link from 'gatsby-link'
import ProjectImage from '../components/atoms/ProjectImage'
import './index.scss'
const Home = ({ data }) => <Projects data={data} /> const Home = ({ data }) => {
const projects = data.allProjectsJson.edges
return (
<div className="projects full-width" id="projects">
{projects.map(({ node }) => {
const { slug, title, img } = node
return (
<Link
key={slug}
to={slug}
className="projects__project"
>
<h1 className="projects__project__title">{title}</h1>
<ProjectImage sizes={img.childImageSharp.sizes} alt={title} />
</Link>
)
})}
</div>
)
}
Home.propTypes = { Home.propTypes = {
data: PropTypes.object, data: PropTypes.object,
@ -17,7 +40,13 @@ export const IndexQuery = graphql`
node { node {
title title
slug slug
img img {
childImageSharp {
sizes(maxWidth: 1440) {
...GatsbyImageSharpSizes
}
}
}
} }
} }
} }

View File

@ -7,6 +7,7 @@
} }
.projects__project { .projects__project {
width: 100%;
display: block; display: block;
position: relative; position: relative;
background-color: $brand-grey-light; background-color: $brand-grey-light;

View File

@ -4,11 +4,10 @@ import Helmet from 'react-helmet'
import ReactMarkdown from 'react-markdown' import ReactMarkdown from 'react-markdown'
import Content from '../components/atoms/Content' import Content from '../components/atoms/Content'
import FullWidth from '../components/atoms/FullWidth' import FullWidth from '../components/atoms/FullWidth'
// import ProjectImage from '../components/atoms/ProjectImage' import ProjectImage from '../components/atoms/ProjectImage'
import Img from 'gatsby-image'
import ProjectTechstack from '../components/molecules/ProjectTechstack' import ProjectTechstack from '../components/molecules/ProjectTechstack'
import ProjectLinks from '../components/molecules/ProjectLinks' import ProjectLinks from '../components/molecules/ProjectLinks'
import ProjectNav from '../components/molecules/ProjectNav' // import ProjectNav from '../components/molecules/ProjectNav'
import SEO from '../components/atoms/SEO' import SEO from '../components/atoms/SEO'
import './Project.scss' import './Project.scss'
@ -18,37 +17,39 @@ class Project extends Component {
} }
render() { render() {
const postMeta = this.props.data.projectsJson const project = this.props.data.allProjectsJson.edges[0]
const pathContext = this.props.pathContext const projectImages = this.props.data.projectImages.edges
// const pathContext = this.props.pathContext
const { title, description, links, techstack } = postMeta const { title, description, links, techstack } = project.node
const { next, previous } = pathContext // const { next, previous } = pathContext
return <Fragment> return (
<Fragment>
<Helmet> <Helmet>
<title>{title}</title> <title>{title}</title>
</Helmet> </Helmet>
<SEO postMeta={postMeta} /> <SEO postMeta={project.node} />
<article className="project"> <article className="project">
<Content> <Content>
<h1 className="project__title">{title}</h1> <h1 className="project__title">{title}</h1>
<ReactMarkdown source={description} escapeHtml={false} className="project__description" /> <ReactMarkdown
source={description}
escapeHtml={false}
className="project__description"
/>
<FullWidth> <FullWidth>
<Img sizes={this.props.data.mainImage.childImageSharp.sizes} alt={title} /> {projectImages.map(({ node }) => (
</FullWidth> <ProjectImage
key={node.id}
{/* {!!this.props.data.additionalImage && <FullWidth> sizes={node.sizes}
{this.props.data.additionalImage.map(image => (
<Img
key={image}
sizes={this.props.data.additionalImage.childImageSharp.sizes}
alt={title} alt={title}
/> />
))} ))}
</FullWidth>} */} </FullWidth>
<footer className="project__meta"> <footer className="project__meta">
{!!techstack && <ProjectTechstack techstack={techstack} />} {!!techstack && <ProjectTechstack techstack={techstack} />}
@ -57,25 +58,26 @@ class Project extends Component {
</Content> </Content>
</article> </article>
<ProjectNav previous={previous} next={next} /> {/* <ProjectNav previous={previous} next={next} /> */}
</Fragment> </Fragment>
)
} }
} }
Project.propTypes = { Project.propTypes = {
data: PropTypes.object.isRequired, data: PropTypes.object.isRequired,
pathContext: PropTypes.object.isRequired, // pathContext: PropTypes.object.isRequired,
} }
export default Project export default Project
export const projectQuery = graphql` export const projectQuery = graphql`
query ProjectBySlug($slug: String!, $img: String!) { query ProjectBySlug($slug: String!) {
projectsJson(slug: { eq: $slug }) { allProjectsJson(filter: { slug: { eq: $slug } }) {
edges {
node {
title title
slug slug
img
img_more
description description
links { links {
title title
@ -83,12 +85,17 @@ export const projectQuery = graphql`
} }
techstack techstack
} }
mainImage: file(relativePath: { eq: $img }) { }
childImageSharp { }
projectImages: allImageSharp(filter: { id: { regex: $slug } }, sort: { fields: [id], order: ASC }) {
edges {
node {
id
sizes(maxWidth: 1440) { sizes(maxWidth: 1440) {
...GatsbyImageSharpSizes ...GatsbyImageSharpSizes
} }
} }
} }
} }
}
` `

View File

@ -1,7 +1,7 @@
@import 'variables'; @import 'variables';
.project { .project {
.project__image { .project__image-wrap {
margin-bottom: $spacer * 3; margin-bottom: $spacer * 3;
@media (min-width: 30rem) { @media (min-width: 30rem) {