Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Free Programming Books Zh_cn | 102,803 | a day ago | 29 | gpl-3.0 | ||||||
:books: 免费的计算机编程类中文书籍,欢迎投稿 | ||||||||||
Storybook | 79,011 | 7,289 | 21,476 | 16 hours ago | 1,108 | September 14, 2022 | 2,067 | mit | TypeScript | |
Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation. | ||||||||||
Ionic Framework | 49,076 | 19,484 | 880 | 17 hours ago | 420 | May 06, 2020 | 470 | mit | TypeScript | |
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript. | ||||||||||
Bulma | 47,196 | 10,372 | 1,348 | 5 days ago | 60 | May 08, 2022 | 359 | mit | CSS | |
Modern CSS framework based on Flexbox | ||||||||||
30 Days Of Javascript | 36,422 | a day ago | 1 | January 25, 2022 | 254 | JavaScript | ||||
30 days of JavaScript programming challenge is a step-by-step guide to learn JavaScript programming language in 30 days. This challenge may take more than 100 days, please just follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw | ||||||||||
Taro | 33,031 | 268 | 655 | 21 hours ago | 516 | September 23, 2022 | 1,009 | other | TypeScript | |
开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/ | ||||||||||
Sheetjs | 32,867 | 4,379 | 2,297 | a month ago | 170 | March 24, 2022 | 129 | apache-2.0 | JavaScript | |
📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs | ||||||||||
Fe Interview | 23,288 | 3 months ago | 5,312 | mit | JavaScript | |||||
前端面试每日 3+1,以面试题来驱动学习,提倡每日学习与思考,每天进步一点!每天早上5点纯手工发布面试题(死磕自己,愉悦大家),6000+道前端面试题全面覆盖,HTML/CSS/JavaScript/Vue/React/Nodejs/TypeScript/ECMAScritpt/Webpack/Jquery/小程序/软技能…… | ||||||||||
Nativescript | 22,587 | 2,619 | 1,102 | 2 days ago | 1,908 | September 28, 2021 | 947 | mit | TypeScript | |
⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue + SwiftUI, Jetpack Compose, Flutter and you name it compatible. | ||||||||||
Table | 21,679 | 1,770 | 1,122 | 5 days ago | 217 | May 16, 2022 | 121 | mit | TypeScript | |
🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table |
中文 | English
npm i -S any-touch
<script src="https://unpkg.com/any-touch/dist/any-touch.umd.min.js"></script>
<script>
console.log(AnyTouch.version); // 2.x.x
</script>
import AnyTouch from 'any-touch';
// monitored element
const el = document.getElementById('box');
// Start monitoring gesture changes on el
const at = new AnyTouch(el);
// The pan event fires when dragging
at.on('pan', (e) => {
// e contains information such as displacement/velocity/direction
console.log(e);
});
The pan here is called gesture event. e is the event object, which contains data such as "position/speed/zoom/angle",
Each state of the gesture corresponds to an event.
Gesture | Name | Describe |
---|---|---|
pan | pan | Triggered continuously while dragging |
panstart | drag to start | |
panmove | dragging | |
panstart | Drag to stop (off screen) | |
panup / pandown / panright / panleft | Drag events in different directions | |
press | press | Press |
press | Press release (off screen) | |
tap | tap | Click, No problem with 300ms delay |
swipe | swipe | Swipe |
swipeup / swipedown / swiperight / swipeleft | Swipe in different directions | |
pinch | pinch | Zoom |
pinchstart | Zoom start | |
pinchmove | Zooming | |
pinchend | Zoom ends (off screen) | |
pinchin | Zoom in | |
pinchout | Zoom out | |
rotate | rotate | Rotating, include rotatestart and rotatemove and rotateend |
rotatestart | Start of rotation | |
rotatemove | Rotating | |
rotateend | End of rotation (off screen) |
You can listen to multiple events through the array, such as listening to panleft and panright at the same time, so that you can listen to "x-axis dragging".
at.on(['panleft', 'panright'], () => {
console.log('Drag on the x-axis');
});
When the event is triggered, data such as "position/speed/zoom/angle" can be obtained.
at.on('pan', (event) => {
// event contains data such as speed/direction
});
name | type | describe |
---|---|---|
name | String |
Gesture recognizer name, such as: pan/tap/swipe, etc. |
type | String |
Event name, such as tap or panstart , etc., is larger than the name field, such as: when the type is panstart or panmove, and the name returns pan |
phase | String |
Current touch state: start / move / end / cancel Corresponding: first touch / move on the screen / leave the screen / abnormally leave the "can anyTouch" element
|
x | Number |
Current contact center x coordinate |
y | Number |
Current contact center y coordinate |
deltaX | Number |
The x-axis offset distance of the current contact and the previous contact |
deltaY | Number |
The y-axis offset distance of the current contact and the previous contact |
displacementX | Number |
The x displacement of the current contact and the starting contact (vector) |
displacementY | Number |
The y displacement of the current contact and the starting contact (vector) |
distanceX | Number |
absolute value of displacementX |
distanceY | Number |
absolute value of displacementY |
distance | Number |
The distance between the current contact and the starting contact (scalar) |
deltaTime | Number |
The difference between the current time and the initial touch time |
velocityX | Number |
The moving speed of the contact on the X axis |
velocityY | Number |
The moving speed of the contact on the Y axis |
direction | Number |
The direction of the front contact and the current contact can be understood as the instantaneous direction |
angle | Number |
When multi-touch, the rotation angle between the starting contact and the current contact |
deltaAngle | Number |
When multi-touch, the rotation angle between the front contact and the current contact |
scale | Number |
When multi-touch, the zoom ratio of the starting touch point and the current touch point |
deltaScale | Number |
When multi-touch, the zoom ratio between the previous touch point and the current touch point |
maxPointLength | Number |
The maximum number of contacts that have occurred in the current identification cycle |
isStart | Boolean |
Whether the current recognition cycle starts, the rule is that it is a cycle from touchstart->touchend, even if there is a multi-touch, if a point leaves, the current round of recognition ends |
isEnd | Boolean |
Whether the current recognition cycle is over |
target | EventTarget |
The element to which the event is bound |
targets | EventTarget[] |
For multiple touches, each target in touches will be stored |
currentTarget | EventTarget |
The element that actually triggered the bound event |
nativeEvent | TouchEvent |
native event object |
If the event function is bound in the vue template, the type of the event object cannot be deduced, so we need to manually annotate it ourselves.
<div @tap="onTap"></div>
// xxx.vue
import type { AnyTouchEvent } from 'any-touch';
function onTap(e: AnyTouchEvent) {
// It can be correctly deduced that there is an x attribute on e
console.log(e.x);
}