All Projects → fpluquet → vue-avatar-editor

fpluquet / vue-avatar-editor

Licence: MIT license
Avatar editor for Vue.js. Demo on : https://fpluquet.github.io/vue-avatar-editor/

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-avatar-editor

Ucrop
Image Cropping Library for Android
Stars: ✭ 11,003 (+12844.71%)
Mutual labels:  scale, rotation
React Native Easy Gestures
React Native Gestures. Support: Drag, Scale and Rotate a Component.
Stars: ✭ 153 (+80%)
Mutual labels:  scale, rotation
Igrphototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 212 (+149.41%)
Mutual labels:  scale, rotation
rotation master
Provide conversion between the major representations of 3D rotation and visualize the orientation of a rigid body
Stars: ✭ 157 (+84.71%)
Mutual labels:  rotation
vuestic-ui
Free and Open Source UI Library for Vue 3 🤘
Stars: ✭ 1,501 (+1665.88%)
Mutual labels:  vue-components
aura-admin
Aura Admin is the Web App that helps you to mange the Tech Communities like GDGs, DSCs or any other tech communities with Aura
Stars: ✭ 58 (-31.76%)
Mutual labels:  vue-components
vue2-leaflet-rotatedmarker
rotated marker plugin extension for vue2-leaflet package
Stars: ✭ 17 (-80%)
Mutual labels:  rotation
VueStudy
Vue Examples
Stars: ✭ 44 (-48.24%)
Mutual labels:  vue-components
vue-scrolly
Overlay scrollbar for Vue.js.
Stars: ✭ 24 (-71.76%)
Mutual labels:  vue-components
SKanimATE
Animated Flatground Skateboard Tricks
Stars: ✭ 18 (-78.82%)
Mutual labels:  rotation
ProjectKorra
The Official Plugin for ProjectKorra.
Stars: ✭ 65 (-23.53%)
Mutual labels:  avatar
special-vue-series-code-analyzing
「Vue生态库源码系列」,Vue、Vue-router、Vuex、Vue-cli、Vue-loader、Vue-devtools等
Stars: ✭ 15 (-82.35%)
Mutual labels:  vue-components
spigot-bending
Minecraft plugin that allows players to bend elements as in the series
Stars: ✭ 14 (-83.53%)
Mutual labels:  avatar
vue-checkbox-switch
A Vue component for checkbox's switch style
Stars: ✭ 36 (-57.65%)
Mutual labels:  vue-components
vue-undraw
Vue unDraw Components: MIT licensed illustrations by unDraw (http://undraw.co) for your Vue projects
Stars: ✭ 31 (-63.53%)
Mutual labels:  vue-components
Vuc
🎨 基于 Vuejs2 的 Canvas 组件库【服务器挂了。不在提供demo,github自带的静态网站不能发布,因为demo代码找不到了😂。】
Stars: ✭ 52 (-38.82%)
Mutual labels:  vue-components
FanLayout
可定制性超强的圆弧滑动组件
Stars: ✭ 28 (-67.06%)
Mutual labels:  rotation
mahler.c
Western music theory library in C99
Stars: ✭ 13 (-84.71%)
Mutual labels:  scale
MusicTheory
Music Theory Library for Java and Android apps
Stars: ✭ 24 (-71.76%)
Mutual labels:  scale
vue-json-form
vue-json-form
Stars: ✭ 14 (-83.53%)
Mutual labels:  vue-components

vue-avatar-editor

Facebook like, avatar / profile picture component. This is Vue.js clone of mosch/react-avatar-editor

Resize, rotate and crop your uploaded image using a clear user interface.

Demo at https://fpluquet.github.io/vue-avatar-editor/

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

Installation is done using the npm install command:

$ npm install vue-avatar-editor-improved

Usage

<div id="app">
      <vue-avatar
      :width=400
      :height=400
      :rotation="rotation"
      :scale="scale"
      ref="vueavatar"
      @vue-avatar-editor:image-ready="onImageReady"
      >
    </vue-avatar>
    <br>
    <input
      type="range"
      min=1
      max=3
      step=0.02
      :value='scale'
    />
    <input
      type="range"
      min=1
      max=3
      step=0.02
      :value='rotation'
    />
    <br>
    <button v-on:click="saveClicked">Click</button>
    <br>
    <img ref="image">
</div>
import Vue from 'vue'
import {VueAvatar} from 'vue-avatar-editor-improved'

let vm = new Vue({
  el: '#app',
  components: {
    VueAvatar,
    VueAvatarScale
  },
  data () {
      return {
          rotation: 0,
          scale: 1
      };
  },
  methods: {
      saveClicked () {
          var img = this.$refs.vueavatar.getImageScaled()
          this.$refs.image.src = img.toDataURL()
      },
      onImageReady () {
          this.scale = 1
          this.rotation = 0
      }
  }
})

Props

Prop Type Description
width Number The total width of the editor
height Number The total width of the editor
border Number The cropping border. Image will be visible through the border, but cut off in the resulting image.
color Number[] The color of the cropping border, in the form: [red (0-255), green (0-255), blue (0-255), alpha (0.0-1.0)]
style Object Styles for the canvas element
scale Number The scale of the image. You can use this to add your own resizing slider.
rotation Number The rotation in degrees of the image. You can use this to add your own rotating slider.
accept String Types of accepted files (accept props in file input). Default image/*. Exemplary other value image/png, image/jpeg.
placeholderSvg String Content of svg file for placeholder image

Accessing the resulting image

this.$refs.vueavatar.getImage()

The resulting image will have the same resolution as the original image, regardless of the editor's size. If you want the image sized in the dimensions of the canvas you can use getImageScaled.

this.$refs.vueavatar.getImageScaled()

Contributing

For development you can use following build tools:

  • npm run build: Builds the minified dist file: dist/index.js
  • npm run dev: Watches for file changes and builds unminified into: dist/index.js localhost:8080)
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].