Skip to content

Commit

Permalink
fixes asyncapi#267 - gallery added
Browse files Browse the repository at this point in the history
  • Loading branch information
cybraia committed Mar 25, 2024
1 parent 16e20e4 commit d7ef192
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 34 deletions.
63 changes: 63 additions & 0 deletions components/Gallery/gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import LightGallery from 'lightgallery/react';
import Heading from '../Typography/heading'
// import styles
import 'lightgallery/css/lightgallery.css';
import 'lightgallery/css/lg-zoom.css';
import 'lightgallery/css/lg-thumbnail.css';
import 'lightgallery/css/lg-autoplay.css';
import 'lightgallery/css/lg-fullscreen.css';
import 'lightgallery/css/lg-share.css';
import 'lightgallery/css/lg-rotate.css';


// import plugins if you need
import lgThumbnail from 'lightgallery/plugins/thumbnail';
import lgZoom from 'lightgallery/plugins/zoom';
import lgAutoplay from 'lightgallery/plugins/autoplay'
import lgFullscreen from 'lightgallery/plugins/fullscreen';
import lgShare from 'lightgallery/plugins/share';
import lgRotate from 'lightgallery/plugins/rotate';
import Button from '../Buttons/button';

const images = [
{ src: "/img/1.jpeg", alt: "1" },
{ src: "/img/2.jpeg", alt: "2" },
{ src: "/img/3.jpeg", alt: "3" },
{ src: "/img/4.jpeg", alt: "4", },
{ src: "/img/5.jpeg", alt: "5", },
{ src: "/img/6.jpeg", alt: "6", },

]

function Gallery() {
const onInit = () => {
console.log('lightGallery has been initialized');
};
return (
<div className="mt-20 mb-24">
<Heading typeStyle='heading-md' className='text-gradient text-center lg:mt-10'>
Our Past Event Gallery
</Heading>
<LightGallery
onInit={onInit}
speed={500}
plugins={[lgThumbnail, lgZoom, lgAutoplay, lgFullscreen, lgRotate, lgShare]}
>

{images.map((image, index) => {
return (
<a href={image.src} key={index}>
<img alt={image.alt} src={image.src}
className="max-w-full block p-5 border-2 border-transparent rounded-lg transition-transform hover:filter hover:opacity-90 hover:scale-101" />
</a>
)
})}
</LightGallery>
<a className='flex justify-center items-center'>
<Button overlay={true} className='w-[200px] border' >Browse all</Button>
</a>
</div>
);
}

export default Gallery
43 changes: 9 additions & 34 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"axios": "^1.6.0",
"d3": "^7.8.5",
"lightgallery": "^2.7.2",
"next": "^12.0.0",
"react": "^17.0.2",
"react-confetti": "^6.1.0",
Expand Down
4 changes: 4 additions & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import About from '../components/About/about';
import TicketCards from '../components/Cards/ticketCards';
import Heading from '../components/Typography/heading';
import Paragraph from '../components/Typography/paragraph';
import Gallery from '../components/Gallery/gallery'

export default function Home() {
return (
Expand Down Expand Up @@ -46,6 +47,9 @@ export default function Home() {
<div id='sponsors' className='mt-20'>
<Sponsors imgs={['/img/apidays.png']} />
</div>
<div id='gallery' className='mt-20'>
<Gallery />
</div>
</div>
);
}
Binary file added public/img/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,9 @@ mix-blend-mode: lighten;

.hoverEffect:hover {
transform: scale(1.1); /* Scale the image by 10% on hover */
}

.lg-react-element {
column-count: 3;
column-gap: 10px;
}

0 comments on commit d7ef192

Please sign in to comment.