# interplay

> Modular UI controls library designed for both debugging and performance environments, with a focus on simplicity and providing multiple interaction methods.

Latest version **1.1.0** (published 2015-09-04) · 0 weekly downloads

## Install

```sh
npm install interplay
pnpm add interplay
yarn add interplay
bun add interplay
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-09-04 |
| First published | 2015-08-10 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | hughsk |

## Links

- npm: https://www.npmjs.com/package/interplay
- npm.io page: https://npm.io/package/interplay

## Dependencies (5)

- [brfs](https://npm.io/package/brfs.md) ^1.4.0
- [events](https://npm.io/package/events.md) ^1.0.2
- [inherits](https://npm.io/package/inherits.md) ^2.0.1
- [defaultcss](https://npm.io/package/defaultcss.md) ^1.1.1
- [remove-element](https://npm.io/package/remove-element.md) 0.0.0

## Recent versions

- 1.1.0 (latest) — 2015-09-04
- 1.0.2 — 2015-08-30
- 1.0.1 — 2015-08-10
- 1.0.0 — 2015-08-10

## README

# interplay

Modular UI controls library designed for both debugging and
performance environments, with a focus on simplicity and providing multiple
interaction methods.

## Developing a new Input Node

### JavaScript API

#### `domElement = InputNode(node)`

Each Input Node is exposed as a function which takes a `node` object and
returns a DOM element to be attached to the interplay input list. Interfacing
with interplay is done through the `node` object that's passed through to you.

#### `node.input.manual = true|false`

Should be set to `true` if manual input is supported, e.g. buttons, sliders,
and any other directly manipulable UI elements.

``` javascript
module.exports = function (node) {
  node.input.manual = true
  // ...
}
```

#### `node.input.keyboard = true|false`

Should be set to `true` if keyboard input is supported, e.g. it can be triggered
using key presses without directly interacting with the node.

``` javascript
module.exports = function (node) {
  node.input.keyboard = true
  // ...
}
```

#### `node.input.midi = true|false`

Should be set to `true` if MIDI input is supported.

``` javascript
module.exports = function (node) {
  node.input.midi = true
  // ...
}
```

### `node.value`

Change `node.value` to set the node's output value.

### `node.on('change', changed)`

Calls the `changed` function whenever the Node's value is changed.

### `node.on('init', init)`

Calls the `init` function when the Node is added to interplay. Should be used to set up event listeners, load assets, etc.

Note that `init` may be fired more than once if the node is added/removed multiple times.

### `node.on('stop', stop)`

Calls the `stop` function when the Node is removed from interplay. Should be used to clean up any allocated resources created when firing the `init` function.

Note that `stop` may be fired more than once if the node is added/removed multiple times.

### Required CSS Classes

#### `.interplay-manual`

Should wrap the manual input mode of the Input Node.

#### `.interplay-keyboard`

Should wrap the keyboard input mode of the Input Node.

#### `.interplay-midi`

Should wrap the MIDI input mode of the Input Node.

---
_Source: https://npm.io/package/interplay · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
