Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
pinch-zoom-element
Advanced tools
A web component for pinch zooming DOM elements.
npm install --save-dev pinch-zoom-element
<pinch-zoom>
<h1>Hello!</h1>
</pinch-zoom>
Now the above can be pinch-zoomed!
<pinch-zoom class="my-pinch-zoom">
<h1>Hello!</h1>
</pinch-zoom>
<script>
const pinchZoom = document.querySelector('.my-pinch-zoom');
</script>
pinchZoom.x; // x offset
pinchZoom.y; // y offset
pinchZoom.scale; // scale
Set the transform. All values are optional.
pinchZoom.setTransform({
scale: 1,
x: 0,
y: 0,
// Fire a 'change' event if values are different to current values
allowChangeEvent: false,
});
Scale in/out of a particular point.
pinchZoom.scaleTo(scale, {
// Transform origin. Can be a number, or string percent, eg "50%"
originX: 0,
originY: 0,
// Should the transform origin be relative to the container, or content?
relativeTo: 'content',
// Fire a 'change' event if values are different to current values
allowChangeEvent: false,
});
Simple image pinch-zoom. Although you can put any element in <pinch-zoom>
.
lib/index.ts
- Original TypeScript.dist/pinch-zoom.mjs
- JS module. Default exports PinchZoom
.dist/pinch-zoom.js
- Plain JS. Exposes PinchZoom
on the global.dist/pinch-zoom-min.js
- Minified plain JS. 2.3k gzipped.FAQs
Put stuff in an element, now you can pinch-zoom it!
The npm package pinch-zoom-element receives a total of 865 weekly downloads. As such, pinch-zoom-element popularity was classified as not popular.
We found that pinch-zoom-element demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.