Add a class to the slide parent element to let you know which direction the slides are going.
The bespoke parent element will initialise with bespoke-dir-next
whenever you change slide it will update which direction you're going so you can do more advanced animations.
Download the production version or the development version, or use a package manager.
First, include both bespoke.js
and bespoke-dir.js
in your page.
Then, simply include the plugin when instantiating your presentation.
bespoke.horizontal.from('article', {
dir: true
});
You can now change the style of the animation depending on which direction you're going.
The following classes are available on your parent element.
bespoke-dir-next | When you are going forwards |
bespoke-dir-prev | When you are going backwards |
See demo folder for a very simple example.
$ bower install bespoke-dir
$ npm install bespoke-dir
The bespoke-dir npm package is designed for use with browserify, e.g.
require('bespoke');
require('bespoke-dir');
This plugin was built with generator-bespokeplugin.