Initial pass at homepage layout

This commit is contained in:
Chuck Dries 2021-05-31 01:40:05 -07:00
parent 8fcae96197
commit d8ed13477d
9 changed files with 1089 additions and 83 deletions

View File

@ -4,10 +4,20 @@
- [ ] image details page (modal route?)
- [ ] gallery page
- [ ] homepage to gallery page transition
- [ ] homepage basic layout
- [ ] portfolio page
- Homepage
- [ ] homepage basic layout
- [ ] homepage aesthetics
- [ ] homepage to gallery page transition
- [ ] homepage to portfolio transition
- [ ] homepage to about page transition?
- [ ] tailwind
- [ ] About page?
- Portfolio/Projects page
- basic layout
- source data
- aesthetics
- [x] tailwind (done-ish)
- [ ] typescript
- [ ] graphql codegen

View File

@ -3,7 +3,6 @@ module.exports = {
title: "Chuck Dries",
},
plugins: [
// "gatsby-plugin-styled-components",
"gatsby-plugin-sass",
"gatsby-plugin-image",
"gatsby-plugin-react-helmet",
@ -16,7 +15,7 @@ module.exports = {
"gatsby-plugin-mdx",
"gatsby-plugin-sharp",
"gatsby-transformer-sharp",
// "gatsby-plugin-sharp-exif",
"gatsby-plugin-postcss",
{
resolve: "gatsby-source-filesystem",
options: {

View File

@ -50,7 +50,6 @@ function transformMetaToNodeData(exifData, iptcData) {
exports.onCreateNode = async function ({ node, getNode, actions }) {
const { createNodeField } = actions;
if (node.internal.type === 'ImageSharp') {
console.log(node)
const parent = getNode(node.parent);
const file = await readFile(parent.absolutePath)

1003
gatsby/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -17,24 +17,26 @@
"dependencies": {
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"autoprefixer": "^10.2.6",
"babel-plugin-styled-components": "^1.12.0",
"fast-exif": "^1.0.1",
"gatsby": "^3.4.1",
"gatsby-plugin-image": "^1.6.0",
"gatsby-plugin-manifest": "^3.6.0",
"gatsby-plugin-mdx": "^2.6.0",
"gatsby-plugin-postcss": "^4.6.0",
"gatsby-plugin-react-helmet": "^4.6.0",
"gatsby-plugin-sass": "^4.6.0",
"gatsby-plugin-sharp": "^3.6.0",
"gatsby-plugin-sharp-exif": "^1.0.4",
"gatsby-plugin-styled-components": "^4.6.0",
"gatsby-source-filesystem": "^3.6.0",
"gatsby-transformer-sharp": "^3.6.0",
"node-iptc": "^1.0.5",
"postcss": "^8.2.6",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"sass": "^1.34.0",
"styled-components": "^5.3.0"
"styled-components": "^5.3.0",
"tailwindcss": "^2.1.2"
}
}

6
gatsby/postcss.config.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@ -2,8 +2,9 @@ import * as React from "react"
import { graphql } from 'gatsby'
import { GatsbyImage, getImage } from "gatsby-plugin-image"
import "../styles/gallery.scss"
import "../styles/index.scss"
import '../styles/global.css';
// import "../styles/gallery.scss"
// import "../styles/index.scss"
// markup
const IndexPage = ({ data }) => {
@ -11,30 +12,60 @@ const IndexPage = ({ data }) => {
console.log('images', images)
return (
<main >
<title>Home Page</title>
<h1 >
<main className="">
<section className="m-2 py-6 intro flex flex-col justify-center flex-auto bg-black rounded-xl">
<div className="mx-auto px-4 md:px-2 w-full md:w-8 ">
<h1 className="text-6xl text-pink-600">Chuck Dries</h1>
<h2 className="text-blue-300">Software Engineer in web &amp; VR</h2>
<ul>
<li>Software Developer, <span className="text-gray-300 italic">Axosoft</span></li>
<li><a className="hover:text-pink-400 underline" href="mailto:chuck@chuckdries.com">chuck@chuckdries.com</a> / <span>602.618.0414</span></li>
<li>
<a className="mr-1 hover:text-pink-400 underline" href="http://github.com/chuckdries">Github</a>/
<a className="mx-1 hover:text-pink-400 underline" href="https://www.linkedin.com/in/chuckdries/">LinkedIn</a>/
<a className="mx-1 hover:text-pink-400 underline" href="https://devpost.com/chuckdries">Devpost</a>/
<a className="mx-1 hover:text-pink-400 underline" href="CharlesDriesResumeCurrent.pdf">Resume [pdf]</a>/
<a className="mx-1 hover:text-pink-400 underline" href="https://medium.com/@chuckdries">Medium (blog)</a>
{/* <a href="https://pgp.mit.edu/pks/lookup?op=get&search=0x2BD9D0871DB5A518">Public Key</a> */}
</li>
</ul>
</div>
</section>
{/* <h1 >
Congratulations
<br />
<span > you just made a Gatsby site! </span>
<span role="img" aria-label="Party popper emojis">
🎉🎉🎉
</span>
</h1>
<div className="gallery">
</h1> */}
<section className="mt-0 m-2 max-w-full flex flex-col bg-black text-gray-200 py-2 rounded-xl">
<h2 className="ml-6 text-2xl">Photography</h2>
<div className="gallery gallery flex-auto flex overflow-x-scroll w-full scroll-snap-x scroll-padding-6 ">
{images.map(image => {
const name = image.childImageSharp.fields.imageMeta.iptc.object_name || image.base
console.log('name', name)
// const file = data.allFile
// console.log(fileName)
// return <></>
return <GatsbyImage key={image.base} image={getImage(image)} alt={name} />;
return (
// <div style={{ maxHeight: '500px' }} className="flex-shrink-0 mr-4 scroll-snap-start bg-red-300">
// .
<GatsbyImage
className="gallery-img h-full flex-shrink-0 scroll-snap-start mr-4"
style={{
// maxHeight: "800px"
// width: '400px',
// height: '100%'
}}
key={image.base}
image={getImage(image)}
alt={name} />
// </div>
);
})}
</div>
<img
alt="Gatsby G Logo"
src="data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a10 10 0 110 20 10 10 0 010-20zm0 2c-3.73 0-6.86 2.55-7.75 6L14 19.75c3.45-.89 6-4.02 6-7.75h-5.25v1.5h3.45a6.37 6.37 0 01-3.89 4.44L6.06 9.69C7 7.31 9.3 5.63 12 5.63c2.13 0 4 1.04 5.18 2.65l1.23-1.06A7.959 7.959 0 0012 4zm-8 8a8 8 0 008 8c.04 0 .09 0-8-8z' fill='%23639'/%3E%3C/svg%3E"
/>
</section>
</main>
)
}
@ -48,7 +79,13 @@ query HomePageGallery {
relativePath,
base,
childImageSharp{
gatsbyImageData(width: 400)
gatsbyImageData(
layout: CONSTRAINED,
placeholder: BLURRED,
# width: 400
# height: 900
height: 400
)
fields {
imageMeta {
meta {

View File

@ -0,0 +1,31 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
* {
box-sizing: border-box;
}
@layer utilities {
.scroll-snap-none {
scroll-snap-type: none;
}
.scroll-snap-x {
scroll-snap-type: x mandatory;
}
.scroll-snap-y {
scroll-snap-type: y mandatory;
}
.scroll-snap-start {
scroll-snap-align: start;
}
.scroll-padding-6 {
scroll-padding: theme('spacing.6')
}
}
.gallery-img:first-child {
margin-left: theme('spacing.6')
}
body {
@apply bg-gray-900 text-white;
}

21
gatsby/tailwind.config.js Normal file
View File

@ -0,0 +1,21 @@
module.exports = {
purge: ['./src/**/*.{js,jsx,ts,tsx}'],
darkMode: 'media', // or 'media' or 'class'
theme: {
spacing: {
'1': '8px',
'2': '12px',
'3': '16px',
'4': '24px',
'5': '32px',
'6': '48px',
'7': '80px',
'8': '700px'
},
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}