From 8ec8b011b2b3ff48c4299cbeee16dd66e9777007 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Wed, 16 Jun 2021 23:51:31 -0700 Subject: [PATCH] improve index ssr/nojs layout --- gatsby/src/pages/index.js | 7 +------ gatsby/src/styles/global.css | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gatsby/src/pages/index.js b/gatsby/src/pages/index.js index 955ab3c..32709e5 100644 --- a/gatsby/src/pages/index.js +++ b/gatsby/src/pages/index.js @@ -4,14 +4,10 @@ import { GatsbyImage, getImage } from 'gatsby-plugin-image'; import { getVibrantToHelmetSafeBodyStyle, getVibrant } from '../utils'; import { Helmet } from 'react-helmet'; 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(() => { @@ -21,7 +17,6 @@ const IndexPage = ({ data: { allFile: { edges } } }) => { return images[Math.floor(Math.random() * images.length)]; }, [images, isClient]); const vibrant = getVibrant(image, isClient); - console.log('vibrant', vibrant); React.useEffect(() => { if (!isClient) { setIsClient(true); @@ -49,7 +44,7 @@ const IndexPage = ({ data: { allFile: { edges } } }) => { gridArea: '1/1', }} /> // 67vw = 1/1.49253731 = 1/aspect ratio of my camera lol - :
} + :
}
diff --git a/gatsby/src/styles/global.css b/gatsby/src/styles/global.css index 41eb95d..0b2c415 100644 --- a/gatsby/src/styles/global.css +++ b/gatsby/src/styles/global.css @@ -28,6 +28,12 @@ .scroll-padding-6 { scroll-padding: theme('spacing.6'); } + @variants responsive { + + .h-two-thirds-vw { + height: 67vw; + } + } } body {