Create a minimal Lightbox Gallery. A lightbox gallery is an image gallery with many images lined up as tiles. Once a tile is clicked, a full-screen image opens up in a Modal, showing the clicked picture. It also has all the other images lined up at the bottom. Once a tile at the bottom is clicked, it shows the clicked image in full screen.
overlay
of black with opacity 0.5
should be applied on the image thumbnail.images
object in images.ts
is provided in the boilerplate code. All the links to the images will be there.Click to reveal
A Modal will be useful in order to show the image to the user. Use useState()
hook to open and close the modal.
Click to reveal
Keep track of the activeImage
in the state. Whenever an activeImage
is there, the modal opens up. Whenever the modal closes, reset the activeImage to null
Click to reveal
use Javascript events to keep track of click events. e.stopPropagation()
will help you STOP modal close events on some of the pages where it is not required.