Lightbox UX Improvement: Allow Modal Close on Click Outside Image #1031
lucafalefoto
started this conversation in
Development
Replies: 2 comments 3 replies
-
|
Thank you for this input, @lucafalefoto. We will take this feature improvement into consideration. We also enjoyed checking out your Quire site. Bravo! It's a beautiful publication. Is this project complete? If so, we'd love to include it on our Community Showcase and in the Quire newsletter? If you are open to this, please complete this submission form. |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
Apologies for the delay. This has been moved to our issues board as a potential feature request/enhancement #1098 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
First of all, I’d like to say how much I enjoy using Quire as a static site generator—thank you for all the great work!
I imagine I’m not the only one using Quire primarily for building static websites rather than for e-publishing. In this context, a smooth and intuitive user experience is key.
I wanted to share a UX-related improvement suggestion for the lightbox/modal behavior when viewing images. Currently, when a user clicks an image on a page, a full-screen modal opens, allowing navigation between images. This works great—but there's one missing interaction:
To close the modal, the user must click the close button. Clicking anywhere else, like the background area outside the image, does nothing. From a user experience perspective, this is unexpected—most users today would anticipate that clicking outside the image (but inside the modal) would also close it.
It took me a fair bit of time to implement this expected behavior because it requires modifications across three separate files:
project-base-directory/_layouts/base.11ty.jsI had to manually include the
custom.jsscript before the closing</body>tag [becausecustom.jsis ignored by default, see: https://github.com/Feature Request: Automatically Include custom.js Without Editing base.11ty.js #1030#discussion-8326034]:project-base-directory/content/_assets/styles/custom.cssI added the following rule to improve the layout of the lightbox image:
project-base-directory/content/_assets/javascript/custom.jsI added this event listener to close the modal when the user clicks outside the image:
If you'd like to see this in action, feel free to test it on this site I built with Quire (sorry, Italian only):
👉 https://www.padova-decorata.it/
It would be fantastic if this functionality (or something similar) could be considered as a default behavior—or at least easier to implement without editing multiple files.
Thanks again for your hard work and support!
Beta Was this translation helpful? Give feedback.
All reactions