Skip to content

A minimalistic library for emulating Android drawer swipe as close as possible.

License

Notifications You must be signed in to change notification settings

zebzhao/Drawer-Swipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drawer Swipe

A minimalistic swipe gesture library for emulating Android drawer swipe as closely as possible. Compatible with ES6, RequireJS, or plain JavaScript.

Even works for emulating notification swipes, card swipes, etc.

The library works by defining a touch area element, and letting the user handle the transformations that occur when the element is touched and swiped. The library can be implemented with a variety of CSS frameworks as well as customized components.

Getting Started

Install the library

  • with bower: bower install drawer-swipe
  • with npm: npm install drawer-swipe

Load the library:

  • Browser Global
var swiper = new DrawerSwipeRecognizer('#drawer');
  • AMD
define(['DrawerSwipeRecognizer'] , function (DrawerSwipeRecognizer) {
  var swiper = new DrawerSwipeRecognizer('#drawer');
});
  • CommonJS
var DrawerSwipeRecognizer = require('DrawerSwipeRecognizer');
var swiper = new DrawerSwipeRecognizer('#drawer');
  • ES2015 Modules (after npm install)
import {DrawerSwipeRecognizer} from 'drawer-swipe-recognizer';
var swiper = new DrawerSwipeRecognizer('#editor');

About

A minimalistic library for emulating Android drawer swipe as close as possible.

Resources

License

Stars

Watchers

Forks

Packages

No packages published