# MotorCortex

[![npm version](https://badge.fury.io/js/@donkeyclip%2Fmotorcortex.svg)](https://www.npmjs.com/package/@donkeyclip/motorcortex) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=donkeyclip_motorcortex&metric=coverage)](https://sonarcloud.io/summary/new_code?id=donkeyclip_motorcortex) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=donkeyclip_motorcortex&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=donkeyclip_motorcortex)

### MotorCortex is a dynamic video technology for the Web

What you can create with MotorCortex is `donkeyclips`.
donkeyclips are just dynamic video components that accept parameters on runtime. You can even
edit the donkeyclip on runtime by adding or removing `incidents`.

## Concepts

- Anything that occurs at a specific point in time and has a very specific duration is an `Incident`
- We separate `context` with `action`. `context` is your setting. E.g. in an HTML video your context would be
  the HTML and all of its elements, while on a 3D clip the `context` would be all the models, the lights etc.
  All of your available `material`.

  The `action` on the other hand is a change (e.g. color, movement, etc) that happens in and on the `context`.

- A full story, consisting of both **context** and action (**Incidents**) is called a **Clip**
- A full Clip can enter the timeline of another Clip taking both a “physical” and
  a time position on it
- Always at the top there is a root Clip, which is the only playable clip. We call it the `donkeyclip`

MotorCortex implements these concepts as es6 Classes providing all the
building blocks needed and an easy API to compose donkeyclips.

### Animations and Effects

All Classes are extendable making it
very easy to create:

- Animations: Pre-configured Clips with pre-configured (yet parametric) context and action
- Effects: Incidents that alter the state and attributes of elements of the context
- Totally new Clip types, such as canvas, audio etc.
  Animations, Effects and new Clip types can easily be exposed by Plugins.

### Dynamic Custom Entities

Clips support dynamically adding and removing custom entities at runtime via `addCustomEntity` and `removeCustomEntity`. Each entity has a `birthtime` and optional `removalTime` that control when it is visible to selectors. A dedicated `VisibilityChannel` manages show/hide events on the timeline, calling `showElement`/`hideElement` on the clip at the appropriate moments during playback and seeking. This allows plugins to create entities that appear and disappear at specific points on the timeline while remaining fully compatible with seeking, flash, and export.

### License

---

### Links

Home page: <https://motorcortexjs.com>

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdonkeyclip%2Fmotorcortex.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdonkeyclip%2Fmotorcortex?ref=badge_large)
