Skip to content

Commit

Permalink
- Added CSS progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
BAndiT1983 committed Apr 10, 2018
1 parent cfdc72b commit 6373c90
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
20 changes: 20 additions & 0 deletions app/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
font-weight: bold;
font-size: 1.3em;
font-family: sans-serif;
box-sizing: border-box;
}

.drop-area-hover {
Expand All @@ -36,3 +37,22 @@
display: flex;
padding: 1em;
}

.meter {
height: 0.5rem;
position: relative;
background: #555;
border-radius: 0.5rem;
margin-top: 0.3em;
/* padding: 0.2rem; */
padding: 0;
}

.meter>span {
display: block;
height: 100%;
border-radius: 0.5rem;
background-color:#FA8756;
position: relative;
overflow: hidden;
}
10 changes: 8 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@

<body>

<div id="drop-area" class="drop-area">
Drop images here
<div style="width: 25vw;box-sizing: border-box;">
<div id="drop-area" class="drop-area">
Drop images here
</div>
<div class="meter">
<span id="upload-progress" style="width: 0%"></span>
</div>
</div>

<div class="content">
<div id="preview-area" class="output-area">
<img id="preview-content"></img>
Expand Down
1 change: 1 addition & 0 deletions app/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function start () {

uploader.addEventListener('progress', function (event) {
var percent = event.bytesLoaded / event.file.size * 100
document.getElementById('upload-progress').style.width = percent + '%'
console.log('File is', percent.toFixed(2), 'percent loaded')
})
}
Expand Down

0 comments on commit 6373c90

Please sign in to comment.