# ivypinch

> Javascript library for images scaling and dragging with touch screen gestures; API support for complex actions available.

Latest version **0.1.1** (published 2019-06-20) · 0 weekly downloads

## Install

```sh
npm install ivypinch
pnpm add ivypinch
yarn add ivypinch
bun add ivypinch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-06-20 |
| First published | 2019-03-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 342.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nikita Drozhzhin |
| Maintainers | nikita-drozhzhin |
| Keywords | JavaScript, Pinch zoom, Touch image zoom, Toush screen, Image scaling, TypeScript |

## Links

- npm: https://www.npmjs.com/package/ivypinch
- Repository: https://github.com/ivylaboratory/ivypinch
- Homepage: http://ivypinch.one
- Issues: https://github.com/ivylaboratory/ivypinch/issues
- npm.io page: https://npm.io/package/ivypinch

## Dependencies (1)

- [md5](https://npm.io/package/md5.md) ^2.2.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2019-06-20
- 0.0.1 — 2019-03-01

## README

# IvyPinch

Javascript library for images scaling and dragging with touch screen gestures; API support for complex actions available. 

Live demo can be found on [home page](http://ivypinch.one).

## Installation

Install the npm package.

	npm i ivypinch

When initializing, enter a container selector and a [license key](http://ivypinch.one#license):

	var myPinch = new IvyPinch({
	    key: 'MY_KEY'
	    element: '.pinch-zoom'
	});

## Usage

Put an image inside the container, its content will be scaled with a pinch zoom after the library is initialized.

	<div class="pinch-zoom">
	    <img src="...">
	</div>

Initialize the library and pass the container selector as an argument.

	var myPinch = new IvyPinch({
	    element: '.pinch-zoom'
	});

Pay attention to the parameters of the viewport metatag, it is recommended to limit scaling of a web-page by entering the following parameters: 
	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">.

It is recommended to set the maximum height and width of an image with the CSS properties: 

	max-width: 100%; 
	max-height: 100%;

## License

You can freely use IvyPinch in non-commercial projects ([get a license key](http://ivypinch.one#license)) or on the localhost domain. You can also use a trial version on any other domain. 20 function calls are available in the trial version after each page load. For commercial projects the following two license types are available: for [one domain](http://ivypinch.one#license) and for an [unlimited number of domains](http://ivypinch.one#license).

## Properties

| name | type | default | description |
|------|------|---------|-------------|
| transitionDuration | number | 200 | Animation speed of scaling and aligning, in milliseconds. |
| autoZoomOut | boolean | false | Automatic restoration of the original size of an image after its zooming in by two fingers. |
| doubleTap | boolean | true | Scaling with double tap. |
| doubleTapScale | boolean | false | Zoom in factor for double tap. |
| limitZoom | number | 3 | Limitation of a maximum zoom in. |

## Methods

| name | description |
|------|-------------|
| setMoveX(value: number) | Shift an image in X-direction. |
| setMoveY(value: number) | Shift an image in Y-direction. |
| toggleZoom() | Image zooming in and out to the original scale, depending on its current scale. |
| alignImage() | Press images to the edges of the parental element. |

## Events

| name | description |
|------|-------------|
| touchstart | One or more touch points are placed on the touch surface. |
| touchend | One or more touch points are removed from the touch surface. |
| swipe | A user moves a zoomed image in any direction by a finger. |
| pinch | A user zooms an image in or out by two fingers. |
| double-tap | Double touch, consisting of two quick taps. |

---
_Source: https://npm.io/package/ivypinch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
