This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
forked from null2/color-thief
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·118 lines (99 loc) · 4.15 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
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Color Thief</title>
<meta name="description" content="Color Thief is a script for grabbing the color palette from an image. It uses Javacript and the canvas tag.">
<meta name="author" content="Lokesh Dhakar">
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="js/libs/modernizr.custom.js"></script>
<link href='http://fonts.googleapis.com/css?family=Karla:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div class="wrapper">
<section class="intro">
<header>
<h1 class="logo">Color Thief</h1>
</header>
<h4><a href="http://lokeshdhakar.com">by Lokesh Dhakar</a></small></h4>
<p class="description">A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen.</p>
<p class="read-more-links"><a href="http://www.lokeshdhakar.com/color-thief/">Read more about it on my blog</a> or <a href="https://github.com/lokesh/color-thief">get the code on Github</a></p>
</section>
<section id="examples" class="examples">
<header>
<h2 class="section-header">Examples</h2>
</header>
</section>
<section id="drag-drop" class="drag-drop">
<header>
<h2 class="section-header">Try it yourself</h2>
</header>
<div id="drop-zone" class="drop-zone">
<div class="drop-zone-label default-label">Drag an image here</div>
<div class="drop-zone-label dragging-label">Drop it here!</div>
</div>
<div id="dragged-images" class="dragged-images"></div>
</section>
<section id="sharing" class="sharing">
<a href="https://twitter.com/share" class="twitter-share-button" data-via="lokesh" data-size="large">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>
</section>
</div>
<script src="js/libs/jquery-2.0.2.min.js"></script>
<script src="js/libs/jquery.lettering.js"></script>
<script src="js/libs/mustache.js"></script>
<script src="js/color-thief.js"></script>
<!-- Mustache templates -->
<script id='image-section-template' type='text/x-mustache'>
{{#images}}
<div class="image-section {{class}}">
<div class="image-wrap">
<button class="run-functions-button">
<span class="no-touch-label">Click</span>
<span class="touch-label">Tap</span>
</button>
<img class="target-image" src="{{file}}" />
</div>
<div class="color-thief-output"></div>
</div>
{{/images}}
</script>
<script id="color-thief-output-template" type="text/x-mustache">
<div class="function get-color">
<h3 class="function-title">Dominant Color</h3>
<div class="swatches">
<div class="swatch" style="background-color: rgb({{color.0}}, {{color.1}}, {{color.2}})"></div>
</div>
<div class="function-code">
<code>colorThief.getColor(image):{{elapsedTimeForGetColor}}ms</code>
</div>
</div>
<div class="function get-palette">
<h3 class="function-title">Palette</h3>
<div class="function-output">
<div class="swatches">
{{#palette}}
<div class="swatch" style="background-color: rgb({{0}}, {{1}}, {{2}})"></div>
{{/palette}}
</div>
</div>
<div class="function-code">
<code>colorThief.getPalette(image):{{elapsedTimeForGetPalette}}ms</code>
</div>
</div>
</script>
<script src="demo.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2196019-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>