-
Notifications
You must be signed in to change notification settings - Fork 17
/
index_dev.html
380 lines (362 loc) · 14.5 KB
/
index_dev.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE html>
<html>
<head>
<title>GradientFinder - Convert your Images into CSS Gradients</title>
<meta name="Description" content="An entirely in browser way to convert an image to its CSS3 Gradient" />
<!-- build:css compiled/style.css -->
<link rel="stylesheet" type="text/css" href="static/ui.anglepicker.css" />
<link rel="stylesheet" type="text/css" href="static/gradient.css" />
<link rel="stylesheet" type="text/css" href="static/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="static/style.css" />
<!-- endbuild -->
<style id="custom-style"></style>
</head>
<body>
<header class="clearfix">
<h1><a href=".">GradientFinder</a></h1>
<div>
<strong>BUILT BY</strong>
<a href="http://twitter.com/aaronm67">@aaronm67</a>
(and <a href="http://twitter.com/bgrins">@bgrins</a>)
</div>
</header>
<div class="toolbar clearfix">
<a href="https://twitter.com/intent/tweet?text=I visited %23gradientfinder to convert an image to a CSS gradient!" class="twitter-share-button">Tweet #gradientfinder</a>
<div class="alert alert-warning">
GradientFinder is a quick way to find a gradient from an image! <a href='#about'>Read More</a>
</div>
<div class="btn-toolbar hide">
<div class="btn-group"></div>
</div>
</div>
<div class="container">
<div class="hero-unit main-section">
<div id="filedropper">
<h3>Drop an image here!</h3>
<strong>To find its CSS gradient</strong>
<div id="transparent"></div>
</div>
<textarea id="grad"></textarea>
<form class="form-inline" style="margin-bottom: 0;">
<label class="checkbox"><input id="applyBody" type="checkbox" />Preview</label>
</form>
<div class="hide" id="uploaded-image-container">
Gradient from this Image: <img id="uploaded-image" />
</div>
<div class="hide" id="error">
Couldn't find a gradient from that image...
</div>
</div>
<div id="stops-container" class="main-section">
<h3>Gradient Generator</h3>
<div class='alert alert-info hide'>
Move alpha or color stops by dragging them across the track.<br />
Click on the track to add a new stop.
</div>
<div id="gradient-picker">
<strong>Pick your color and alpha stops.</strong>
<br />
<div id="stops">
<div id='track'>
<div id='tracktop'><div class='top-filler'></div></div>
<div id='trackbottom'></div>
</div>
<div id="guides"></div>
</div>
<div id="currentstop"></div>
<strong>Choose your angle.</strong>
<div class='controls'>
<div class="angle input-prepend">
<span id="angle-label" class="add-on"><div id="anglepicker"></div></span>
<input id="current-angle" />
</div>
<em id="tip" class="hide">
Tip: If you hold shift, you can snap to 15 degree increments
</em>
</div>
</div>
</div>
</div>
<div class="container content">
<a name='about'></a>
<div class="row">
<div class="span12">
<h3>About:</h3>
<p>
Gradient Finder is an entirely in browser way to convert an image to its
<a href="http://dev.w3.org/csswg/css3-images/#gradients">CSS gradient</a>.
You can also generate CSS gradients and make changes to the files you choose!
</p>
<p>
It was written by <a href="http://aaronm67.foliotek.me">Aaron Marasco</a> and <a href="http://briangrinstead.com">Brian Grinstead</a>
</p>
<p>
It was (partially) inspired by <a href="https://github.com/bluesmoon/pngtocss">pngtocss</a>. The main things that are different about GradientFinder
is that it accepts more image types than pngs, it accepts arbitrary angles, and it can <strong>run in your browser</strong>!
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>Open Source:</h3>
<p>
The GradientFinder library is open source. To use it, include the script like so:
</p>
<pre><script type="text/javascript" src="gradientfinder.js"></script></pre>
<p>
<a class="btn btn-primary btn-large" href="https://raw.github.com/aaronm67/gradientfinder/master/gradientfinder.js">Javascript</a>
<a class="btn btn-primary btn-large" href="https://github.com/aaronm67/gradientfinder">View on Github</a>
</p>
</div>
</div>
<div class="row">
<div class="span6">
<h3>Methods:</h3>
<p>The following methods are exposed from the global GradientFinder object.</p>
<p>
<pre>
GradientFinder {
fromUrl: function(url, onload),
fromCanvas: function(canvas)
};
</pre>
</p>
</div>
<div class="span6">
<h3>Returns:</h3>
<p>This is the signature of the methods exposed from the return object.</p>
<p>
<pre>
Gradient {
stops: [ array ],
angle: integer,
toCss: function() // returns String
};
</pre>
</p>
</div>
</div>
<hr>
<a name="examples"></a>
<h2>Examples</h2>
<p>Here you can view a lot of gradient examples. They don't open until you press the button, because it can be slow to load them all at once!
<div>
<a class="btn btn-primary btn-large" id="showExamples" href="#">View</a>
<div id="example-container" class="hide">
<p> (left is an image, right is the CSS Gradient of that image) </p>
<div class='well'>
<table id="samples">
<tr>
<td>
<img data-src="gradients/diagonal.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/horizontal.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/linear_rainbow.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/singlehorizontal.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/singlevertical.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/solid.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/vertical.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/transparent.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/cooldiag.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/weirdhoriz.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/weirddiag.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
<tr>
<td>
<img data-src="gradients/transdiag.png" />
</td>
<td>
<div class="preview"></div>
</td>
<td>
<div class="canvas"></div>
</td>
<td>
<textarea class="css"></textarea>
</td>
</tr>
</table>
</div>
</div>
</div>
<hr>
<footer>
<div class="container">
<p><a href="https://raw.github.com/aaronm67/gradientfinder/master/LICENSE">© Aaron Marasco & Brian Grinstead 2012</a></p>
</div>
</footer>
</div>
<img id="default-grad" src="gradients/linear_rainbow.png" style="display:none" />
<!-- build:js ./compiled/gradientfinder.min.js -->
<script type="text/javascript" src="gradientfinder.js"></script>
<!-- endbuild -->
<!--build:js ./compiled/framework.js -->
<script type="text/javascript" src="static/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="static/jquery-ui.js" ></script>
<!-- endbuild -->
<!--build:js ./compiled/plugin.js -->
<script type="text/javascript" src="static/plugin/filereader.js" ></script>
<script type="text/javascript" src="static/plugin/tinycolor.js" ></script>
<script type="text/javascript" src="static/plugin/keymaster.js" ></script>
<script type="text/javascript" src="static/plugin/prefixfree.js" ></script>
<script type="text/javascript" src="static/plugin/spectrum.js" ></script>
<script type="text/javascript" src="static/plugin/ui.anglepicker.js" ></script>
<script type="text/javascript" src="static/plugin/utils.js" ></script>
<script type="text/javascript" src="static/plugin/webkit-utils.js" ></script>
<!-- endbuild -->
<script type="text/javascript" src="./compiled/gradient.js"></script>
<!-- build:js ./compiled/demo.js -->
<script type="text/javascript" src="static/gradientgenerator.js"></script>
<script type="text/javascript" src="static/demo.js"></script>
<!-- endbuild -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32456048-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>