Skip to content

Commit 2b6aaf4

Browse files
committed
fixes asyncapi#264 - gallery added
1 parent 16e20e4 commit 2b6aaf4

File tree

11 files changed

+82
-34
lines changed

11 files changed

+82
-34
lines changed

components/Gallery/gallery.js

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import LightGallery from 'lightgallery/react';
2+
import Heading from '../Typography/heading'
3+
// import styles
4+
import 'lightgallery/css/lightgallery.css';
5+
import 'lightgallery/css/lg-zoom.css';
6+
import 'lightgallery/css/lg-thumbnail.css';
7+
import 'lightgallery/css/lg-autoplay.css';
8+
import 'lightgallery/css/lg-fullscreen.css';
9+
import 'lightgallery/css/lg-share.css';
10+
import 'lightgallery/css/lg-rotate.css';
11+
12+
13+
// import plugins if you need
14+
import lgThumbnail from 'lightgallery/plugins/thumbnail';
15+
import lgZoom from 'lightgallery/plugins/zoom';
16+
import lgAutoplay from 'lightgallery/plugins/autoplay'
17+
import lgFullscreen from 'lightgallery/plugins/fullscreen';
18+
import lgShare from 'lightgallery/plugins/share';
19+
import lgRotate from 'lightgallery/plugins/rotate';
20+
import Button from '../Buttons/button';
21+
22+
const images = [
23+
{ src: "/img/1.jpeg", alt: "1" },
24+
{ src: "/img/2.jpeg", alt: "2" },
25+
{ src: "/img/3.jpeg", alt: "3" },
26+
{ src: "/img/4.jpeg", alt: "4", },
27+
{ src: "/img/5.jpeg", alt: "5", },
28+
{ src: "/img/6.jpeg", alt: "6", },
29+
30+
]
31+
32+
function Gallery() {
33+
const onInit = () => {
34+
console.log('lightGallery has been initialized');
35+
};
36+
return (
37+
<div className="mt-20 mb-24">
38+
<Heading typeStyle='heading-md' className='text-gradient text-center lg:mt-10'>
39+
Our Past Event Gallery
40+
</Heading>
41+
<LightGallery
42+
onInit={onInit}
43+
speed={500}
44+
plugins={[lgThumbnail, lgZoom, lgAutoplay, lgFullscreen, lgRotate, lgShare]}
45+
>
46+
47+
{images.map((image, index) => {
48+
return (
49+
<a href={image.src} key={index}>
50+
<img alt={image.alt} src={image.src}
51+
className="max-w-full block p-5 border-2 border-transparent rounded-lg transition-transform hover:filter hover:opacity-90 hover:scale-101" />
52+
</a>
53+
)
54+
})}
55+
</LightGallery>
56+
<a className='flex justify-center items-center'>
57+
<Button overlay={true} className='w-[200px] border' >Browse all</Button>
58+
</a>
59+
</div>
60+
);
61+
}
62+
63+
export default Gallery

package-lock.json

+9-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"dependencies": {
1616
"axios": "^1.6.0",
1717
"d3": "^7.8.5",
18+
"lightgallery": "^2.7.2",
1819
"next": "^12.0.0",
1920
"react": "^17.0.2",
2021
"react-confetti": "^6.1.0",

pages/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import About from '../components/About/about';
1010
import TicketCards from '../components/Cards/ticketCards';
1111
import Heading from '../components/Typography/heading';
1212
import Paragraph from '../components/Typography/paragraph';
13+
import Gallery from '../components/Gallery/gallery'
1314

1415
export default function Home() {
1516
return (
@@ -46,6 +47,9 @@ export default function Home() {
4647
<div id='sponsors' className='mt-20'>
4748
<Sponsors imgs={['/img/apidays.png']} />
4849
</div>
50+
<div id='gallery' className='mt-20'>
51+
<Gallery />
52+
</div>
4953
</div>
5054
);
5155
}

public/img/1.jpeg

207 KB
Loading

public/img/2.jpeg

211 KB
Loading

public/img/3.jpeg

286 KB
Loading

public/img/4.jpeg

105 KB
Loading

public/img/5.jpeg

114 KB
Loading

public/img/6.jpeg

201 KB
Loading

styles/globals.css

+5
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,9 @@ mix-blend-mode: lighten;
207207

208208
.hoverEffect:hover {
209209
transform: scale(1.1); /* Scale the image by 10% on hover */
210+
}
211+
212+
.lg-react-element {
213+
column-count: 3;
214+
column-gap: 10px;
210215
}

0 commit comments

Comments
 (0)