-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·75 lines (64 loc) · 2.51 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Moniker</title>
<style>
body {
background-color: #f0f0f0;
margin: 0px;
}
</style>
</head>
<body>
<div id="container"></div>
<label for=friction>friction</label>
<input type=range min=1 max=25 value=6 id=friction onchange="editor.friction = this.value">
<label for=density>density</label>
<input type=range min=1 max=50 value=20 id=density onchange="editor.density = this.value">
<label for=restitution>restitution</label>
<input type=range min=0 max=2.0 value=0.2 step=0.1 id=restitution onchange="editor.restitution = this.value">
<label for=damping>damping</label>
<input type=range min=0 max=4.0 value=0.8 step=0.1 id=damping onchange="editor.damping = this.value">
<input type="button" value="Save" id="save">
<ul id="saves"></ul>
<body/>
<script type="text/javascript" src="lib/Box2DEmscripten.js"></script>
<script type="text/javascript" src="lib/Pixi.js"></script>
<script type="text/javascript" src="src/tresholdFilter.js"></script>
<script type="text/javascript" src="lib/Stats.js"></script>
<script type="text/javascript" src="src/ToothDef.js"></script>
<script type="text/javascript" src="src/moniker.js"></script>
<script>
var container = document.getElementById('container'),
saves = document.getElementById('saves'),
save = document.getElementById('save'),
date = new Date(),
editor;
window.onload = function() {
var width, height, meter, palette, rotate, callback;
width = 170; // regular scarf
height = 1600; // regular scarf
meter = 20; // regular scarf
// width = 550; // blanket scarf
// height = 1600; // blanket scarf
// meter = 10; // blanket scarf
palette = [[0,0,0], [255,255,255]];
rotate = true;
callback = function() {
container.appendChild(editor.userCanvas);
};
editor = monikerEditor(width, height, meter, palette, rotate, callback);
};
save.onclick = function() {
var li = document.createElement('li'),
link = document.createElement('a');
link.href = editor.dataCanvas().toDataURL();
link.target = "_blank";
link.textContent = date.toTimeString();
link.style.display = 'block';
saves.appendChild(li);
li.appendChild(link);
};
</script>
</html>