-
Notifications
You must be signed in to change notification settings - Fork 38
/
index.html
123 lines (89 loc) · 3.27 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,500,100' rel='stylesheet' type='text/css'>
<link href="css/style.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/d3.min.js"></script>
<script type="text/javascript" src="js/jsfeat-min.js"></script>
</head>
<body>
<div id="container">
<div id="svg"></div>
<img id="bg" src="./images/onepx.png" />
<div id="dots"></div>
<div id="info">
<a href="https://twitter.com/williamngan" target="_blank">By @williamngan</a> ·
<a href="https://github.com/williamngan/kubist" target="_blank">Source code</a> ·
<a href="https://medium.com/@williamngan/kubist-6ed1d8025806" target="_blank">How it works</a>
</div>
<div id="menu" class="open">
<h1 id="header">Kubist</h1>
<hr />
<p>
<label>Select an image</label><label class="action" onclick="loadImage(this)" data-id="mao.jpg">A guy</label>
<label> </label><label class="action" onclick="loadImage(this)" data-id="bauhaus.jpg">A dance</label>
<label> </label><label class="action" onclick="loadImage(this)" data-id="bay.jpg">A view</label>
<label> </label><label class="hint">Your own image...</label>
<label class="fileinput">
<input type="file" id="fileInput" />
</label>
</p>
<hr />
<p>
<label>Style</label>
<select id="visualizationInput">
<option value="delaunay">Triangle</option>
<option value="voronoi">Cell</option>
</select>
<span id="imageOnlyControl">
<label> </label><label class="checkbox"><input type="checkbox" id="gradientInput" /> <span>Color Gradient</span></label>
<label> </label><label class="checkbox"><input type="checkbox" id="featureInput" /> <span id="analyzeLabel">Analyze image</span></label>
</span>
</p>
<p>
<label>Points</label>
<input type="number" id="pointsInput" value="50" />
</p>
<p>
<label>Circle size</label>
<input type="number" id="circleRadiusInput" value="0" />
</p>
<p>
<label>Border size</label>
<input type="number" id="lineStrokeInput" value="0" />
</p>
<p>
<label>Image overlay</label>
<label><input type="checkbox" id="overlay" /> Show</label>
</p>
<hr />
<p>
<img id="preview" alt="" />
<div id="canvas"></div>
</p>
</div>
<div id="download"><a href="#" onclick="downloadSVG()">Download SVG file</a></div>
<div id="close" onclick="menuToggle()">×</div>
</div>
<script type="text/javascript" src="js/kubist_ui.js"></script>
<script type="text/javascript">
function menuToggle() {
document.querySelector("#menu").classList.toggle("open");
document.querySelector("#svg").classList.toggle("larger");
document.querySelector("#close").classList.toggle("closed");
setTimeout( function() {
resetKubist(true);
}, 600);
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-62057621-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>