How do you build the modals to show expanded versions of images when you click them?<p>I've become opinionated on this. My guidelines are:<p>1) Use most of the screen available, something like 90% width/height.<p>2) Close the image when clicking ANYWHERE on the modal. This includes the image itself.<p>3) No need for a close button.<p>This allows more viewing area and easy closing method if you know that you just have to click anywhere to go back to what you were doing.<p>Sites like Discord make it tough on me because they restrict the viewing area too much, they don't expand much. And this is because they expect you to click on the surrounding area to close it. If clicking the image closed it they could expand more.<p>4) Have a button to expand images vertically.<p>This is for very long images.<p>I show first a normal version of the image where it is completely visible, but maybe hard to read. If the user chooses so they click a button which expands the image vertically and allows the user to scroll to read the image.<p>I experimented with expanding vertically automatically but I found this to be not very natural, as I expected to see the "whole picture" first.
A modal image on my site looks like this:<p><a href="https://i.imgur.com/l2XCa2y.jpg" rel="nofollow">https://i.imgur.com/l2XCa2y.jpg</a>