-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
44 lines (41 loc) · 1.21 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Progress bars</title>
<link rel="stylesheet" href="build/build.css">
<style type="text/css" media="all">
.spacing {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div id="download-progress" class="progress spacing">
<div class="bar" style="width: 50%"></div>
</div>
<div class="progress spacing">
<div class="bar" style="width: 20%"></div>
</div>
<div class="progress spacing">
<div class="bar" style="width: 30%"></div>
</div>
<div class="progress">
<div class="bar" style="width: 40%"></div>
</div>
<script src="build/build.js"></script>
<script type="text/javascript" charset="utf-8">
var progress = require('progress');
var map = require('component-map');
var each = require('component-each');
var els = document.querySelectorAll(".bar");
var bars = map(els, progress);
setInterval(function(){
each(bars, function(bar){
var percent = Math.floor(Math.random() * 100);
bar.update(percent);
});
}, 1000);
</script>
</body>
</html>