-
Notifications
You must be signed in to change notification settings - Fork 52
/
demo.html
481 lines (435 loc) · 13.6 KB
/
demo.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
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
<!DOCTYPE html>
<html lang="en">
<head>
<title>Colorify.js</title>
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/prism.css">
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="shortcut icon" type="image/png" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="description" content="Colorify is a script written in Javascript, that allows you to extract colors from images, and manipulates them."/>
<meta property="fb:app_id" content="966242223397117">
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Colorify.js - The simple, customizable, tiny javascript color extractor" />
<meta property="og:description" content="Colorify is a script written in Javascript, that allows you to extract colors from images, and manipulates them." />
<meta property="og:url" content="http://colorify.rocks" />
<meta property="og:site_name" content="colorify.js" />
<meta property="og:image" content="http://colorify.rocks/images/og_image.png">
</head>
<!--
Cover photos by order :
https://www.flickr.com/photos/50122097@N00/4236749844
https://www.flickr.com/photos/67961268@N00/283994079
https://www.flickr.com/photos/80547277@N00/365570308
https://www.flickr.com/photos/34409164@N06/3618324994
https://www.flickr.com/photos/56053592@N00/6166620122
-->
<body id="body">
<div id="minHeader">
<header class="hero-header">
<h2><span>C</span><span>o</span><span>l</span><span>o</span><span>r</span><span>i</span><span>f</span><span>y</span><span>.</span><span>j</span><span>s</span></h2>
</header>
<div class="colors"></div>
</div>
<nav>
<div class="control">
<a href="#" id="closeNav"><span class="icon -close"><<</span></a>
</div>
<div class="menu">
<header class="hero-header">
<h1><span>C</span><span>o</span><span>l</span><span>o</span><span>r</span><span>i</span><span>f</span><span>y</span><span>.</span><span>j</span><span>s</span></h1>
</header>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html#documentation">Documentation</a>
<ul class="doc">
<li><a href="index.html#installation">Installation</a></li>
<li><a href="index.html#defaultConfig">Default config</a></li>
<li><a href="index.html#loadImagesDynamically">Load images dynamically</a></li>
<li><a href="index.html#getMainColor">Get main color</a></li>
<li><a href="index.html#getGradient">Get Gradient</a></li>
<li><a href="index.html#lazyReveal">Lazy-reveal</a></li>
<li><a href="index.html#displayOnEvent">Display on event</a></li>
<li><a href="index.html#manipulatesColor">Manipulates color</a></li>
</ul>
</li>
<li><a href="index.html#api">API</a></li>
<li><a href="demo.html">Demo</a></li>
<li class="bottom">
<li><a href="https://github.com/LukyVj/Colorify.js">Github</a></li>
<li><a href="about.html">About</a></li>
</li>
</ul>
<footer>
<div class="share">
<a href="https://twitter.com/share" class="twitter-share-button"{count} data-via="lukyvj" data-size="large" data-hashtags="colorifyJs">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<span class="icon -tools">Made</span> with <span class="icon -love">♥</span> by <a href="http://twitter.com/lukyvj"><strong><span>@</span><span>L</span><span>u</span><span>k</span><span>y</span><span>V</span><span>j</span></strong></a>
</footer>
</div>
</nav>
<header id="header" class="">
<span class="orange-block"></span>
<span class="red-block"></span>
<span class="purple-block"></span>
<span class="blue-block"></span>
<span class="green-block"></span>
<div class="hero-header">
<div class="hero-title">
<h1>Colorify.js</h1>
<h2>Demos</h2>
<a href="index.html" class="btn btn-info">Home</a>
</div>
</div>
</header>
<div class="content">
<div id="demos">
<header>
<h2>Demos</h2>
</header>
<ul>
<li>Default config</li>
<li>Load images dynamically</li>
<li>Get main color</li>
<li>Get Gradient</li>
<li>Lazy-reveal</li>
<li>Display on event</li>
<li>Manipulates color</li>
</ul>
<div class="alert">
<p>It happens that this page <strong>needs a refresh</strong> in order to get the colorify.js script working.</p>
<p>There is a lot of images to process on this demo page, and sometimes, the script cannot perform the operations as fast as an image processing on a server would do.</p>
</div>
<section id="demoDefault" class="demo">
<div class="sample">
<div class="codes">
<div class="html">
<pre class="language-markup"><code class="language-markup"><div colorify>
<img src="images/demo/image2.jpg" alt="An image">
<img src="images/demo/image3.jpg" alt="An other image">
<img src="images/demo/miaou.jpg" alt="An other image">
</div>
</code></pre>
</div>
<div class="javascript">
<pre class="language-javascript"><code class="language-javascript">colorify({
id: 1,
container: 'colorify',
images: false,
accuracy: 100,
gradient: false,
gradientDirection: false,
padding: 4,
lazyReveal: false,
give: false,
revealOn: false
});</code></pre>
</div>
</div>
<div class="result">
<div colorify>
<img src="images/demo/image2.jpg" alt="">
<img src="images/demo/image3.JPG" alt="">
<img src="images/demo/miaou.jpg" alt="">
</div>
</div>
</div>
</section>
<section id="demoDynamic" class="demo">
<header><h2>Load Images Dynamically</h2></header>
<div class="sample">
<div class="codes">
<div class="html">
<pre class="language-markup"><code class="language-markup"><div colorify-dynamic>
</div>
</code></pre>
</div>
<div class="javascript">
<pre class="language-javascript"><code class="language-javascript">colorify({
id: 2,
container: 'colorify-dynamic',
images: [
'images/demo/image2.jpg',
'images/demo/image3.jpg',
'images/demo/miaou.jpg'],
accuracy: 100,
gradient: false,
gradientDirection: false,
padding: 4,
lazyReveal: false,
give: false,
revealOn: false
});</code></pre>
</div>
</div>
<div class="result">
<div colorify-dynamic>
</div>
</div>
</div>
</section>
<section id="demoReveal" class="demo">
<header><h2>Lazy Reveal</h2></header>
<div class="sample">
<div class="codes">
<div class="html">
<pre class="language-markup"><code class="language-markup"><div colorify-reveal>
<img src="images/demo/image2.jpg" alt="">
<img src="images/demo/image3.jpg" alt="">
<img src="images/demo/miaou.jpg" alt="">
</div></code></pre>
</div>
<div class="javascript">
<pre class="language-javascript"><code class="language-javascript">colorify({
id: 3,
images: false,
container: 'colorify-reveal',
lazyReveal: {
transition: 2, // The transition occurs for 2 seconds
delay: 1
},
accuracy: 100,
gradient: false,
padding: 10
});</code></pre>
</div>
</div>
<div class="result">
<div colorify-reveal>
<img src="images/demo/image2.jpg" alt="">
<img src="images/demo/image3.JPG" alt="">
<img src="images/demo/miaou.jpg" alt="">
</div>
</div>
</div>
</section>
<section id="demoDisplay" class="demo">
<header><h2>Display on Event</h2></header>
<div class="sample">
<div class="codes">
<div class="html">
<pre class="language-markup"><code class="language-markup"><a href="javascript:void(0)" class="btn" id="demoEvent">Click me</a>
<div colorify-display>
<img src="images/demo/image2.jpg" alt="">
<img src="images/demo/image3.jpg" alt="">
<img src="images/demo/miaou.jpg" alt="">
</div>
</code></pre>
</div>
<div class="javascript">
<pre class="language-javascript"><code class="language-javascript">colorify({
id: 4,
images: false,
container: 'colorify-display',
lazyReveal: false,
accuracy: 100,
gradient: false,
padding: 6,
revealOn: {
event: 'click',
trigger: '#demoEvent'
}
});</code></pre>
</div>
</div>
<div class="result">
<a href="javascript:void(0)" class="btn" id="demoEvent">Click me</a>
<div colorify-display>
<img src="images/demo/image2.jpg" alt="">
<img src="images/demo/image3.JPG" alt="">
<img src="images/demo/miaou.jpg" alt="">
</div>
</div>
</div>
</section>
<section id="demoManipulate" class="demo">
<header><h2>Manipulates color</h2></header>
<div class="alert">
<p>As <code>target</code> you can use : <strong>a Class</strong>, <strong>an ID</strong>, All occurences (<strong>*</strong>), <strong>[attribute]</strong>.</p>
<p>You can aslo use these two keywords : <code>parent</code> & <code>children</code>.</p>
</div>
<div class="sample">
<div class="codes">
<div class="html">
<pre class="language-markup"><code class="language-markup"><div colorify-manipulate>
<h3 class=".demo-title">A title</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta itaque facere repellat cupiditate sed expedita eaque porro at voluptates, nostrum enim, voluptatibus, dignissimos magnam quo nobis ullam a molestiae? Et.</p>
<img src="images/demo/test.png" colorify-manipulate/>
</div></code></pre>
</div>
<div class="javascript">
<pre class="language-javascript"><code class="language-javascript">colorify({
id: 5,
container: 'colorify-manipulate',
lazyReveal: false,
accuracy: 100,
gradient: false,
padding: 4,
revealOn: false,
give: {
property: 'color',
target: '.demo-title'
}
});</code></pre>
</div>
</div>
<div class="result">
<div colorify-manipulate>
<h3 class="demo-title">A title</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta itaque facere repellat cupiditate sed expedita eaque porro at voluptates, nostrum enim, voluptatibus, dignissimos magnam quo nobis ullam a molestiae? Et.</p>
<img src="images/demo/miaou.jpg"/>
</div>
</div>
</div>
</section>
<section id="demoColor" class="demo">
<header><h2>Get Color / Get Gradient</h2></header>
<div class="sample">
<div class="codes">
<div class="html">
<pre class="language-markup"><code class="language-markup">
<div colorify-get-color>
<img src="images/demo/deer.jpeg">
</div>
</code></pre>
</div>
<div class="javascript">
<pre class="language-javascript"><code class="language-javascript">colorify({
id: 6,
container: 'colorify-get-color',
lazyReveal: false,
accuracy: 100,
gradient: false,
padding: 4
});</code></pre>
</div>
</div>
<div class="result">
<div colorify-get-color>
<img src="images/demo/deer.jpeg"/>
</div>
</div>
<div class="codes">
<div class="html"><pre class="language-markup"><code class="language-markup">
<div colorify-get-gradient>
<img src="images/demo/deer.jpeg">
</div>
</code></pre>
</div>
<div class="javascript">
<pre class="language-javascript"><code class="language-javascript">colorify({
id: 7,
container: 'colorify-get-gradient',
lazyReveal: false,
accuracy: 100,
gradient: true,
padding: 4
});</code></pre>
</div>
</div>
<div class="result">
<div colorify-get-gradient>
<img src="images/demo/HausderKulturen.jpeg"/>
</div>
</div>
</div>
</section>
</div>
</div>
<script src="scripts/app.js"></script>
<script src="src/colorify.js"></script>
<script>
colorify({
id: 1,
container: 'colorify',
images: false,
accuracy: 100,
gradient: false,
gradientDirection: false,
padding: 4,
lazyReveal: false,
give: false,
revealOn: false
});
colorify({
id: 2,
container: 'colorify-dynamic',
images: [
'images/demo/image2.jpg',
'images/demo/image3.JPG',
'images/demo/miaou.jpg'],
accuracy: 100,
gradient: false,
gradientDirection: false,
padding: 4,
lazyReveal: false,
give: false,
revealOn: false
});
colorify({
id: 3,
images: false,
container: 'colorify-reveal',
lazyReveal: {
transition: 2, // The transition occurs for 2 seconds
delay: 1
},
accuracy: 100,
gradient: false,
padding: 10
});
colorify({
id: 4,
images: false,
container: 'colorify-display',
lazyReveal: false,
accuracy: 100,
gradient: false,
padding: 6,
revealOn: {
event: 'click',
trigger: '#demoEvent'
}
});
colorify({
id: 5,
container: 'colorify-manipulate',
lazyReveal: false,
accuracy: 100,
gradient: false,
padding: 4,
give: {
property: 'color',
target: '.demo-title'
},
revealOn: false
});
colorify({
id: 6,
container: 'colorify-get-color',
lazyReveal: false,
accuracy: 100,
gradient: false,
padding: 4
});
colorify({
id: 7,
container: 'colorify-get-gradient',
lazyReveal: false,
accuracy: 100,
gradient: true,
padding: 6
});
</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-42634383-4', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>