diff --git a/package.json b/package.json index dda142e..acdd65e 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "postcss-nested": "^5.0.5", "ramda": "^0.27.1", "react": "^17.0.1", + "react-div-100vh": "^0.7.0", "react-dom": "^17.0.1", "react-helmet": "^6.1.0", "react-responsive-masonry": "^2.1.2", diff --git a/src/html.js b/src/html.js index c30c71e..f9c9ab3 100644 --- a/src/html.js +++ b/src/html.js @@ -15,7 +15,7 @@ export default function HTML(props) { name="description" /> {props.headComponents} diff --git a/src/pages/index.js b/src/pages/index.js index 98fee0f..fcca9ae 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -6,12 +6,13 @@ import { take } from "ramda"; import classnames from "classnames"; import { - getVibrantToHelmetSafeBodyStyle, + getHelmetSafeBodyStyle, getVibrant, getAspectRatio, } from "../utils"; import Nav from "../components/index/Nav"; import ActionButtons from "../components/index/ActionButtons"; +import { use100vh } from "react-div-100vh"; const env = process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || "development"; @@ -105,6 +106,8 @@ const IndexPage = ({ const vibrant = getVibrant(image); const ar = getAspectRatio(image); + const screenHeight = use100vh(); + const imageIsLandscape = isClient ? ar > 1 : true; return ( @@ -113,14 +116,14 @@ const IndexPage = ({