zzarcon/wallapop-webapp — pull request #12 by cibernox (2014-12-22 01:10:17+00:00)
Title: [WIP] Touch events

Naive touch events to simulate opening the application’s menu using
a swipe movement starting near the left border of the device.

Features:

* The menu follows the movement of the finger, like being dragged.
* Uses requestAnimationFrame to have a smooth animation.
* When the swipe movement is being made, the event is not propagated in
order to avoid scrolling, but for usability and performance (scrolling
while the menu is being animated caused sluggishness in the animation)
* When touch event ends passed the 50%, the animation finalizes (it
expands/collapses completely). Otherwise, the animation is aborted.

Simplifications:

* Simplified lateral menu markup & styles.
* Semitransparent black overlay removed. TODO: add it again.
* Transparent-to-visible animation is removed. I prefer it without animation.
* Box shadow on hover on the items removed. Caused a performance penalty
and mobile devices don’t have :hover.

Nice to haves:

* Implement some kind of inertia. So if the finger ir released before the expansion completes
but the movement is fast enough, finalize the expansion of the menu.