New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@coddicat/vue-pinch-scroll-zoom

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coddicat/vue-pinch-scroll-zoom

Vue component that provides content scrolling and zooming using mouse events or two fingers pinch on a mobile devices

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9K
increased by7.26%
Maintainers
1
Weekly downloads
 
Created
Source

vue-pinch-scroll-zoom

Vue component that provides content scrolling and zooming using mouse events or two fingers pinch on a mobile devices

example:

https://vue-pinch-scroll-zoom.coddicat.com/

Installation

npm i @coddicat/vue-pinch-scroll-zoom

Usage

template:

<PinchScrollZoom
  :width="300"
  :height="400"
  :scale.sync="scale"
  @scalling="scallingHandler"
  style="border: 1px solid black"
>
  <img src="https://picsum.photos/600/1000" width="300" height="400" />
</PinchScrollZoom>

script:

import PinchScrollZoom, { PinchScrollZoomEmitData } from "@coddicat/vue-pinch-scroll-zoom";

export default Vue.extend({
  data: () => ({
    scale: 2
  }),
  components: {
    PinchScrollZoom,
  },
  methods: {
    scallingHandler(e: PinchScrollZoomEmitData ): void {
      console.log(e);
    }
  }
})

Props

the following properties can be used with the ".async" modifier

namerequireddescriptiondefault
widthyesvisible area width
heightyesvisible area height
minScalenominimum allowable scaling0.3
maxScalenomaximum allowable scaling5
withinnolimit scrolling of content to its borderstrue
wheelVelocitynozoom velocity when mouse wheel0.001
scalenoscale of the content1
origin-xnotransform-origin-xwidth/2
origin-ynotransform-origin-yheight/2
translate-xnotransform: translateX0
translate-ynotransform: translateY0
throttleDelaynorendering delay (milliseconds)25

Events

the following events are emitted with the argument:

export interface PinchScrollZoomEmitData {
  x: number;
  y: number;
  scale: number;
  originX: number;
  originY: number;
}
  • startDrag
  • stopDrag
  • dragging
  • scalling

FAQs

Package last updated on 20 Mar 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc