Skip to content

opendevise/bespoke-cursor

Repository files navigation

bespoke-cursor

npm package Build Status (Travis CI)

You don’t want the mouse pointer hanging there on the slide, where you left it, like the gross house fly.
— Marcin Wichary

This plugin takes care of that problem for you. After a configurable timeout (default: 1000ms), the mouse cursor will disappear, never to be heard from again until you move the mouse. Once the mouse is moved, the cursor will stay visible until the timeout is reached again.

There’s only one catch. You have to move the mouse at list once to activate this behavior. Fortunately, the chance of that happening is very likely as you’re setting up your presentation. It seems the browser does not allow the mouse cursor to be hidden unless a mouse action is initiated by the user. So just remember to give the mouse a little nudge!

Example

View the demo online.

This repository includes a demo folder that shows this plugin in action. To view it locally, you first need to clone this repository:

$ git clone https://github.com/opendevise/bespoke-cursor && cd bespoke-cursor

Next, install the dependencies inside the project folder using npm:

$ npm install

Finally, visit the file demo/index.html in your browser to see the plugin in action.

Download

Download the production mode version or the development mode version, or use a package manager.

npm

$ npm install bespoke-cursor

Bower

$ bower install bespoke-cursor

Usage

This plugin is shipped in a UMD format, meaning it is available as a CommonJS/AMD module or as a browser global.

For example, when using CommonJS modules:

var bespoke = require('bespoke'),
  cursor = require('bespoke-cursor');

bespoke.from('.deck', [
  cursor()
]);

When using a browser global:

bespoke.from('.deck', [
  bespoke.plugins.cursor()
]);

Options

The following options are available when registering the bespoke-cursor plugin:

timeout (type: integer, default: 1000)

The duration in milliseconds the cursor will remain visible after the last mouse movement. After this time has elapsed, the cursor will disappear.

Options example

Here’s an example showing the options in use:

bespoke.from('.deck', [
  cursor({ timeout: 2000 })
]);

License

About

Makes the mouse cursor disappear after a configurable period of time in a Bespoke.js presentation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published