Discovering, Loading and Using plugins

Plugins’ library

You can easily search and discover plugins on the plugins’ library page. There you will find a number of plugins either directly maintained by the core MotorCortex team or submitted by third party developers.

Loading a plugin

All plugins have an npm name and must be hosted and provided by it. The only thing to do is to load it on your MotorCortex via the use of the loadPlugin method of MotorCortex.

Example:

const MotorCortex = require('@kissmybutton/motorcortex');
const anime = require('@kissmybutton/motorcortex-anime);
const Anime = MotorCortex.loadPlugin('anime');
/* from that point and on you can instantiate any Incident exposed by the anime plugin */
const myClip = new MotorCortex.Clip({...});
const animation1 = new Anime.Anime({
animatedAttrs: {
left: "500px",
top: "250px"
}
}, {
duration: 2000,
selector: ".className"
});
myClip.addIncident(animation1, 2000);
myClip.play();