-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
218 lines (190 loc) · 7.91 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!doctype html>
<html>
<head>
<meta charset="utf-8" name = "viewport" content = "width=device-width, initial-scale=1.0">
<title>John Arena III</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- Bootstrap Slider -->
<script src="js/bootstrap-slider.js"></script>
<link rel="stylesheet" href="css/bootstrap-slider.css">
<!-- Trixelator -->
<script src="js/trixelator.js"></script>
<script src="js/trixelator-page.js"></script>
<link href="css/trixelator.css" rel="stylesheet" type="text/css">
<!-- Google -->
<link href='http://fonts.googleapis.com/css?family=Coda:400,200' rel='stylesheet' type='text/css'>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<!-- Facebook -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=818399861580732";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!--[if lt IE 7]><p class=chromeframe>Your browser is super old. <a href="http://browsehappy.com/">Update your browser.</a></p><![endif]-->
</head>
<!--///--header---------------------------------------------->
<div class="jumbotron">
<div id="facebook-btn">
<div class="fb-like" data-href="http://jarena3.github.io/trixelator/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
</div>
<!-- Place this tag where you want the +1 button to render. -->
<div id="google-btn">
<div class="g-plusone" data-size="standard" data-annotation="bubble" data-width="120"></div>
</div>
<!-- Place this tag after the last +1 button tag. -->
<div="container">
<h1 align="center">Trixelator</h1>
<h4 align="center">Image Triangulizer</h4>
</div>
<!--///--body------------------------------------------------>
<body>
<div class="row">
<div class="col-md-10 col-md-offset-1" id="col-body">
<!--///--input----------------------------------------------->
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h4>Select Image</h4>
<div class="input-group">
<span class="input-group-btn">
<span class="btn btn-primary btn-file">
Browse… <input type="file" class="drop-area" id="imageLoader" name="imageLoader"/>
</span>
</span>
<input type="text" class="form-control" readonly>
</div>
<span class="help-block">
Large files will take a while to trixelate.
</span>
</div>
</div>
<div class="row">
<div class="col-md-12" id="preview">
<canvas class="hidden" id="inputCanvas"></canvas>
<canvas id="inputPreviewCanvas"></canvas>
</div>
</div>
<!--///--options--------------------------------------------->
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<div id="cs_in" class="panel panel-primary">
<div class="panel-heading">Cell Size</div>
<div class="panel-body">
<input id="cell-size-slider" data-slider-id='cs-slider' type="text" data-slider-min="5" data-slider-max="50" data-slider-step="1" data-slider-value="20" data-slider-handle="square"/>
</div>
</div>
</div>
<div class="col-md-6">
<div id="os_in" class="panel panel-primary">
<div class="panel-heading">Output Image Size</div>
<div class="panel-body">
<input id="output-size-slider" data-slider-id='os-slider' type="text" data-slider-min="1" data-slider-max="10" data-slider-step="1" data-slider-value="1" data-slider-handle="square"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4" id="cell-details-input">
<div class="panel panel-primary">
<div class="panel-heading">Cell Shape</div>
<div class="panel-body">
<div class="btn-group-xs" data-toggle="buttons">
<label class="btn btn-default active" data-toggle="tooltip" title="Generate square-shaped trixelation cells">
<input type="radio" name="shapes" id="shape-1" autocomplete="off" checked>Square
</label>
<label class="btn btn-default disabled" data-toggle="tooltip" title="Feature not yet implemented">
<input type="radio" name="shapes" id="shape-2" autocomplete="off">Vertical Hex
</label>
<label class="btn btn-default disabled" data-toggle="tooltip" title="Feature not yet implemented">
<input type="radio" name="shapes" id="shape-2" autocomplete="off">Horizontal Hex
</label>
<label class="btn btn-default disabled" data-toggle="tooltip" title="Feature not yet implemented">
<input type="radio" name="shapes" id="shape-3" autocomplete="off">Voronoi
</label>
</div>
</div>
</div>
</div>
<div class="col-md-4" id="cell-details-input">
<div class="panel panel-primary">
<div class="panel-heading">Bisector Direction</div>
<div class="panel-body">
<div class="btn-group-xs" data-toggle="buttons">
<label class="btn btn-default" data-toggle="tooltip" title="Cells trixelate from left to right.">
<input type="radio" name="bisect-dir" value="bis-ccw" autocomplete="off">Counterclockwise
</label>
<label class="btn btn-default" data-toggle="tooltip" title="Cells trixelate from right to left.">
<input type="radio" name="bisect-dir" value="bis-cw" autocomplete="off">Clockwise
</label>
<label class="btn btn-default" data-toggle="tooltip" title="Cells trixelate on alternating sides. Works best on images with even pixel sizes.">
<input type="radio" name="bisect-dir" value="bis-alt" autocomplete="off">Alternating
</label>
<label class="btn btn-default active" data-toggle="tooltip" title="Cells trixelate L->R or R->L randomly.">
<input type="radio" name="bisect-dir" value="bis-rnd" autocomplete="off" checked>Random
</label>
</div>
</div>
</div>
</div>
<div class="col-md-4" id="misc-options">
<div class="panel panel-primary">
<div class="panel-heading">Other Options</div>
<div class="panel-body">
<div class="btn-group-xs" data-toggle="buttons">
<label class="btn btn-default" data-toggle="tooltip" title="Leaves a thin border between trixels.">
<input type="checkbox" name="other" id="cell-borders" autocomplete="off"> Draw Cell Borders
</label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="color-options">
<div class="panel panel-primary">
<div class="panel-heading">Color Options</div>
<div class="panel-body">
<div class="btn-group-xs" data-toggle="buttons">
<label class="btn btn-default" data-toggle="tooltip" title="Adds a little bit of noise to each trixel. It's classy.">
<input type="checkbox" name="color-option" id="noisy" autocomplete="off">Add Noise
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div>
<hr>
<a id="render" class="btn btn-md btn-primary btn-block" role="button"><span id="render-span"></span>Trixelate!</a>
<hr>
</div>
<!--///--output---------------------------------------------->
<div class="output">
<canvas class="hidden" id="outputCanvas"></canvas>
<canvas id="outputPreviewCanvas"></canvas>
</div>
<div id="d-btn-div">
<a href="#" id="d-btn" class="btn btn-sm btn-success" role="button" download="trixelation.png"><span id="download-button"></span></a>
<br><br>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<div id="footer">
<a href="http://jarena3.github.io"><b>John Arena III </b></a>
</div>
</div>
</div>
</body>
<img class="hidden" src="noise.png" id="noise"/>