/scalable

make element scalable by mouse wheel. it can take the current mouse position as the transform origin.

Primary LanguageTypeScript

make element scalable by mouse wheel

useage

import Scalable from '@joyfulljs/scalable';

// ...
mount(){
  this.instance = new Scalale(this.refs.el, {
    followMouse: true,
    maxScale: 5,
    minScale: 1,
    onScaleChange: ( { scale } )=>{ console.log(scale) }
  });
},
active(){
  // if need to reset to origin state
  this.instance.reset()
},
unmount(){
  this.instance.destroy()
}
// ...

api

docs

LICENSE

MIT