miloxeon / fast-image-zoom

🏞 Fast image zoom on click as seen on a popular publishing platform
https://miloslav.website/fast-image-zoom
Boost Software License 1.0
41 stars 3 forks source link

Pinch to zoom further #14

Open tumispro opened 1 year ago

tumispro commented 1 year ago

The plugin is really excellent. As the zoom feels like a mobile phone photoviewer, would it perhaps be possible to allow further zooming in/out using pinch gestures on a trackpad or mobile device, or perhaps ctrl/command + scroll on a desktop?

miloxeon commented 1 year ago

Hi @tumispro! Thanks for the feedback. Glad you liked it!

Not incorporating pinch-to-zoom and similar patterns was a conscious decision. Every browser, desktop and mobile, has its own way to zoom on the web. If I mimic them, it will result in double zoom: my plugin will zoom in the picture while the browser is zooming in on the whole page. I've seen that in other plugins, and I didn't like it. For example, as of today, this happens in Slack's picture viewer.

If I invent my own gestures/shortcuts, users won't be familiar with them and won't know how to zoom.

The only way is to disable browser's default zoom in behaviour in favour of my plugin's. This will break the accessibility.

Bottom line is, this plugin is designed to fit organically and doesn't try to take over the control. The browser default zoom in/zoom out actions work with the plugin perfectly. While the picture is zoomed in, you can zoom in even further by zooming in the page itself.

The only scenario it doesn't work with is for the websites where developers disabled page zoom with a viewport meta tag. This is a bad accessibility practice, and it's not in the scope of this plugin to fix it.

tumispro commented 1 year ago

Thank you for the fast and kind response. I completely agree. I think the issue for me is rather that on mobile if I try to zoom in the image will 'close', as it registers the click first. Do you know if there's a workaround for this? Or perhaps it could close on mouseup/touchup, instead of mousedown/touchdown as it seems to work now?

Here's a little demo to show you what I mean:

https://user-images.githubusercontent.com/1461426/207859621-5b8cf145-2c6a-4d03-8cc9-6fdb0989be54.mov

miloxeon commented 1 year ago

Oh, I see. Thanks for pointing it out. Unfortunately I’m not at my best now in terms of productivity because of my depression, so if you can make a PR, I would appreciate that. Otherwise, I will do it, but I can’t provide an estimate.

tumispro commented 1 year ago

Will look into it. Hope things will turn brighter for you soon, thank you for the amazing plugin!