diff --git a/gatsby/src/breakpoints.js b/gatsby/src/breakpoints.js new file mode 100644 index 0000000..4ff08b7 --- /dev/null +++ b/gatsby/src/breakpoints.js @@ -0,0 +1,10 @@ +import preval from 'babel-plugin-preval/macro'; +const themeBreakpoints = preval` +const R = require('ramda') +const resolveConfig = require('tailwindcss/resolveConfig'); +const tailwindConfig = require('../tailwind.config.js'); +const {theme} = resolveConfig(tailwindConfig); +module.exports = R.map(size => parseInt(size, 10), theme.screens); +`; + +export default themeBreakpoints; \ No newline at end of file diff --git a/gatsby/src/components/MasonryGallery.js b/gatsby/src/components/MasonryGallery.js index 651dd48..34b552b 100644 --- a/gatsby/src/components/MasonryGallery.js +++ b/gatsby/src/components/MasonryGallery.js @@ -5,14 +5,7 @@ import * as R from 'ramda'; import { getAspectRatio, getName } from '../utils'; import useBreakpoint from 'use-breakpoint'; -import preval from 'babel-plugin-preval/macro'; -const themeBreakpoints = preval` -const R = require('ramda') -const resolveConfig = require('tailwindcss/resolveConfig'); -const tailwindConfig = require('../../tailwind.config.js'); -const {theme} = resolveConfig(tailwindConfig); -module.exports = R.map(size => parseInt(size, 10), theme.screens); -`; +import themeBreakpoints from '../breakpoints'; const MasonryGallery = ({ images, itemsPerRow: itemsPerRowByBreakpoint }) => { const breakpoints = React.useMemo(() => diff --git a/gatsby/src/pages/index.js b/gatsby/src/pages/index.js index 341b5cc..955ab3c 100644 --- a/gatsby/src/pages/index.js +++ b/gatsby/src/pages/index.js @@ -3,10 +3,15 @@ import { Link, graphql } from 'gatsby'; import { GatsbyImage, getImage } from 'gatsby-plugin-image'; import { getVibrantToHelmetSafeBodyStyle, getVibrant } from '../utils'; import { Helmet } from 'react-helmet'; -import { HeroA } from '../components/IndexComponents'; import classnames from 'classnames'; +import useBreakpoint from 'use-breakpoint'; + +import { HeroA } from '../components/IndexComponents'; + +import themeBreakpoints from '../breakpoints'; const IndexPage = ({ data: { allFile: { edges } } }) => { + const { breakpoint } = useBreakpoint(themeBreakpoints, 'md'); const [isClient, setIsClient] = React.useState(false); const images = React.useMemo(() => edges.map((edge) => edge.node), [edges]); const image = React.useMemo(() => { @@ -32,22 +37,19 @@ const IndexPage = ({ data: { allFile: { edges } } }) => {
- + {isClient ? + + // 67vw = 1/1.49253731 = 1/aspect ratio of my camera lol + :
}
@@ -61,7 +63,7 @@ const IndexPage = ({ data: { allFile: { edges } } }) => { Github/ LinkedIn/ Devpost/ - Resume [pdf]/ + Resume [pdf]/ Medium (blog) {/* Public Key */} diff --git a/gatsby/src/styles/global.css b/gatsby/src/styles/global.css index d0bad3d..41eb95d 100644 --- a/gatsby/src/styles/global.css +++ b/gatsby/src/styles/global.css @@ -9,9 +9,9 @@ * { box-sizing: border-box; } -.hero * { +/* .hero * { transition: color .2s, background-color .2s; -} +} */ @layer utilities { .scroll-snap-none { scroll-snap-type: none;