-
Notifications
You must be signed in to change notification settings - Fork 6
/
example.html
58 lines (55 loc) · 1.14 KB
/
example.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<title>Drop Anywhere</title>
<style type="text/css">
@-webkit-keyframes show {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
body {
text-align: center;
}
#drop-anywhere {
line-height: 500px;
text-align: center;
color: white;
display: none;
}
#drop-anywhere::before {
content: 'Drop to upload!';
}
#drop-anywhere.show {
display: block;
-webkit-animation: show 300ms;
}
#content {
width: 80%;
height: 80%;
line-height: 300px;
margin: 0 auto;
background: #eee;
}
</style>
<link rel="stylesheet" type="text/css" href="build/build.css">
</head>
<body>
<div id="content">Some content here</div>
<script type="text/javascript" src="build/build.js"></script>
<script type="text/javascript">
var dropAnywhere = require('drop-anywhere');
var drop = dropAnywhere(function(e){
e.items.forEach(function(item){
console.log(item);
});
});
setTimeout(function(){
console.log('unbinding');
drop.unbind();
}, 5000);
</script>
</body>
</html>