alpheios-project / pwa-prototype

Protype of an alpheios-enabled PWA
GNU General Public License v3.0
0 stars 0 forks source link

prevent pinch-zoom on page content from zooming panel #19

Open balmas opened 6 years ago

balmas commented 6 years ago

per @kirlat The pinch zoom works by default, but it magnifies a panel too. It would probably better to magnify just text, but keep the panel fixed size

kirlat commented 6 years ago

I think the only viable solution to this would be to disable a browser-handled page zoom completely first. This can be done (in a simplest way) via modifying/injecting a viewport meta tag into a page header. The code already does viewport meta injection on pages where it is missing to prevent scaling issues of Alpheios UI elements (panel, back to TOC button).

The other solution would probably to intercept all touch events and use preventDefault to prevent them getting to the browser, but it might not work reliably on different platforms and might have some performance implications.

The second part would be to attach to the page a code that will intercept a pinch zoom gesture and will zoom a page content only. However, it's yet to be seen how reliable it will work on pages with different layouts and CSS rules.

That's the ideas I have so far.

balmas commented 6 years ago

I think this is one of the things I want to request user feedback on before we put too much effort into it.