-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
71 lines (60 loc) · 2.48 KB
/
index.html
File metadata and controls
71 lines (60 loc) · 2.48 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Stippling</title>
<style type="text/css">
/* Makes all images grayscale */
img {
filter: url(filters.svg#grayscale); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1); /* Google Chrome & Safari 6+*/
}
</style>
<script type="text/javascript" src="sylvester.js"></script>
<script type="text/javascript" src="glUtils.js"></script>
<script type="text/javascript" src="webgl-utils.js"></script>
<script type="text/javascript" src="voronoi.js"></script>
<script type="text/javascript" src="webgl.js"></script>
<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
varying vec4 vColor;
void main(void) {
gl_FragColor = vColor;
}
</script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec4 aVertexColor;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
varying vec4 vColor;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
vColor = aVertexColor;
}
</script>
</head>
<body onload="pageStart();">
<div id="canvases" style="border-style: solid; border-width: 1px; position: absolute; width: 900px; height: 550px;">
<canvas id="2d-canvas" style="position: absolute; width: 100%; height: 100%;"></canvas>
<canvas id="main-canvas" style="position: absolute; width: 100%; height: 100%;"></canvas>
<img id="theImage" style="max-width: 100%; max-height: 100%;"/>
</div>
<div style="margin-left: 900px; padding: 15px;">
<form>
# of stipple points: <input type="number" id="numStipples" min="1" max="20000" value="100" required><br>
Stipple size: <input type="number" id="stippleSize" min="0.1" max="2.5" value="2.5" step="0.1" onchange="stippleSizeChanged();" required /><br>
Stipple color: <input type="color" id="stippleColor" onchange="stippleColorChanged();" /><br>
Display Voronoi: <input type="checkbox" id="displayVor" checked="true" onclick="displayVorClicked();" /><br>
Display Image: <input type="checkbox" id="displayImage" checked="true" onclick="displayImageClicked();" /><br>
<input type="file" text="Choose photo" accept="image/*" onchange="onFileSelected(event)"/>
</form>
<button id="start" type="button" onclick="start();" disabled>Start</button>
<button id="stop" type="button" onclick="stop();" disabled>Stop</button>
<button id="save" type="button" onclick="save();" disabled>Save</button>
<div id="status">Stopped...</div>
</div>
</body>
</html>