1.1.0 • Published 6 years ago

reveal-leap-motion v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

reveal-leap-motion

NPM version Build Status

This plugin lets you utilize your Leap Motion device to control basic navigation of your Reveal.js presentation.

Featured in:

Getting Started

  1. Download and install the package in the presentation project: npm i -S reveal-leap-motion
  2. Add the plugin to the dependencies in the presentation, as below:
Reveal.initialize({
    // ...
    dependencies: [
        // ...
        { src: 'node_modules/reveal-leap-motion/reveal-leap-motion.min.js', async: true }
    ]
});

Config Options

You can edit the following options:

PropertyDefaultDescription
autoCentertrueCenter the pointer based on where your finger enters the leap motion's detection field.
gestureDelay500How long to delay between gestures in milliseconds.
naturalSwipetrueSwipe as though you were using a touch screen. Set to false to invert.
pointerColor#00aaffThe color of the pointer.
pointerOpacity0.7The opacity of the pointer.
pointerSize15The minimum height and width of the pointer.
pointerTolerance120Larger values yield slower movement.

Example configuration:

Reveal.initialize({
  //...
  "reveal-leap-motion": {
    naturalSwipe: false,     // Invert swipe gestures
    pointerColor: '#d80000', // Red pointer
    pointerOpacity: 0.5,     // Set pointer opacity to 0.5
  },
});

Supported Gestures

Index Finger Only

When a single index finger is extended, a circular pointer will appear on screen, which tracks the finger. Moving closer to the device expands the pointer.

Multiple Fingers with One Hand

Navigate through the slides by swiping up, down, left, or right. See the config options to invert movements.

Two Hands

Swiping upwards with two hands will toggle the overview mode. A second swipe will exit the overview.

Callouts

reveal-leap-js includes LeapJS, developed by Leap Motion for your convenience. LeapJS is licensed under the Apache 2.0 license which can be obtained here.

Contributing

Contributions are encouraged and welcome! To get started, please see the contribution guide.