MCPcopy
hub / github.com/AlloyTeam/PhyTouch

github.com/AlloyTeam/PhyTouch @main sqlite

repository ↗ · DeepWiki ↗
752 symbols 1,421 edges 28 files 164 documented · 22%
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)

Related links

License

This content is released under the MIT License.

Extension points exported contracts — how you extend this code

PhyTouchProps (Interface)
(no doc)
index.d.ts
PhyTouch (Interface)
(no doc)
index.d.ts

Core symbols most depended-on inside this repo

set
called by 127
transformjs/react/transform.react.js
invariant
called by 116
transformjs/react/example/index.js
_rounded
called by 40
transformjs/react/transform.react.js
multiplyMatrices
called by 33
transformjs/react/transform.react.js
addLine
called by 25
example/threejs/asset/three.js
setPoint
called by 21
example/threejs/asset/three.js
paramThreeToGL
called by 20
example/threejs/asset/three.js
G
called by 17
index.js

Shape

Function 717
Method 25
Class 8
Interface 2

Languages

TypeScript100%

Modules by API surface

transformjs/react/example/index.js377 symbols
example/threejs/asset/three.js222 symbols
transformjs/react/transform.react.js19 symbols
index.d.ts14 symbols
select/index.js11 symbols
index.js11 symbols
index.esm.js11 symbols
index.esm.min.js10 symbols
transformjs/asset/createjs.tween.js8 symbols
select/asset/alloy_touch.js8 symbols
index.min.js8 symbols
refresh/refresh_plugin/alloy_touch.refresh.js7 symbols

Dependencies from manifests, versioned

babel-core6.20.0 · 1×
babel-loader6.2.9 · 1×
babel-preset-es20156.18.0 · 1×
babel-preset-react6.16.0 · 1×
css3transformlatest · 1×
phy-touchlatest · 1×
react15.4.1 · 1×
react-dom15.4.1 · 1×

For agents

$ claude mcp add PhyTouch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact