Skip to content

bespokejs/bespoke-scale

Repository files navigation

Build Status Coverage Status

bespoke-scale

Responsive Slide Scaling for Bespoke.js

Download

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

Usage

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

For example, when using CommonJS modules:

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

bespoke.from('article', [
  scale()
]);

When using browser globals:

bespoke.from('article', [
  bespoke.plugins.scale()
]);

By default, bespoke-scale detects which method to use for resizing slides. In browsers that support it, CSS zoom is used. In all other browsers, each slide is wrapped with an element with a bespoke-scale-parent class, which is resized with CSS transforms. You will need to provide styles for this element, for example:

.bespoke-scale-parent {
  perspective: 600px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

If you'd like to specify which scaling method to use, you can pass 'zoom' or 'transform' as an option, for example:

bespoke.from('article', [
  scale('zoom')
]);

Package managers

npm

$ npm install bespoke-scale

Bower

$ bower install bespoke-scale

Credits

This plugin was built with generator-bespokeplugin.

License

MIT License