• Stars
    star
    280
  • Rank 142,752 (Top 3 %)
  • Language
    JavaScript
  • Created about 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A react component that providing multi-touch gestures for zooming and dragging on any DOM element.

react-quick-pinch-zoom

react-quick-pinch-zoom on npm npm downloads react-quick-pinch-zoom install size Code quality

A react component that lets you zooming and dragging on any DOM element using multi-touch gestures on mobile devices and mouse-events\wheel on desktop devices. Based on this module manuelstofer/pinchzoom

Component features:

  • 🔮 Simple. Easy to use;
  • 🍎 It works with mobile touch gestures and desktop mouse events;
  • Fast, 60 FPS on mobile devices.

Links

Install

npm i --save react-quick-pinch-zoom

or

yarn add react-quick-pinch-zoom

Screenshots

Video...

Usage

import React, { useCallback, useRef } from "react";
import QuickPinchZoom, { make3dTransformValue } from "react-quick-pinch-zoom";

const IMG_URL =
  "https://user-images.githubusercontent.com/4661784/" +
  "56037265-88219f00-5d37-11e9-95ef-9cb24be0190e.png";

export const App = () => {
  const imgRef = useRef();
  const onUpdate = useCallback(({ x, y, scale }) => {
    const { current: img } = imgRef;

    if (img) {
      const value = make3dTransformValue({ x, y, scale });

      img.style.setProperty("transform", value);
    }
  }, []);

  return (
    <QuickPinchZoom onUpdate={onUpdate}>
      <img ref={imgRef} src={IMG_URL} />
    </QuickPinchZoom>
  );
};

License

MIT © retyui

More Repositories

1

react-native-stylex

Better styling for react-native
TypeScript
98
star
2

react-native-ci-cd-compare

Java
72
star
3

postcss-animations

PostCSS plugin that adds `@keyframes` from animate.css, tuesday.css, magic.css, mimic.css
JavaScript
40
star
4

react-native-split-view-demo

Demo Split View on React Native + react-navigation
JavaScript
38
star
5

postcss-icon

PostCSS plugin that adds `css icons` from icon sets
JavaScript
22
star
6

react-native-widget-picker

Kotlin
16
star
7

react-native-detect-maestro

Kotlin
13
star
8

Using-GitHub-Actions-to-run-your-Maestro-Flows

Using GitHub Actions to run your Maestro Flows
Java
11
star
9

clean-css-loader

CleanCSS loader module for webpack
JavaScript
11
star
10

group-css-media-queries-loader

Webpack loader : group-css-media-queries
TypeScript
11
star
11

prestashop-1.7-webpack-2-hot-module-replacement

Prestashop theme. Webpack 2 migration and hot module replacement
JavaScript
8
star
12

react-native-code-push-dev-menu

TypeScript
7
star
13

prestashop-1.7-webpack-3-hot-module-replacement

Prestashop theme. Webpack 3 migration and hot module replacement
Smarty
6
star
14

Ultimate-CI-CD-guide-for-React-Native

Ultimate CI/CD guide for React Native
Ruby
4
star
15

postcss-image-set-generator

Postcss plugin for generate miniature images for image-set()
JavaScript
4
star
16

react-native-animated-sticky-header

Java
3
star
17

fbt-getting-started

JavaScript
3
star
18

prestashop-1.7-webpack-hot-module-replacement

Prestashop theme 1.7. Webpack 1.x hot module replacement
Smarty
3
star
19

demo-metro-bug

Java
2
star
20

postcss-finding-dead-css

Idea: https://csswizardry.com/2018/01/finding-dead-css/
CSS
2
star
21

nitro.build

Java
2
star
22

CodePushCiCd

React Native 0.70 + CodePush + CI/CD + Dev menu
Java
2
star
23

redux-saga-document-visibility

Saga watch if document visibilitySatate change
JavaScript
1
star
24

react-fast-pinch-zoom

React component for pinch zooming DOM elements
TypeScript
1
star
25

css-parse-keyframes

Node js moduel parse your css and returns the object of all animations
JavaScript
1
star
26

react-native-animation-demos

JavaScript
1
star
27

react-native-ci-cd

Java
1
star
28

react-native-boom

Попытак клона boom приложения на react-native
JavaScript
1
star
29

genflow

Repository to manage updates created libs definitions
JavaScript
1
star
30

postcss-icon.font-awesome-v4

JavaScript
1
star
31

demo-modern-images-usage-css

Tool for automatic generating images for your retina scale list
CSS
1
star
32

Contacts

JavaScript
1
star