diff --git a/src/components/GalleryImage/GalleryImage.js b/src/components/GalleryImage/GalleryImage.js index e1d0d24..0bbcc63 100644 --- a/src/components/GalleryImage/GalleryImage.js +++ b/src/components/GalleryImage/GalleryImage.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import { graphql, navigate, Link } from "gatsby"; import { getAspectRatio, @@ -29,6 +29,8 @@ const GalleryImage = ({ data, pageContext }) => { const image = data.allFile.edges[0].node; const ar = getAspectRatio(image); + const [zoom, setZoom] = useState(false); + React.useEffect(() => { const keyListener = (e) => { switch (e.code) { @@ -73,6 +75,8 @@ const GalleryImage = ({ data, pageContext }) => { ar > 1 ? "flex-col mx-auto" : "portrait:mx-auto landscape:mx-5 landscape:flex-row-reverse portrait:flex-col"; + const verticalPad = ar > 1 ? "170px" : "70px"; + const shutterSpeed = React.useMemo( () => getShutterFractionFromExposureTime(meta.ExposureTime || 0), [meta] @@ -126,19 +130,27 @@ const GalleryImage = ({ data, pageContext }) => { )}
-
+
setZoom((_zoom) => !_zoom)} />
{ href={image.publicURL} onClick={() => { try { - window.plausible("Download Wallpaper", { props: { image: image.base } }); + window.plausible("Download Wallpaper", { + props: { image: image.base }, + }); } catch { // do nothing } @@ -178,12 +192,27 @@ const GalleryImage = ({ data, pageContext }) => { style={{ width: 30 }} >
} -
+
+
+ + {meta.FNumber && ( + + )} + +
{ title="lens" /> )} - - {meta.FNumber && ( - - )} -
diff --git a/src/components/GalleryImage/MetadataItem.js b/src/components/GalleryImage/MetadataItem.js index ea4851f..c762bd7 100644 --- a/src/components/GalleryImage/MetadataItem.js +++ b/src/components/GalleryImage/MetadataItem.js @@ -2,9 +2,9 @@ import React from "react"; const MetadataItem = ({ icon, data, title }) => data ? ( -
+
- {title} + {title} {data}
diff --git a/src/styles/global.css b/src/styles/global.css index 5cfd22c..249e247 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -32,6 +32,14 @@ .scroll-padding-6 { scroll-padding: theme("spacing.6"); } + .cursor-zoom-in { + cursor: -webkit-zoom-in; + cursor: zoom-in; + } + .cursor-zoom-out { + cursor: -webkit-zoom-out; + cursor: zoom-out; + } @supports (backdrop-filter: none) { .blurred-or-opaque-bg-1 { @apply bg-opacity-50 backdrop-filter backdrop-blur-lg; diff --git a/src/utils.js b/src/utils.js index 430b2f5..81b0380 100644 --- a/src/utils.js +++ b/src/utils.js @@ -25,7 +25,7 @@ export const getHelmetSafeBodyStyle = (vibrant, screenHeight) => { "--vibrant": vibrant.Vibrant, "--dark-vibrant": vibrant.DarkVibrant, "--light-vibrant": vibrant.LightVibrant, - "--height-screen": screenHeight ? `${screenHeight}px` : '100vh' + "--height-screen": screenHeight ? `${screenHeight}px` : "100vh", }; if (typeof window === "undefined") { return style; @@ -45,7 +45,10 @@ const gcd = (a, b) => { export const getShutterFractionFromExposureTime = (exposureTime) => { if (exposureTime === 0.016666666666666666) { - return '1/60' + return "1/60"; + } + if (exposureTime === 0.0011111111111111111) { + return "1/900"; } let fraction = exposureTime; const len = fraction.toString().length - 2; @@ -58,7 +61,7 @@ export const getShutterFractionFromExposureTime = (exposureTime) => { numerator /= divisor; denominator /= divisor; if (numerator > 1) { - return `${exposureTime}` + return `${exposureTime}`; } return `${numerator}/${denominator}`; }; diff --git a/tailwind.config.js b/tailwind.config.js index 4b0f09f..e196def 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,7 @@ const defaultTheme = require("tailwindcss/defaultTheme"); module.exports = { purge: ["./src/**/*.{js,jsx,ts,tsx}"], - mode: 'jit', + mode: "jit", // darkMode: 'media', // or 'media' or 'class' theme: { screens: { @@ -33,17 +33,17 @@ module.exports = { }, extend: { height: { - "actual-screen": "var(--height-screen)" + "actual-screen": "var(--height-screen)", }, dropShadow: { - 'dark': '0 1px 2px rgba(0, 0, 0, 0.8)', + dark: "0 1px 2px rgba(0, 0, 0, 0.8)", }, fontSize: { - 'huge-1': '95px', - 'huge-2': 'max(7.8vw, 120px)' + "huge-1": "95px", + "huge-2": "max(7.8vw, 120px)", }, colors: { - buzzwordsPrimary: '#F6C54B', + buzzwordsPrimary: "#F6C54B", vibrant: { DEFAULT: ({ opacityVariable, opacityValue }) => { if (opacityValue !== undefined) {