npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

touch-move-scale

v1.0.1

Published

touch-move-scale 是原生写的移动端画布移动缩放库, 你可以给元素添加单指移动和双指缩放的功能 ### Demo [touch-move-scale](http://htmlpreview.github.io/?https://github.com/WindStormrage/touchMoveScale/blob/master/index.html) 请在移动端打开 ### Install ``` npm i touch-move-scale -S ``` ### Quick Start

Downloads

7

Readme

touch-move-scale 移动端画布移动缩放库

touch-move-scale 是原生写的移动端画布移动缩放库, 你可以给元素添加单指移动和双指缩放的功能

Demo

touch-move-scale 请在移动端打开

Install

npm i touch-move-scale -S

Quick Start

<div id="touchBox">
  <img id="transformDom" />
</div>

import TouchMoveScale from './index.js'
const touchMoveScale = new TouchMoveScale({
  touchDom: document.getElementById('touchBox'),
  transformDom: document.getElementById('transformDom')
})

Options

参数 | 默认值 | 含义 ---|---|--- touchDom | - |[必填]手指操作的区域元素 transformDom | - | [必填]缩放应用的元素 transformData | - | 位移缩放初始值 transformData.x | 0 | 初始x轴偏移 transformData.y | 0 | 初始y轴偏移 transformData.scale | 1 | 初始缩放 maxScale | Infinity | 最大缩放值 minScale | 0 | 最小缩放值 damping | false | 感觉像是有阻尼感,可以开启试试 perspective | false | 是否有透视效果

Function

方法名 | 参数 | 含义 ---|---|--- enlargeScale | size: 放大倍数 | 进行放大操作 narrowScale | size: 缩小倍数 | 进行缩小操作 getTransformData | - | 获得当前的位移和缩放, 其中的位移没有被缩放, 是先缩放然后再位移 setPerspective | value: Boolean | 设置perspective setDamping | value: Boolean | 设置damping distory | - | 销毁监听