npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

x-cropper

v1.1.2

Published

An image cropper and uploader component for VueJS and Vuetify

Downloads

16

Readme

x-cropper

XCropper

An image cropper and uploader component for VueJS with Vuetify

X-Cropper Demo


Installation

NPM

npm install x-cropper

YARN

yarn add x-cropper

UI

x-cropper

Usage

Most basic example. This is going to insert the cropper with default options:


<template>
  <div>
    <h1>XCropper - crop all!</h1>
    <x-cropper></x-cropper>
  </div>
</template>
<script>
import XCropper from 'x-cropper'
import 'x-cropper/dist/XCropper.css'

export default {
  components: {XCropper}
}
</script>

Example with all the options and events:


<template>
  <div>
    <h1>XCropper - crop all!</h1>
    <x-cropper
        :options="{
            // system
            inputMimeTypes: ['image/jpeg', 'image/png', 'image/gif'],
            resultMimeType: 'image/jpeg',
            maxFileSize: 8000000, // 8MB
            layoutBreakpoint: 850,
            maxCropperHeight: 600,
            croppedAreaHeight: 400,
            croppedAreaWidth: 400,
            maxCroppedAreaWidth: 400,
            uploadData: {},
    
            isUploadTo: false,
            isPreviewOnDrag: true,
            isCloseOnSave: true,
    
            // show flags
            isShowPreview: true,
            isShowToolbar: true,
            isShowSaveBtn: true,
            isShowClearBtn: true,
            isShowCircleChk: true,
            isShowQualityFld: true,
            isShowFormParams: true,
            isShowFullAreaBtn: true,
            isShowFlipVertBtn: true,
            isShowFlipHorizBtn: true,
            isShowSelectImgBtn: true,
            isShowExpansionPnl: true,
            isShowRotateLeftBtn: true,
            isShowAspectRatioFld: true,
            isShowRotateRightBtn: true,
            isShowProportionalChk: true,
    
            cropArea: {
              minWidth: 8,
              minHeight: 8,
    
              // user changeable fields
              width: 0,
              height: 0,
              x: 20,
              y: 20,
            },
    
            // user changeable checks
            isCircle: true,
            isProportional: false,
    
    
            // user changeable fields
            rotation: 0,
            quality: 0.85,
            handleSize: 10,
            aspectRatio: 1,
            maxCropAreaHeight: 0,
            frameLineDash: [5, 3],
            
    
            // colors
            overlayFill: 'rgba(0, 0, 0, 0.5)',
            handleFillColor: 'rgba(255, 255, 255, 0.2)',
            frameStrokeColor: 'rgba(255, 255, 255, 0.8)',
            handleStrokeColor: 'rgba(255, 255, 255, 0.8)',
            handleHoverFillColor: 'rgba(255, 255, 255, 0.4)',
            handleHoverStrokeColor: 'rgba(255, 255, 255, 1)',
    
            // style classes
            cropperClasses: '',
            toolbarClasses: '',
            cropAreaClasses: '',
            formParamsClasses: '',
    
            // labels
    
            clearLabel: 'Clear',
            circleLabel: 'Circle',
            previewLabel: 'Preview',
            qualityLabel: 'Quality',
            saveLabel: 'Save image',
            cropAreaWidthLabel: 'Width',
            cropAreaHeightLabel: 'Height',
            cropAreaLabel: 'Cropper area',
            rotateLeftLabel: 'Rotate left',
            fullCropAreaLabel: 'Full area',
            selectBtnLabel: 'Select image',
            aspectRatioLabel: 'Aspect ratio',
            rotateRightLabel: 'Rotate right',
            cropParamsLabel: 'Cropper params',
            proportionalLabel: 'Proportional',
            flipVerticalLabel: 'Flip vertical',
            cropAreaYCoordLabel: 'Y coordinate',
            cropAreaXCoordLabel: 'X coordinate',
            flipHorizontalLabel: 'Flip horizontal',
            dropareaLabel: 'Select or drop image...',
        }"
        
        @cropper-error="someAction(errorMessage)"
        @cropper-file-selected="someAction(file)"
        @cropper-preview="someAction(imageSource)"
        @cropper-saved="someAction(cropData)"
        @cropper-cancelled="someAction()"
        @cropper-uploaded="someAction(serverResponse)"
    ></x-cropper>
  </div>
</template>
<script>
import XCropper from 'x-cropper'
import 'x-cropper/dist/XCropper.css'

export default {
  name: 'XCropper',
  components: {XCropper}
}
</script>