Giter Site home page Giter Site logo

baianat-experiments / file-uploader Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 54 KB

A drag and drop file upload library that it friendly and fun to use. It offers great accessibility, validation and a smooth user experience.

HTML 4.21% JavaScript 79.48% CSS 16.31%

file-uploader's Introduction

Dropper (wip) ๐Ÿ›

A drag and drop file upload library that it friendly and fun to use. It offers great accessibility, validation and a smooth user experience.

Getting Started

Installation

You can install dropper using npm

npm install @baianat/dropper

# or using yarn
yarn add @baianat/dropper

Include necessary files

<head>
  <link rel="stylesheet" href="dist/css/dropper.css">
</head>
<body>
    ...
    <script type="text/javascript" src="dist/js/dropper.js"></script>
</body>

Make it work

You need a form element to bind dropper to it.

<form class="dropper" id="dropper"></form>

Then create new dropper instance, you have to path the uploading url to it

let dropper = new Dropper('#dropper', {
  url: `${server}/upload`
});

Events Listeners

dropper comes with may events that helps you to track file uploading and status

event name description
uploadFailed emits when a file uploaded successfully
uploadSuccees emits when a file failed to upload
fileDeleted emits when an uploaded file deleted
dropper.on('uploadFailed', ($file) => {
  console.log('๐Ÿ˜ญ', $file.name, 'uploading failed');
});

License

MIT

Copyright (c) 2017 Baianat

file-uploader's People

Contributors

abdelrahman3d avatar

Stargazers

Kim avatar

Watchers

James Cloos avatar Abdelrahman Awad avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.