Giter VIP home page Giter VIP logo

react-pinch-and-zoom's Introduction

license

React Pinch and Zoom

A react container component with pinch-to-zoom gesture interaction.

Getting Started

Installing

  1. Install this package as dependency

    # pwd: ~/project/dir
    $ npm install react-pinch-and-zoom
  2. Import the component

    import PinchToZoom from 'react-pinch-and-zoom';
  3. Wrap the pinch-able component inside PinchToZoom component

    render() {
      return (
        <div className="container">
          <PinchToZoom>
            <img src={...}/> // child node should have intrinsic size
          </PinchToZoom>
        </div>
      );
    }

Project structure

./react-pinch-and-zoom (master)
├── docs               // compiled github demo page
├── lib                // compiled react component in commonjs module (git ignored)
├── package.json
├── server.js          // config local development server
└── src
    ├── PinchToZoom    // source code of react-pinch-and-zoom
    └── demo           // source code of github demo page

Develop on local machine

  1. Pull this repository
    # pwd: ~/development/dir
    $ git pull https://github.com/conradlo/react-pinch-and-zoom.git
  2. Install dependency
    $ cd react-pinch-and-zoom
    # pwd: ~/development/dir/react-pinch-and-zoom
    $ npm install
  3. Start local development server
    # pwd: ~/development/dir/react-pinch-and-zoom
    $ npm start
  4. Visit localhost:3000 and edit src/PinchToZoom/*
  5. Consult package.json for more npm script tasks

Production build

run npm run build will:

  1. transpile the component's source code /lib
  2. build and bundle the Github page /docs
# pwd: ~/development/dir/react-pinch-and-zoom
$ npm run build

Built With

Contributing

Please refer to CONTRIBUTING.md for details on code of conduct, and the process for submitting pull requests.

Versioning

This project uses SemVer for versioning. For the versions available, see the tags on this repository.

License

see the LICENSE file for details

Acknowledgments

react-pinch-and-zoom's People

Contributors

conradlo avatar dependabot[bot] avatar mcsonka-cxn avatar patrickbenjamin1 avatar razgrizx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.