tinycrop icon indicating copy to clipboard operation
tinycrop copied to clipboard

how can I use var Crop = require('tinycrop') in the browser?

Open ronytesler opened this issue 5 years ago • 1 comments

where should I put the 'var Crop = require('tinycrop')' line? I don't see it in the demo's source code, not sure what I should do with it.

ronytesler avatar Nov 09 '20 14:11 ronytesler

let crop = tinycrop.create({
  parent: '#mount',
  image: 'images/portrait.jpg',
  bounds: {
    width: '100%',
    height: '50%'
  },
  backgroundColors: ['#fff', '#f3f3f3'],
  selection: {
    color: 'red',
    activeColor: 'blue',
    aspectRatio: 4 / 3,
    minWidth: 200,
    minHeight: 300,
    width: 400,
    height: 500,
    x: 100,
    y: 500
  },
  onInit: () => { console.log('Initialised') }
});

Ademking avatar Nov 05 '21 03:11 Ademking