Searching Open Sourcery

Type to search Open Sourcery.

Media & Content

Image Zoom

Pinch-to-zoom and pan for images, with programmatic control and gallery support.

v0.1.0@magic-spells/image-zoom

$ npm i @magic-spells/image-zoom

GitHubnpm

Live demo

Tarot card: a ringed planet and a crystal floating above two open hands, in gold line art

Pinch or drag on touch, or double-click to zoom in and back out.

About

Pinch-to-zoom and pan web component for images. Mobile-first, light-DOM, no dependencies.

Usage

<image-zoom min="1" max="3">
  <img src="photo.jpg" alt="" />
</image-zoom>

Attributes

AttributeDefaultDescription
min1Minimum scale multiplier. 1 = image fills the container (contain-fit).
max3Maximum scale multiplier.

About, features, usage and options are taken from the package README.