Skip to content

Commit

Permalink
Merge pull request #1 from boonboonsiri/photo-gallery
Browse files Browse the repository at this point in the history
Photo gallery
  • Loading branch information
boonboonsiri authored Aug 8, 2024
2 parents f3ee7bf + 2c354bb commit 9a51668
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 43 deletions.
8 changes: 8 additions & 0 deletions home/2021.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
sidebar_position: 3
---

import ImageGrid from '../src/components/image-grid.jsx'

## 📌 Lake Louise from Big Beehive

<ImageGrid>
![Lake Louise from Big Beehive](image-2.png)
</ImageGrid>

## 📌 Lake Moraine

<ImageGrid>
![](image-1.png)
</ImageGrid>

## 📌 Pond Hockey at Princess Point

<ImageGrid>
![pond hockey](image.png)
</ImageGrid>
20 changes: 13 additions & 7 deletions home/2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,48 @@
sidebar_position: 2
---

import ImageGrid from '../src/components/image-grid.jsx'


# 2022

## 📌 Fall in Waterloo

<ImageGrid>
![](image-11.png)

![](image-54.png)

![](image-3.png)

![](image-12.png)
</ImageGrid>

## 📌 Lauv Concert, Echo Beach

<ImageGrid>
![](image-4.png)

![](image-13.png)
</ImageGrid>

## 📌 Vancouver

![](image-51.png)

## 📌 Miami

<ImageGrid>
![](image-5.png)

![](image-6.png)
</ImageGrid>

## 📌 Tobermory

<ImageGrid>
![](image-10.png)

![](image-9.png)

![](image-7.png)
</ImageGrid>

## 📌 Blue Mountain

<ImageGrid>
![](image-8.png)
</ImageGrid>
50 changes: 16 additions & 34 deletions home/2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,81 @@
sidebar_position: 1
---

import ImageGrid from '../src/components/image-grid.jsx'

# 2023

Some of my adventures (yes some of these were shot on a phone and some of these were shot poorly but sometimes the best photos just capture the memory).

Shot on my Sony A7II or my Pixel.



## 📌 New York City

<ImageGrid>
![](image-46.png)

![](image-30.png)

![](image-48.png)

![](image-47.png)

![](image-44.png)

![](image-49.png)

![](image-50.png)

![](image-40.png)

![](image-38.png)

![](image-36.png)

![](image-37.png)

![](image-52.png)
</ImageGrid>



## 📌 Niagara Falls, ON

<ImageGrid>
![](image-35.png)

![](image-53.png)
</ImageGrid>

## 📌 Ottawa, ON

<ImageGrid>
![](image-43.png)

![](image-42.png)
</ImageGrid>


## 📌 Lewis Capaldi, Radio City Music Hall

<ImageGrid>
![](image-45.png)
</ImageGrid>

## 📌 Boston, MA

<ImageGrid>
![](image-41.png)
</ImageGrid>

## 📌 New York City

<ImageGrid>
![](image-30.png)

![](image-34.png)

![](image-33.png)

![](image-32.png)

![](image-31.png)

![](image-29.png)

![](image-28.png)

![](image-25.png)

![](image-26.png)

![](image-27.png)

![](image-24.png)

![](image-23.png)

![](image-22.png)

![](image-21.png)

![](image-20.png)

![](image-17.png)

![](image-15.png)

![](image-18.png)

![](image-19.png)

![](image-14.png)
</ImageGrid>
17 changes: 17 additions & 0 deletions home/2023_images.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const images = [
{
original: 'image-46.png',
thumbnail: 'image-46.png',
description: 'Image 46'
},
{
original: 'image-30.png',
thumbnail: 'image-30.png',
description: 'Image 30'
},
{
original: 'image-48.png',
thumbnail: 'image-48.png',
description: 'Image 48'
}
];
42 changes: 41 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"sass": "^1.69.7"
"react-grid-gallery": "^1.0.1",
"react-photo-album": "^3.0.1",
"sass": "^1.69.7",
"yet-another-react-lightbox": "^3.21.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.1",
Expand Down
Empty file removed src/components/Highlight.scss
Empty file.
56 changes: 56 additions & 0 deletions src/components/image-grid.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react';
import { useState } from 'react';
import Lightbox from "yet-another-react-lightbox";
import "yet-another-react-lightbox/styles.css";

import { Gallery } from 'react-grid-gallery';

import { RowsPhotoAlbum } from "react-photo-album";
import "react-photo-album/rows.css";

const ImageGrid = ({ transform, text, children }) => {
var images = children.props.children.length ? children.props.children : [children.props.children];
images = images.filter((image) => image.props)

images = images.map((image) => {
return { src: image.props.src, width: image.props.width, height: image.props.height }
})

const slides = images.map(({ src, width, height }) => ({
src: src,
width,
height,
}));

const [index, setIndex] = useState(-1);

// const handleClick = (index, item) => setIndex(index);

return (

<div className='ImageGrid'>
{/* <Gallery
images={images}
onClick={handleClick}
enableImageSelection={false}
margin={6}
rowHeight={400}
/> */}

<RowsPhotoAlbum
photos={slides}
targetRowHeight={400}
onClick={({ index: current }) => setIndex(current)}
spacing={20}
/>
<Lightbox
slides={slides}
open={index >= 0}
index={index}
close={() => setIndex(-1)}
/>
</div>
);
};

export default ImageGrid;
5 changes: 5 additions & 0 deletions src/css/Gallery.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


.yarl__container {
background: white !important;
}
1 change: 1 addition & 0 deletions src/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@import 'Sticker';
@import 'Carousel';
@import 'index';
@import 'Gallery';


@import url("https://use.typekit.net/eyh3ukd.css");
Expand Down
Empty file removed src/css/test.scss
Empty file.
1 change: 1 addition & 0 deletions todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/igordanchenko/react-photo-album

0 comments on commit 9a51668

Please sign in to comment.