Awesome Open Source
Awesome Open Source

PhyTouch

Smooth scrolling, rotation, pull to refresh and any motion for the web.

Install

npm install phy-touch

Usage

var phyTouch = new PhyTouch({
  touch:"#wrapper",//dom
  vertical: true,//truetouch
  target: { y: 0 }, //
  property: "y",  //
  min: 100, //,
  max: 2000, //,
  sensitivity: 1,//,1
  factor: 1,//,1
  moveFactor: 1,//,touchmove1
  step: 45,//step
  bindSelf: false,
 maxSpeed: 2, // 
  value: 0,
  change:function(value){ 
    target.style.transform = "translate(0," + value + "px)"
    target.style.webkitTransform = "translate(0," + value + "px)"
  }, 
  touchStart:function(evt, value){  },
  touchMove:function(evt, value){  },
  touchEnd:function(evt,value){  },
  tap:function(evt, value){  },
  pressMove:function(evt, value){  },
  animationEnd:function(value){  } //
})

DOM:

phyTouch.to(value, time, ease)
  • value
  • time600
  • easeCSScubic-bezier(0.1, 0.57, 0.1, 1)

DOM:

phyTouch.stop()

Demo(Mobile)

Related links

License

This content is released under the MIT License.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Scroll (570
Transform (428
Transformations (372
Scrolling (367
Touch (335
Motion (320
Related Projects