neurocracy / drupal-omnipedia-site-theme

The Drupal theme for Omnipedia.
GNU General Public License v2.0
0 stars 0 forks source link

Off-canvas sidebars: implement touch gestures for opening and closing #23

Open Ambient-Impact opened 2 weeks ago

Ambient-Impact commented 2 weeks ago

Right now, the menu is only toggled by tapping the Menu link or via history states. It's much more intuitive on mobile to swipe horizontally to open a side menu.

Short term goal: implement simple swipe gestures to toggle the menu using Hammer.js. This won't require any signficant refactor of how the overlay and menu open and close from a CSS perspective.

Long term goal: refactor the menu so that we can do a real time pan/swipe that follows the pointer; a great example is the side menu on the Steam community site on small screens, where you can effectively grab the menu from the left side. Other examples are https://codepen.io/carl-victor-fontanos/pen/NQPLGW and https://github.com/xsonic/ff-swipe-menu that basically do the same thing.