pxl icon indicating copy to clipboard operation
pxl copied to clipboard

Swipe left/right for next/previous picture

Open Ckef opened this issue 6 years ago • 1 comments

In addition to the left/right buttons, swiping would be nice on mobile.

Ckef avatar Apr 29 '19 10:04 Ckef

I think swipe to navigate is nice, but one of the explicit goals of pxl (and the reason we got it out of the door in < 200 commits) is to not re-implement stuff that browsers do already.

That being said; I'd be delighted to accept a well-written pull request which implements swipe navigation in a nice polished way. However, I am a bit pessimistic about the chances of such an effort; especially on whether the implementation would be a net-win for all users.

I am concerned about:

  • Performance on lower-end devices
  • 'Native'-feel or lack thereof
  • Maintenance burden of the swipe code

I feel this way because there isn't a standard/browser API for detecting gestures. There's touchstart/touchmove/touchend, but then you end up with code like this: https://stackoverflow.com/a/23230280/2099958

So you have two options:

  • Write something yourself. I'd be open to a PR which does this nicely.
  • Add a bunch of dependencies from NPM. If we do this, I'd like this dependency vendored and to be usable without a module bundler.

I'd judge a potential PR implementing this on:

  • Emperical performance on a low end device
  • Does it actually add to the UX and polish of pxl?
  • Whether it imports a bazillion lines of JS (perf, maintainability)

duijf avatar Apr 29 '19 16:04 duijf