diff --git a/src/components/sections/PictureGrid.astro b/src/components/sections/PictureGrid.astro new file mode 100644 index 0000000..5e44ca1 --- /dev/null +++ b/src/components/sections/PictureGrid.astro @@ -0,0 +1,20 @@ +--- +import ImageGridItem from "../utils/PictureGridItem.astro"; + +const images = await Astro.glob("/src/images/sunset/*").then((files) => { + return files + .map((file) => file.default) + .sort((a, b) => + Number(a.src.split("/").pop().split(".")[0]) > + Number(b.src.split("/").pop().split(".")[0]) + ? 1 + : -1 + ); +}); + +console.log(images); +--- + +
+ {images.map((image) => )} +
diff --git a/src/components/utils/PictureGridItem.astro b/src/components/utils/PictureGridItem.astro new file mode 100644 index 0000000..4a6bcb5 --- /dev/null +++ b/src/components/utils/PictureGridItem.astro @@ -0,0 +1,34 @@ +--- +import { Image } from "astro:assets"; +import data from "../../data/pictures.json"; + +interface ImageData { + [key: string]: { + location: string; + }; +} +const imageData: ImageData = data; + +interface Props { + image: any; +} + +const { image }: Props = Astro.props; +const name = image.src.split("/").pop().split(".")[0]; +--- + +
+
+ + {imageData[name].location} +
+
+ + diff --git a/src/data/pictures.json b/src/data/pictures.json new file mode 100644 index 0000000..1643148 --- /dev/null +++ b/src/data/pictures.json @@ -0,0 +1,53 @@ +{ + "1": { + "location": "Michigan" + }, + "2": { + "location": "Ann Arbor, MI" + }, + "3": { + "location": "San Mateo, CA" + }, + "4": { + "location": "Ann Arbor, MI" + }, + "5": { + "location": "Millbrae, CA" + }, + "6": { + "location": "Ann Arbor, MI" + }, + "7": { + "location": "Ann Arbor, MI" + }, + "8": { + "location": "Yosemite, CA" + }, + "9": { + "location": "Ann Arbor, MI" + }, + "10": { + "location": "Millbrae, CA" + }, + "11": { + "location": "Lands End, CA" + }, + "12": { + "location": "San Mateo, CA" + }, + "13": { + "location": "Lands End, CA" + }, + "14": { + "location": "San Mateo, CA" + }, + "15": { + "location": "Ann Arbor, MI" + }, + "16": { + "location": "Half Moon Bay, CA" + }, + "17": { + "location": "Michigan" + } +} \ No newline at end of file diff --git a/src/images/sunset/1.jpg b/src/images/sunset/1.jpg new file mode 100644 index 0000000..b773c40 Binary files /dev/null and b/src/images/sunset/1.jpg differ diff --git a/src/images/sunset/10.jpg b/src/images/sunset/10.jpg new file mode 100644 index 0000000..cdaed8b Binary files /dev/null and b/src/images/sunset/10.jpg differ diff --git a/src/images/sunset/11.jpg b/src/images/sunset/11.jpg new file mode 100644 index 0000000..4bf494d Binary files /dev/null and b/src/images/sunset/11.jpg differ diff --git a/src/images/sunset/12.jpg b/src/images/sunset/12.jpg new file mode 100644 index 0000000..cddab48 Binary files /dev/null and b/src/images/sunset/12.jpg differ diff --git a/src/images/sunset/13.jpg b/src/images/sunset/13.jpg new file mode 100644 index 0000000..d3d7796 Binary files /dev/null and b/src/images/sunset/13.jpg differ diff --git a/src/images/sunset/14.jpg b/src/images/sunset/14.jpg new file mode 100644 index 0000000..ef3be62 Binary files /dev/null and b/src/images/sunset/14.jpg differ diff --git a/src/images/sunset/15.JPG b/src/images/sunset/15.JPG new file mode 100644 index 0000000..098df2b Binary files /dev/null and b/src/images/sunset/15.JPG differ diff --git a/src/images/sunset/16.jpg b/src/images/sunset/16.jpg new file mode 100644 index 0000000..e31e610 Binary files /dev/null and b/src/images/sunset/16.jpg differ diff --git a/src/images/sunset/17.JPG b/src/images/sunset/17.JPG new file mode 100644 index 0000000..82f0ab0 Binary files /dev/null and b/src/images/sunset/17.JPG differ diff --git a/src/images/sunset/2.jpg b/src/images/sunset/2.jpg new file mode 100644 index 0000000..d6c6092 Binary files /dev/null and b/src/images/sunset/2.jpg differ diff --git a/src/images/sunset/3.jpg b/src/images/sunset/3.jpg new file mode 100644 index 0000000..6129570 Binary files /dev/null and b/src/images/sunset/3.jpg differ diff --git a/src/images/sunset/4.jpg b/src/images/sunset/4.jpg new file mode 100644 index 0000000..8fdfdcd Binary files /dev/null and b/src/images/sunset/4.jpg differ diff --git a/src/images/sunset/5.jpg b/src/images/sunset/5.jpg new file mode 100644 index 0000000..aca21c1 Binary files /dev/null and b/src/images/sunset/5.jpg differ diff --git a/src/images/sunset/6.jpg b/src/images/sunset/6.jpg new file mode 100644 index 0000000..ca65e1f Binary files /dev/null and b/src/images/sunset/6.jpg differ diff --git a/src/images/sunset/7.jpg b/src/images/sunset/7.jpg new file mode 100644 index 0000000..3b223fd Binary files /dev/null and b/src/images/sunset/7.jpg differ diff --git a/src/images/sunset/8.jpg b/src/images/sunset/8.jpg new file mode 100644 index 0000000..324ce8a Binary files /dev/null and b/src/images/sunset/8.jpg differ diff --git a/src/images/sunset/9.jpg b/src/images/sunset/9.jpg new file mode 100644 index 0000000..4b68d55 Binary files /dev/null and b/src/images/sunset/9.jpg differ diff --git a/src/pages/pictures.astro b/src/pages/pictures.astro new file mode 100644 index 0000000..89436e9 --- /dev/null +++ b/src/pages/pictures.astro @@ -0,0 +1,26 @@ +--- +import PictureGrid from "../components/sections/PictureGrid.astro"; +import PageWrapper from "../layouts/PageWrapper.astro"; +--- + + +
+

Pictures

+

I take a lot of pictures. Here are some of them.

+ +
+
+ +