All Projects → Norserium → Vue Advanced Cropper

Norserium / Vue Advanced Cropper

Licence: other
The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design

Projects that are alternatives of or similar to Vue Advanced Cropper

Gorequest
GoRequest -- Simplified HTTP client ( inspired by nodejs SuperAgent )
Stars: ✭ 3,063 (+990.04%)
Mutual labels:  library
Nostrum
Elixir Discord Library
Stars: ✭ 274 (-2.49%)
Mutual labels:  library
Swiftuix
Extensions and additions to the standard SwiftUI library.
Stars: ✭ 4,087 (+1354.45%)
Mutual labels:  library
Cordova Plugin Media Capture
Apache Cordova Plugin media-capture
Stars: ✭ 271 (-3.56%)
Mutual labels:  library
Jackrabbit
Mirror of Apache Jackrabbit
Stars: ✭ 273 (-2.85%)
Mutual labels:  library
Sarunarchiveany
A very useful library for Unarchiving the .zip, .rar, .7z files for iOS. Block based integration of UnrarKit + SSZipArchive + LzmaSDKObjC (7z).
Stars: ✭ 275 (-2.14%)
Mutual labels:  library
Visitor
The Hoa\Visitor library.
Stars: ✭ 269 (-4.27%)
Mutual labels:  library
Simple Php Router
Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.
Stars: ✭ 279 (-0.71%)
Mutual labels:  library
Ble Indoor Positioning
Multilateration using bluetooth beacons
Stars: ✭ 274 (-2.49%)
Mutual labels:  library
Slidecontroller
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.
Stars: ✭ 279 (-0.71%)
Mutual labels:  library
Rye
A modern, lightweight browser library using ES5 natives
Stars: ✭ 271 (-3.56%)
Mutual labels:  library
Adafruit Fingerprint Sensor Library
Arduino library for interfacing to the fingerprint sensor in the Adafruit shop
Stars: ✭ 273 (-2.85%)
Mutual labels:  library
Immortaldb
🔩 A relentless key-value store for the browser.
Stars: ✭ 2,962 (+954.09%)
Mutual labels:  library
Whereami
Locate the current executable and the current module/library on the file system
Stars: ✭ 270 (-3.91%)
Mutual labels:  library
Swup
🎉 Complete, flexible, extensible and easy to use page transition library for your static web.
Stars: ✭ 3,190 (+1035.23%)
Mutual labels:  library
Paper Switch
🎚 RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion
Stars: ✭ 2,902 (+932.74%)
Mutual labels:  library
Gps
your dependencies have arrived
Stars: ✭ 275 (-2.14%)
Mutual labels:  library
Dry Configurable
A simple mixin to make Ruby classes configurable
Stars: ✭ 280 (-0.36%)
Mutual labels:  library
Arduinopcap
A library for creating and sending .pcap files for Wireshark and other programms.
Stars: ✭ 278 (-1.07%)
Mutual labels:  library
Tiny Process Library
A small platform independent library making it simple to create and stop new processes in C++, as well as writing to stdin and reading from stdout and stderr of a new process
Stars: ✭ 276 (-1.78%)
Mutual labels:  library

Vue Advanced Cropper logo


Downloads Version
Documentation / Examples / Sandbox


WARNING! If you still use the beta version (< 1.0.0) read the migration guide.



🔥 HEADS UP! You're currently looking at the branch for Vue 2. If you're looking for the branch for Vue 3, please check out vue-next branch.


Vue Advanced Cropper is the advanced library that gives you opportunity to create your own croppers suited for any website design. It means that you are able to change not only the cropper appearance, you area able to customize its behavior also.

Features:

  • full mobile / desktop support
  • support all three main types of croppers right out of the box
  • support both canvas and coordinates modes, minimum and maximum aspect ratios, custom size restrictions
  • zoom, rotate, resize image
  • auto-zoom, transitions

The codesandbox for mobile / desktop examples above.

Install

npm install --save vue-advanced-cropper
yarn add vue-advanced-cropper

If you would to use CDN read the corresponding documentation section

Usage

import Vue from 'vue'
import { Cropper } from 'vue-advanced-cropper'
import 'vue-advanced-cropper/dist/style.css';

new Vue({
  el: '#app',
  data: {
    img: 'https://images.pexels.com/photos/226746/pexels-photo-226746.jpeg'
  },
  methods: {
    change({coordinates, canvas}) {
      console.log(coordinates, canvas)
    }
  },
  components: {
    Cropper
  }
})
<div id="app">
  <cropper
    class="cropper"
    :src="img"
    :stencil-props="{
      aspectRatio: 10/12
    }"
    @change="change"
  ></cropper>
</div>
/*
  Maybe you need to set the limits for the cropper sizes or its container sizes
  otherwise a cropping image will try to fill all available space
*/
.cropper {
  height: 600px;
  background: #DDD;
}

Cropper

Prop Type Description Default
src String The cropping image (link / base64)
stencilComponent String, Object The stencil component RectangleStencil
stencilProps Object The props for the stencil component {}
class String The optional class for the root cropper block
imageClass String The optional class for the cropping image
boundariesClass String The optional class for the area.
backgroundClass String The optional class for the background under the image
autoZoom Boolean Enable / disable transitions false
transitions Boolean Enable / disable auto zoom true
stencilSize Object The size of the stencil in pixels
debounce String, Number The time before change event will be emitted after changes (ms) 500
canvas Boolean The flag that indicates if canvas should be used true
minWidth String, Number The minimum width of the stencil (percents)
minHeight String, Number The minimum height of the stencil (percents)
maxWidth String, Number The maximum width of the stencil (percents)
maxHeight String, Number The maximum height of the stencil (percents)
checkOrientation Boolean Check if EXIF orientation should be checked true
resizeImage Boolean, Object The options for the image resizing (details) true
moveImage Boolean, Object The options for the image moving (details) true
imageRestriction String Set restrictions for image position ('fill-area' 'fit-area', 'stencil', 'none') 'fill-area'
defaultSize Object, Function The function that returns the default size of the stencil or object core.defaultSize
defaultPosition Object, Function The function that returns the default position of the stencil or object core.defaultPosition
defaultBoundaries String, Function The function that determines the boundaries size or string ('fill', 'fit') 'fill'
sizeRestrictionsAlgorithm Function The function that returns the restrictions object
Event Description
change Invoked on changing of a stencil position / size, after mounting the component and on an image changing
ready Invoked on success of an image loading
error Invoked on error of an image loading

RectangleStencil

Prop Type Description Default
aspectRatio Number The aspect ratio
minAspectRatio Number The minimum aspect ratio
maxAspectRatio Number The maximum aspect ratio
class String The class for root block of the stencil component
previewClass String The class for the preview component
movingClass String The class applied when user drag the stencil
resizingClass String The class applied when user resize the stencil
boundingBoxClass String The class for the bounding box component
handlerComponent String,Object The handler component
handlers Object The object of handlers that should be visible or hidden.
handlersClasses Object The object of custom handler classes
handlersWrappersClasses Object The object of custom handler wrapper classes
lineComponent String,Object The handler component
lines Object The object of lines that should be visible or hidden.
linesClasses Object The object of custom line classes
linesWrappersClasses Object The object of custom line wrapper classes

License

The source code of this library is licensed under MIT, the documentation and photos are belong to their respective owners.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].