Giter VIP home page Giter VIP logo

swipe-li's Introduction

Swipe-li

A three pane swipeable element. Swipe right for accept. Swipe left for reject. (AngularJS directive)

Live Demo

The code is largely based on the hammer.js carousel demo.

Developed at rangle.io

Dependencies

  • jQuery
  • AngularJS
  • Angular-touch
  • Hammerjs
  • Modernizr

Usage

bower install swipe-li --save

Include the following files in your app:

bower_components/jquery/dist/jquery.js
bower_components/modernizr/modernizr.js
bower_components/angular/angular.js
bower_components/hammerjs/hammer.js
bower_components/angular-touch/angular-touch.js
bower_components/dist/swipe-li.css
bower_components/dist/swipe-li.min.js

You then need to declare a dependency on the swipeLi module: angular.module('myApp', ['swipeLi']);

The Directive

<div
  swipe-li
  class="item"
  disabled=""
  intent="true"
  accept="done(item)"
  reject="skip(item)"
  main-content="'sample-content.html'"
  accept-content="'accept-content.html'"
  reject-content="'reject-content.html'"
  reset-to-content="false"
></div>
  • disabled: disable the swipe-li element.
  • intent: user Intent Detection. If the user drags the pane > 50% of the width the swipe will auto complete.
  • accept: accept callback.
  • reject: reject callback.
  • main-content: template for the start pane.
  • accept-content: template for the accept pane.
  • reject-content: template for the reject pane.
  • reset-to-content: should the swiped pane reset back to start pane on complete

Development

  1. Install dependencies $ npm install

  2. $ gulp dev starts a simple node server and watches for changes

  3. Go to http://localhost:3000/ to see the example app

swipe-li's People

Contributors

winkervsbecks avatar

Watchers

James Cloos avatar Awesome Libs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.