{"id":19146775,"url":"https://github.com/lcluber/indium.js","last_synced_at":"2026-06-04T16:31:06.389Z","repository":{"id":34865888,"uuid":"180366408","full_name":"LCluber/Indium.js","owner":"LCluber","description":"Touchscreen events library","archived":false,"fork":false,"pushed_at":"2022-12-06T22:17:16.000Z","size":2162,"stargazers_count":0,"open_issues_count":18,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T16:50:02.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/LCluber.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-04-09T12:53:59.000Z","updated_at":"2022-04-17T14:17:03.000Z","dependencies_parsed_at":"2023-01-15T09:45:35.286Z","dependency_job_id":null,"html_url":"https://github.com/LCluber/Indium.js","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCluber%2FIndium.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCluber%2FIndium.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCluber%2FIndium.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCluber%2FIndium.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LCluber","download_url":"https://codeload.github.com/LCluber/Indium.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240229976,"owners_count":19768597,"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":[],"created_at":"2024-11-09T07:47:59.706Z","updated_at":"2026-06-04T16:31:06.336Z","avatar_url":"https://github.com/LCluber.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Synopsis\r\n\r\n**Indium.js** is a touch gestures library written in TypeScript with multiple touches detection.\r\n\r\n## Motivation\r\n\r\nThe purpose of this library is to provide a simple and easy way to add touch gestures to your app.\r\n\r\n## Installation\r\n\r\n### NPM\r\n\r\n```bash\r\n$ npm install @lcluber/indiumjs\r\n```\r\n\r\n### Yarn\r\n\r\n```bash\r\n$ yarn add @lcluber/indiumjs\r\n```\r\n\r\n## Demo\r\n\r\nSee a basic example **[here](http://vortalcombat.roostrjs.com)**.\r\n\r\n## Usage\r\n\r\n### ES6\r\n\r\n```html\r\n\u003ccanvas id=\"myCanvas\"\u003e\u003c/canvas\u003e\r\n```\r\n\r\n```javascript\r\nimport { TouchScreen, Right } from '@lcluber/indiumjs';\r\n\r\nfunction shipMove(touch) {\r\n  console.log('touch',touch);\r\n}\r\n\r\nfunction shipStop(touch) {\r\n  console.log('end',touch);\r\n}\r\n\r\nfunction shipShoot(touch) {\r\n  console.log('shoot',touch);\r\n}\r\n\r\nvar touchScreen = new TouchScreen('myCanvas');\r\ntouchScreen.touchStart(shipMove);\r\ntouchScreen.touchMove(shipMove);\r\ntouchScreen.touchEnd(shipStop);\r\ntouchScreen.touchCancel(shipStop);\r\n\r\nvar bottom = new Right(0.3);\r\nbottom.touchStart(shipShoot);\r\ntouchScreen.addZone(bottom);\r\n\r\n```\r\n\r\n### IIFE\r\n\r\n```html\r\n\u003cscript src=\"node-modules/@lcluber/indiumjs/dist/indium.iife.min.js\"\u003e\u003c/script\u003e\r\n\r\n\u003ccanvas id=\"myCanvas\"\u003e\u003c/canvas\u003e\r\n```\r\n\r\n```javascript\r\nfunction shipMove(touch) {\r\n  console.log('touch',touch);\r\n}\r\n\r\nfunction shipStop(touch) {\r\n  console.log('end',touch);\r\n}\r\n\r\nfunction shipShoot(touch) {\r\n  console.log('shoot',touch);\r\n}\r\n\r\nvar touchScreen = new Indium.TouchScreen('myCanvas');\r\n\r\ntouchScreen.touchStart(shipMove);\r\ntouchScreen.touchMove(shipMove);\r\ntouchScreen.touchEnd(shipStop);\r\ntouchScreen.touchCancel(shipStop);\r\n\r\nvar bottom = new Indium.Right(0.3);\r\nbottom.touchStart(shipShoot);\r\ntouchScreen.addZone(bottom);\r\n\r\n```\r\n\r\n## API Reference\r\n\r\n```javascript\r\ntype TZone = Top | Right | Bottom | Left;\r\n\r\nTouchScreen.touchStart(callback: Function);\r\nTouchScreen.touchMove(callback: Function);\r\nTouchScreen.touchEnd(callback: Function);\r\nTouchScreen.touchCancel(callback: Function);\r\ntouchScreen.addZone(zone: TZone);\r\n\r\nTop.touchStart(callback: Function);\r\nTop.touchMove(callback: Function);\r\nTop.touchEnd(callback: Function);\r\nTop.touchCancel(callback: Function);\r\n\r\nLeft.touchStart(callback: Function);\r\nLeft.touchMove(callback: Function);\r\nLeft.touchEnd(callback: Function);\r\nLeft.touchCancel(callback: Function);\r\n\r\nRight.touchStart(callback: Function);\r\nRight.touchMove(callback: Function);\r\nRight.touchEnd(callback: Function);\r\nRight.touchCancel(callback: Function);\r\n\r\nBottom.touchStart(callback: Function);\r\nBottom.touchMove(callback: Function);\r\nBottom.touchEnd(callback: Function);\r\nBottom.touchCancel(callback: Function);\r\n\r\n```\r\n\r\n## Tests\r\n\r\nNo tests to run yet\r\n\r\n## Contributors\r\n\r\nThere is still a lot of work to do on this project and I would be glad to get all the help you can provide.\r\nTo contribute you can clone the project on **[GitHub](https://github.com/LCluber/Indium.js)** and see  **NOTICE.md** for detailed installation walkthrough of the project.\r\n\r\n## License\r\n\r\nMIT License\r\n\r\nCopyright (c) 2016 Ludovic CLUBER\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcluber%2Findium.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcluber%2Findium.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcluber%2Findium.js/lists"}