1.2.5 • Published 11 months ago

@dvgs/vgesture v1.2.5

Weekly downloads
-
License
-
Repository
github
Last release
11 months ago

V-Gesture

//: <> (start placeholder for auto-badger)

NPM License version npm package minimized gzipped size (scoped)

//: <> (end placeholder for auto-badger) Typescript library which gives ability to interact with DOM elements with hand gestures via webcam.

Note: This project isn't well tested for production, and requires major browser versions to run. So I highly recommend not to use it on production.

https://github.com/dovigod/V-Gesture/assets/30416914/05e9e1f6-ccc5-47f5-9fab-afaab3bb775d

Installation

npm install @dvgs/vgesture

Usage

Create "gesturable element"

Most of Elements with vgestureable attribute will be assumed as "gesturable" exceptions: here

// index.html
...
<div vgesturable onclick="..."> This is gesture interactable element</div>
<div vgesturable onclick="..."> This is gesture interactable element</div>
...

Initialize VGesture

import { VGesture } from '@dvgs/vgesture

const vGesture = new VGesture()
await vGesture.initialize()

Register Gesture

import { ClickGesturePlugin } from '@dvgs/vgesture/plugins

vGesture.register(new ClickGesturePlugin())

Run

vGesture.startDetection()

Documentation

Documentation created by Typedocs

Creating gesture

VGesture provides plugin and gesture interface to easily create and use gesture defined by yourself.

see an example

Requestable Operations / variables

Note) When requesting function operation, parameters should be ordered alphabetical.

const type = 'function' ? 'func' : 'variable' : 'var' : '';
let schema = `${type}::${name}`

//ex) requesting variable
"var::indexTip"

//ex) requesting function
// wrong :: "func::get2FingerDistance-indexTip-indexDip"
// correct :: "func::get2FingerDistance-indexDip-indexTip"
NameTypeDescription
get2FingerDistancefunctionget distance between provided finger tip parameter
indexTipvariableindex tip coordinate index: 9
thumbTipvariablethumb tip coordinate index: 4
pinkyTipvariablepinky tip coordinate index: 20
ringTipvariablering tip coordinate index: 16
middleTipvariablemiddle tip coordinate index: 12
thumbIpvariablethumbIp coordinate index: 3
thumbMcpvariablethumbMcp coordinate index: 2
thumbCmcvariablethumbCmc coordinate index: 1
indexMcpvariableindexMcp coordinate index: 5
indexPipvariableindexPip coordinate index: 6
indexDipvariableindexDip coordinate index: 7
middleMcpvariablemiddleMcp coordinate index: 9
middlePipvariablemiddlePip coordinate index: 10
middleDipvariablemiddleDip coordinate index: 11
ringMcpvariableringMcp coordinate index: 13
ringPipvariableringPip coordinate index: 14
ringDipvariableringDip coordinate index: 15
pinkyMcpvariablepinkyMcp coordinate index: 17
pinkyPipvariablepinkyPip coordinate index: 18
pinkyDipvariablepinkyDip coordinate index: 19
1.2.5

11 months ago

1.2.4

11 months ago

1.2.3

11 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.1.6

12 months ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago