{"id":19154294,"url":"https://github.com/olimot/grab-n-pinch","last_synced_at":"2026-06-03T16:31:40.119Z","repository":{"id":57132976,"uuid":"458029022","full_name":"olimot/grab-n-pinch","owner":"olimot","description":"A simple library for panning and zooming","archived":false,"fork":false,"pushed_at":"2022-02-11T03:51:03.000Z","size":477,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-15T08:55:34.489Z","etag":null,"topics":["grab","pan","pinch","scale","svg","transform","transformation","translate","zoom"],"latest_commit_sha":null,"homepage":"https://olimot.github.io/grab-n-pinch/example","language":"TypeScript","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/olimot.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":"2022-02-11T03:14:10.000Z","updated_at":"2022-02-11T03:54:27.000Z","dependencies_parsed_at":"2022-09-03T11:42:41.529Z","dependency_job_id":null,"html_url":"https://github.com/olimot/grab-n-pinch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olimot/grab-n-pinch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimot%2Fgrab-n-pinch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimot%2Fgrab-n-pinch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimot%2Fgrab-n-pinch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimot%2Fgrab-n-pinch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olimot","download_url":"https://codeload.github.com/olimot/grab-n-pinch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimot%2Fgrab-n-pinch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33874679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["grab","pan","pinch","scale","svg","transform","transformation","translate","zoom"],"created_at":"2024-11-09T08:26:14.472Z","updated_at":"2026-06-03T16:31:40.105Z","avatar_url":"https://github.com/olimot.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grab N' Pinch\n\nA libarary supporting panning and zooming for both desktop and mobile devices.\n\n## Example\n\nhttps://olimot.github.io/grab-n-pinch/example\n\n## Usage\n\n```js\nconst gnp = new GrabNPinchManager({\n  translate: { x: 0, y: 0 },\n  scale: window.innerWidth / root.clientWidth,\n  minScale: Math.min(0.5, window.innerWidth / root.clientWidth, window.innerHeight / root.clientHeight),\n});\n\ndocument.body.addEventListener('wheel', gnp.updateScaleInertia);\ndocument.body.addEventListener('pointerdown', gnp.addPointer);\ndocument.body.addEventListener('pointermove', gnp.updatePointer);\ndocument.body.addEventListener('pointerleave', gnp.removePointer);\ndocument.body.addEventListener('pointerup', gnp.removePointer);\n\nlet elapsed = 0;\n(function raf() {\n  requestAnimationFrame((time) =\u003e {\n    const delta = time - elapsed;\n    elapsed = time;\n    gnp.run(delta);\n    root.style.transformOrigin = '0 0';\n    root.style.transform = `matrix(${gnp.scale}, 0, 0, ${gnp.scale}, ${gnp.translate.x},${gnp.translate.y})`;\n    raf();\n  });\n})();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folimot%2Fgrab-n-pinch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folimot%2Fgrab-n-pinch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folimot%2Fgrab-n-pinch/lists"}