{"id":25393621,"url":"https://github.com/xd-tayde/touchkit","last_synced_at":"2025-10-30T19:30:45.183Z","repository":{"id":57378362,"uuid":"99105371","full_name":"xd-tayde/touchkit","owner":"xd-tayde","description":"基于mtouch封装的，更便于业务使用的贴纸手势库","archived":false,"fork":false,"pushed_at":"2018-07-24T02:22:46.000Z","size":1149,"stargazers_count":49,"open_issues_count":3,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T18:55:37.174Z","etag":null,"topics":["finger","gesture","hammer","image-composer","sticker","tie-zhi","touch"],"latest_commit_sha":null,"homepage":"http://f2er.meitu.com/gxd/touchkit/example/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xd-tayde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-02T10:44:23.000Z","updated_at":"2024-04-01T16:55:45.000Z","dependencies_parsed_at":"2022-09-26T16:41:32.672Z","dependency_job_id":null,"html_url":"https://github.com/xd-tayde/touchkit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Ftouchkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Ftouchkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Ftouchkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Ftouchkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xd-tayde","download_url":"https://codeload.github.com/xd-tayde/touchkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239032245,"owners_count":19570770,"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":["finger","gesture","hammer","image-composer","sticker","tie-zhi","touch"],"created_at":"2025-02-15T18:08:47.131Z","updated_at":"2025-10-30T19:30:37.039Z","avatar_url":"https://github.com/xd-tayde.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Touchkit.js\n\n[Example](http://f2er.meitu.com/gxd/touchkit/example/index.html)   \n\n[Git](https://github.com/xd-tayde/touchkit)\n\n[Download](https://github.com/xd-tayde/touchkit/blob/master/dist/touchkit.min.js)\n\n## Introduction\n\nThis toolkit is built on `mtouch.js` and `mcanvas.js`. Use it, you can build a gesture project quickly and get a image automatically. concerned less and do more!\n\n## Installation\n\n- You can download the latest version from the [GitHub](https://github.com/xd-tayde/touchkit/blob/master/dist/touchkit.min.js)\n- use a npm [CDN](https://unpkg.com/touchkit/dist/mcanvas.min.js).\n- Or you can install via npm:\n\n```js\nnpm install touchkit --save\n```\n\n## Basic Usage\n\nThe idea of touchkit is that init create a touch box firstly, and then use `tk.background()` add the background and use `tk.add()` add the touch-element into the touch box, finally, export a composite image by `tk.exportImage()`. The image is what you see in touch box.\n\nthe simple example, see the document for more details.\n\n```js\n// init create touch box\nnew Touchkit('.js-par')\n\n// add background image\n// type: contain/crop\n// the background-image will place at the bottom of touch-box\n.background({\n    image:'./images/p2.jpg',\n    type:'contain',\n})\n\n// add operable element to touch box\n.add({\n    image:`images/ear.png`,\n    width:'100px',\n    use:{\n        drag:true,\n        pinch:true,\n        rotate:true,\n        singlePinch:true,\n        singleRotate:true,\n    },\n    pos:{\n        x:116,\n        y:45,\n        scale:1.25,\n        rotate:2.63,\n    },\n}).add({\n    image:`images/neck.png`,\n    width:100,\n    limit:true,\n    close:true,\n    use:'all',\n    pos:{\n        x:0,\n        y:0,\n        scale:1,\n        rotate:0,\n    },\n})\n\n// export a image contain all elements what you see in touch box\n.exportImage(b64=\u003e{\n   console.log(b64);\n})\n```\n\n## document\n\n[Engligh](https://github.com/xd-tayde/touchkit/blob/master/README_EN.md) | [中文版](https://github.com/xd-tayde/touchkit/blob/master/README_ZH.md)\n\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd-tayde%2Ftouchkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxd-tayde%2Ftouchkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd-tayde%2Ftouchkit/lists"}