forked from lokesh/color-thief
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·72 lines (65 loc) · 2.81 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
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link href='http://fonts.googleapis.com/css?family=Varela+Round|Terminal+Dosis:400,700,600' rel='stylesheet' type='text/css'>
<title>Color Thief</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="css/app.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
</head>
<body>
<a href="https://github.com/achudars/color-thief"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<div id="container">
<header>
<h1>Color Thief*</h1>
<h4><a href="http://lokeshdhakar.com">by Lokesh Dhakar and upload functionality by Aleksandrs Cudars</a></small></h4>
<p>A script for grabbing the dominant color or color palette from an image. Uses Javascript and the canvas tag to make it happen.</p>
<p><a href="http://www.lokeshdhakar.com/color-thief/">Lokesh's blog</a> | <a href="https://github.com/lokesh/color-thief">Get Lokesh's code on Github</a> | <a href="https://github.com/achudars/color-thief">Get Aleks's code on Github</a>
</p>
</header>
<div id="main" role="main">
</div>
</div> <!--! end of #container -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="js/libs/jquery.lettering.js"></script>
<script src="js/libs/mustache.js"></script>
<script src="js/libs/quantize.js"></script>
<script src="js/color-thief.js"></script>
<!-- PLACEHOLDER FOR THE IMAGE -->
<script id='template' type='text/x-mustache'>
<input id="uploadImage" type="file" name="myPhoto" onchange="PreviewImage();" />
<div class="imageSection">
<div class="imageWrap">
<img class="targetImage" id="uploadPreview" data-colorcount="{{colorCount}}" />
</div>
<div class="colors">
<div class="function dominantColor">
<h3>Dominant Color</h3>
<div class="swatches"></div>
</div>
<div class="function medianCutPalette clearfix">
<h3>Palette</h3>
<div class="swatches"></div>
</div>
</div>
</div>
</script>
<!-- PREVIEW OF THE IMAGE -->
<script type="text/javascript">
function PreviewImage() {
oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]);
oFReader.onload = function (oFREvent) {
document.getElementById("uploadPreview").src = oFREvent.target.result;
};
};
</script>
<!-- COLOR THIEF DOES ITS MAGIC HERE -->
<script src="index.js"></script>
<script src="js/libs/socialite.min.js"></script>
</body>
</html>