{"id":13448600,"url":"https://github.com/GoogleChromeLabs/pinch-zoom","last_synced_at":"2025-03-22T09:31:29.231Z","repository":{"id":48028564,"uuid":"152469104","full_name":"GoogleChromeLabs/pinch-zoom","owner":"GoogleChromeLabs","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-26T21:52:58.000Z","size":333,"stargazers_count":371,"open_issues_count":27,"forks_count":54,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-28T14:27:54.049Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoogleChromeLabs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-10T18:15:40.000Z","updated_at":"2024-10-22T16:34:47.000Z","dependencies_parsed_at":"2024-06-21T13:10:03.354Z","dependency_job_id":null,"html_url":"https://github.com/GoogleChromeLabs/pinch-zoom","commit_stats":{"total_commits":12,"total_committers":4,"mean_commits":3.0,"dds":0.25,"last_synced_commit":"f5866785e19b4ea664997e06a5d8618ac54ab29b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fpinch-zoom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fpinch-zoom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fpinch-zoom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fpinch-zoom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleChromeLabs","download_url":"https://codeload.github.com/GoogleChromeLabs/pinch-zoom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244937751,"owners_count":20535124,"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-07-31T05:01:50.093Z","updated_at":"2025-03-22T09:31:28.588Z","avatar_url":"https://github.com/GoogleChromeLabs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Media Elements"],"sub_categories":[],"readme":"# \u003cpinch-zoom\u003e\n\nA web component for pinch zooming DOM elements.\n\n## Usage\n\n```sh\nnpm install --save-dev pinch-zoom-element\n```\n\n```html\n\u003cpinch-zoom\u003e\n  \u003ch1\u003eHello!\u003c/h1\u003e\n\u003c/pinch-zoom\u003e\n```\n\nNow the above can be pinch-zoomed!\n\n## API\n\n```html\n\u003cpinch-zoom class=\"my-pinch-zoom\"\u003e\n  \u003ch1\u003eHello!\u003c/h1\u003e\n\u003c/pinch-zoom\u003e\n\u003cscript\u003e\n  const pinchZoom = document.querySelector('.my-pinch-zoom');\n\u003c/script\u003e\n```\n\n### Properties\n\n```js\npinchZoom.x; // x offset\npinchZoom.y; // y offset\npinchZoom.scale; // scale\n```\n\n### Methods\n\nSet the transform. All values are optional.\n\n```js\npinchZoom.setTransform({\n  scale: 1,\n  x: 0,\n  y: 0,\n  // Fire a 'change' event if values are different to current values\n  allowChangeEvent: false,\n});\n```\n\nScale in/out of a particular point.\n\n```js\npinchZoom.scaleTo(scale, {\n  // Transform origin. Can be a number, or string percent, eg \"50%\"\n  originX: 0,\n  originY: 0,\n  // Should the transform origin be relative to the container, or content?\n  relativeTo: 'content',\n  // Fire a 'change' event if values are different to current values\n  allowChangeEvent: false,\n});\n```\n\n## Demo\n\n[Simple image pinch-zoom](https://pinch-zoom-element.glitch.me/). Although you can put any element in `\u003cpinch-zoom\u003e`.\n\n## Files\n\n* `lib/index.ts` - Original TypeScript.\n* `dist/pinch-zoom.mjs` - JS module. Default exports `PinchZoom`.\n* `dist/pinch-zoom.js` - Plain JS. Exposes `PinchZoom` on the global.\n* `dist/pinch-zoom-min.js` - Minified plain JS. 2.3k gzipped.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoogleChromeLabs%2Fpinch-zoom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGoogleChromeLabs%2Fpinch-zoom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoogleChromeLabs%2Fpinch-zoom/lists"}