nizioleque / mouse-pinch-to-zoom

A browser extension emulating pinch-to-zoom with a mouse wheel.
15 stars 2 forks source link

[Feature Request] Implement smart zoom #5

Open thisiscam opened 1 month ago

thisiscam commented 1 month ago

Hi!

I wonder if the author would consider implementing this feature: automatically zoom to an element / area by triggering a keyboard or mouse event (e.g. double click middle scrollwheel, for example)

This is to replicate the "smart zoom" feature implemented in Safari for macOS with magic mouse. There are various smart zoom chrome extensions out there, but none work correctly. This repo seems to implement the pinch zoom pretty close to perfect so that I think a smart zoom should be possible to implement as well.

One can reference this code to infer where and how much to zoom. I think the rest is pretty much just calling the zoom function already provided by the code in this repo and it should work!

nizioleque commented 1 month ago

Hi, thank you for the suggestion. This sounds cool and I would definitely like to implement that, but unfortunately I don't have time to work on the extension so it might take a couple of months.

In the meantime, feel free to try doing it yourself 🙂. I'd be happy to help if you have any questions.

thisiscam commented 1 month ago

Hi, thank you for the suggestion. This sounds cool and I would definitely like to implement that, but unfortunately I don't have time to work on the extension so it might take a couple of months.

In the meantime, feel free to try doing it yourself 🙂. I'd be happy to help if you have any questions.

I did a simple attempt yesterday. There are quite some code I haven't tried to understand, but it seems to work! Perhaps you (or someone) can try it and give some feedback ?