-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
33 lines (29 loc) · 896 Bytes
/
demo.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
<!doctype=html>
<html>
<head>
<title>SpritifyCSS Demo</title>
</head>
<body>
<input id="files" name="files" type="file" multiple="multiple">
<button id="generate">Generate</button>
<div id="image-container">
</div>
<script src="lib/jszip.js"></script>
<script src="lib/packer.js"></script>
<script src="spritify.js"></script>
<script>
var files = document.getElementById('files');
var button = document.getElementById('generate');
var imageContainer = document.getElementById('image-container');
var spritify = new Spritify();
button.onclick = function() {
console.log("Button clicked");
spritify.loadFiles(files.files, {debug: true}, function() {
console.log("Loading complete");
console.log(spritify.getPng());
imageContainer.innerHTML = "<img src='" + spritify.getPng() + "' alt=''>";
});
};
</script>
</body>
</html>