Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chimeejs/chimee-plugin-gesture
https://github.com/chimeejs/chimee-plugin-gesture
chimee gesture mobile
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/chimeejs/chimee-plugin-gesture
- Owner: Chimeejs
- Created: 2017-11-16T07:03:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-19T05:50:53.000Z (about 6 years ago)
- Last Synced: 2024-11-04T01:07:30.416Z (17 days ago)
- Topics: chimee, gesture, mobile
- Language: JavaScript
- Size: 171 KB
- Stars: 0
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chimee-plugin-gesture
>该插件是一个基础插件,移动端的插件可以继承它,为这些插件提供手势事件,暴露给上层插件使用
## install
安装
```shell
# 依赖于 chimee, 首先需要安装 chimee
npm install chimee
# 安装手势组件
npm install chimee-plugin-gesture
```使用
```javascript
import chimee from 'chimee';
import gestureFactory from 'chimee-plugin-gesture';// 安装插件
const mobiControlbar = gestureFactory({// 参考 chimee 插件配置
name: 'mobiControlbar',
// ...
// 直接使用 ['tap', 'swipe', 'panstart', 'panmove', 'panend', 'press', 'doubletap'], 这些事件就好了,不需要使用 touch 事件
events: {
tap() {},
d_tap() {}
}
})
chimee.install(mobiControlbar);
const player = new chimee({
// ...
// 使用插件
plugin: [
mobiControlbar.name // 或者 'mobiControlbar'
]
});
```## 配置
chimee 配置 events 不用再监听 touchstart/ touchmove/touchend
只需要监听操作 'tap', 'swipe', 'panstart', 'panmove', 'panend', 'press', 'doubletap' 就好了
支持前缀 'w_'(wrap dom), 'c_'(container dom), 'd_'(插件自身 dom), 不加前缀 videoElement 具体可以参考 chimee plugin 配置