diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bc9103d --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log +test/unit/coverage +test/e2e/reports +selenium-debug.log diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..f84f83e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Alessio Maffeis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PictureInput.vue b/PictureInput.vue new file mode 100644 index 0000000..699f34a --- /dev/null +++ b/PictureInput.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/README.md b/README.md new file mode 100755 index 0000000..f9aaf2c --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +vue-picture-input +============= + +Mobile-friendly picture file input component with image preview and drag and drop. + +## Installation +--------------- +###npm +``` sh +npm install --save vue-picture-input +``` + +## Usage +--------------- + +```javascript + +``` + +```HTML + +``` + +## Props +--------------- + +- width, height: (pixels, optional) the width and the height of the preview container. The picture will be resized and centered to cover this area. If not specified, the preview container will expand to full width, 1:1 square ratio. +- margin: (pixels, optional) the margin around the preview container. +- accept: (media type, optional) the accepted image type(s) (e.g. image/jpeg, image/gif, etc.) Default value: image/*. +- id, name: (string, optional) the id and name attributes of the HTML input element + + +## TODOs +--------------- +- Add support for multiple files +- Demo GitHub pages + + +## Contributions +--------------- +All contributions are welcome. diff --git a/package.json b/package.json new file mode 100755 index 0000000..cc7467b --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "vue-picture-input", + "version": "1.0.0", + "description": "Mobile-friendly picture file input component with image preview and drag and drop.", + "main": "PictureInput.vue", + "scripts": { + "test": "npm run unit" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/alessiomaffeis/vue-picture-input.git" + }, + "keywords": [ + "VueJs", + "picture", + "image", + "input", + "preview", + "form", + "upload" + ], + "author": "alessio@maffe.is", + "license": "MIT", + "bugs": { + "url": "https://github.com/alessiomaffeis/vue-picture-input/issues" + }, + "homepage": "https://github.com/alessiomaffeis/vue-picture-input" +}