{"id":13677264,"url":"https://github.com/AlloyTeam/PhyTouch","last_synced_at":"2025-04-29T10:32:24.471Z","repository":{"id":38043199,"uuid":"44102113","full_name":"AlloyTeam/PhyTouch","owner":"AlloyTeam","description":"Smooth scrolling, rotation, pull to refresh, page transition and any motion for the web - 丝般顺滑的触摸运动方案","archived":false,"fork":false,"pushed_at":"2023-01-06T03:01:47.000Z","size":4027,"stargazers_count":2972,"open_issues_count":85,"forks_count":524,"subscribers_count":159,"default_branch":"master","last_synced_at":"2025-04-22T16:42:36.611Z","etag":null,"topics":["css3transform","motion","scroll","scrolling","touch","transform","transformations","transformjs"],"latest_commit_sha":null,"homepage":"http://alloyteam.github.io/PhyTouch/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlloyTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-12T11:04:43.000Z","updated_at":"2025-04-16T18:17:59.000Z","dependencies_parsed_at":"2023-02-05T04:17:22.280Z","dependency_job_id":null,"html_url":"https://github.com/AlloyTeam/PhyTouch","commit_stats":null,"previous_names":["alloyteam/alloytouch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlloyTeam%2FPhyTouch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlloyTeam%2FPhyTouch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlloyTeam%2FPhyTouch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlloyTeam%2FPhyTouch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlloyTeam","download_url":"https://codeload.github.com/AlloyTeam/PhyTouch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326840,"owners_count":21571636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css3transform","motion","scroll","scrolling","touch","transform","transformations","transformjs"],"created_at":"2024-08-02T13:00:39.648Z","updated_at":"2025-04-29T10:32:19.457Z","avatar_url":"https://github.com/AlloyTeam.png","language":"JavaScript","readme":"## PhyTouch\n\n丝般顺滑的触摸运动方案\n\nSmooth scrolling, rotation, pull to refresh and any motion for the web.\n\n## Install\n\n```js\nnpm install phy-touch\n```\n\n* [https://unpkg.com/phy-touch@0.2.6/index.js](https://unpkg.com/phy-touch@0.2.6/index.js)\n\n## Usage\n\n```js\nvar phyTouch = new PhyTouch({\n  touch:\"#wrapper\",//反馈触摸的dom\n  vertical: true,//不必需，默认是true代表监听竖直方向touch\n  target: { y: 0 }, //运动的对象\n  property: \"y\",  //被运动的属性\n  min: 100, //不必需,运动属性的最小值\n  max: 2000, //不必需,滚动属性的最大值\n  sensitivity: 1,//不必需,触摸区域的灵敏度，默认值为1，可以为负数\n  factor: 1,//不必需,表示触摸位移运动位移与被运动属性映射关系，默认值是1\n  moveFactor: 1,//不必需,表示touchmove位移与被运动属性映射关系，默认值是1\n  step: 45,//用于校正到step的整数倍\n  bindSelf: false,\n  maxSpeed: 2, //不必需，触摸反馈的最大速度限制 \n  value: 0,\n  change:function(value){ \n    target.style.transform = \"translate(0,\" + value + \"px)\"\n    target.style.webkitTransform = \"translate(0,\" + value + \"px)\"\n  }, \n  touchStart:function(evt, value){  },\n  touchMove:function(evt, value){  },\n  touchEnd:function(evt,value){  },\n  tap:function(evt, value){  },\n  pressMove:function(evt, value){  },\n  animationEnd:function(value){  } //运动结束\n})\n```\n\n通过对象的实例可以自行运动DOM:\n\n``` js\nphyTouch.to(value, time, ease)\n```\n\n* `value`是必填项\n* `time`是非必填项，默认值是600\n* `ease`是非必填项，默认值是先加速后减速的运动函数，CSS版本默认值是`cubic-bezier(0.1, 0.57, 0.1, 1)`\n\n\n通过对象的实例可以自行停止DOM运动:\n\n``` js\nphyTouch.stop()\n```\n\n## Demo(Mobile)\n\n- Pull To Refresh: [http://alloyteam.github.io/PhyTouch/refresh/pull_refresh/](http://alloyteam.github.io/PhyTouch/refresh/pull_refresh/)\n- QQ KanDian: [http://alloyteam.github.io/PhyTouch//refresh/infinite/kandian.html](http://alloyteam.github.io/PhyTouch//refresh/infinite/kandian.html)\n- Full Page Scroll : [http://alloyteam.github.io/PhyTouch/full_page/](http://alloyteam.github.io/PhyTouch/full_page/)\n- Simple : [http://alloyteam.github.io/PhyTouch/example/simple.html](http://alloyteam.github.io/PhyTouch/example/simple.html)\n- 3D : [http://alloyteam.github.io/PhyTouch/example/3d.html](http://alloyteam.github.io/PhyTouch/example/3d.html)\n- Rotate : [http://alloyteam.github.io/PhyTouch/example/rotate.html](http://alloyteam.github.io/PhyTouch/example/rotate.html)\n- Carousel : [http://alloyteam.github.io/PhyTouch/example/carousel.html](http://alloyteam.github.io/PhyTouch/example/carousel.html)\n- Carousel2 : [http://alloyteam.github.io/PhyTouch/example/carousel2.html](http://alloyteam.github.io/PhyTouch/example/carousel2.html)\n- Three.js : [http://alloyteam.github.io/PhyTouch/example/threejs/](http://alloyteam.github.io/PhyTouch/example/threejs/)\n\n## Related links\n\n* [omi-touch: Omi /PhyTouch integration](https://github.com/Tencent/omi/tree/master/packages/omi-touch)\n* [PhyTouch Wiki](https://github.com/AlloyTeam/PhyTouch/wiki)\n\n## License\nThis content is released under the [MIT](http://opensource.org/licenses/MIT) License.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlloyTeam%2FPhyTouch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlloyTeam%2FPhyTouch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlloyTeam%2FPhyTouch/lists"}