-
-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: image pinch to zoom #1620
feat: image pinch to zoom #1620
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for elk-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great - thank you! I wonder about disabling rotation - I think it might feel more stable if it was just scaling that we applied?
Yes! that's it, but pls disable rotation |
FYI: a PR with similar approach #1367 has been closed recently due to @vueuse/gesture is "not enough battle tested" |
I don't know, but maybe it's just better implemented now 🤷 |
I was just talking to @userquin about this and agreed that it should be merged. I think we should disable the rotation first but after that I think it is good enough for now. It will be easier to iterate on this kind of thing ones was have the basic functionality implemented. So after rotation is removed, LGTM |
Are we certain this is good enough? There is a lack of navigating around a zoomed in image (I.e. focussing on a detail in an image in say the top left), but I am uncertain how we would tackle such a thing in a non frustrating way while somehow figuring out whether the user intended to slide to another image or wanted to move the image view around. |
LGTM (if rotation removed), is there any chance to include also swap on desktop via mouse? |
Rotation has been removed with my last commit, but what do you mean by swap on desktop? |
how about zooming with double tap/click (back to initial)? |
try this on desktop with mouse click + drag left/right https://swiperjs.com/ |
Do you mean to suggest to use the library behind this as well, or just that the behavior should be like that? |
I think right now just getting a basic implementation is what is most important. The app is still in alpha and it is a good time to iterate on these types of features. Also this will hit canary before hitting the main branch, so I think it is okay |
I'm asking you if we can have mouse click + drag in this PR, the link was to show you an example, this library is the alternative we're checking ( EDIT: we can include zooming and mouse click + drag in next iteration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just made a blackbox QA and did not check the code / implementation
IMO this is a HUGE improvement ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets merge and iterate. Thanks @JohnyTheCarrot for pushing this forward 🧡
No problem, glad to help! |
Thanks for taking on the problem. However, this change is behaving weirdly on my desktop (Edge 110 on macOS). After pinch to zoom in and out, images could get upside down, and after that, any pinch action only enlarges the image. Here's a screen recording: screen.mp4BTW, does anyone know this library? It's performing amazingly on my Mac, iOS Safari and Android Chrome, not sure about other devices. |
fix #1595
We should discuss the UX of this code before I mark it as ready for review, I'd reckon.