Retour au classement

AlloyTeam/PhyTouch

JavaScriptalloyteam.github.io/PhyTouch/

Smooth scrolling, rotation, pull to refresh, page transition and any motion for the web - 丝般顺滑的触摸运动方案

touchscrollingscrolltransformtransformationsmotiontransformjscss3transform
Croissance des étoiles
Étoiles
3k
Forks
515
Croissance hebdomadaire
Issues
88
1k2k
oct. 2015mai 2019déc. 2022juil. 2026
Artefactsnpmnpm install phytouch
README

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,//不必需,默认是true代表监听竖直方向touch
  target: { y: 0 }, //运动的对象
  property: "y",  //被运动的属性
  min: 100, //不必需,运动属性的最小值
  max: 2000, //不必需,滚动属性的最大值
  sensitivity: 1,//不必需,触摸区域的灵敏度,默认值为1,可以为负数
  factor: 1,//不必需,表示触摸位移运动位移与被运动属性映射关系,默认值是1
  moveFactor: 1,//不必需,表示touchmove位移与被运动属性映射关系,默认值是1
  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是必填项
  • time是非必填项,默认值是600
  • ease是非必填项,默认值是先加速后减速的运动函数,CSS版本默认值是cubic-bezier(0.1, 0.57, 0.1, 1)

通过对象的实例可以自行停止DOM运动:

phyTouch.stop()

Demo(Mobile)

License

This content is released under the MIT License.

Dépôts similaires
nolimits4web/swiper

Most modern mobile touch slider with hardware accelerated transitions

TypeScriptnpmMIT Licenseswipeswiper
swiperjs.com
41.9k9.6k
SortableJS/Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.

JavaScriptnpmMIT Licensedragsortable
sortablejs.github.io/Sortable/
31.2k3.7k
framework7io/framework7

Full featured HTML framework for building iOS & Android apps

JavaScriptnpmMIT Licenseframeworkios
framework7.io
18.7k3.2k
taye/interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

TypeScriptnpmMIT Licensedrag-and-dropinertia
interactjs.io
12.9k805
AlloyTeam/Mars

腾讯移动 Web 前端知识库

MIT Licensemobiletouch
9.7k1.9k
davidjerleke/embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.

TypeScriptnpmMIT Licensecarouselslider
embla-carousel.com
8.4k257
fancyapps/fancybox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

JavaScriptnpmfancyboxlightbox
fancyapps.com
7.2k1.7k
rcbyr/keen-slider

The HTML touch slider carousel with the most native feeling you will get.

TypeScriptnpmMIT Licenseslidercarousel
keen-slider.io
5k216
Toxblh/MTMR

🌟 [My TouchBar My rules]. The Touch Bar Customisation App for your MacBook Pro

SwiftMIT Licensetouchbarmacos
mtmr.app
4.3k231
AlloyTeam/AlloyFinger

Super tiny size multi-touch gestures library for the web.    You can touch this →

JavaScriptnpmMIT Licensetouchgesture
alloyteam.github.io/AlloyFinger/
3.4k539
kornelski/slip

Slip.js — UI library for manipulating lists via swipe and drag gestures

JavaScriptnpmBSD 2-Clause "Simplified" Licensereorderingswipe
2.4k210
zingchart/zingtouch

A JavaScript touch gesture detection library for the modern web

JavaScriptnpmMIT Licensegesturetouch
zingchart.github.io/zingtouch/
2.1k130