-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (41 loc) · 1.37 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
<html>
<head>
<link rel="stylesheet" type="text/css" href="app.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery.juitter.js"></script>
<script type="text/javascript" src="system.js"></script>
<script type="text/javascript" src="colors.js"></script>
<script type="text/javascript">
$(function (){
var width = 256;
var height = 256;
var source = $("#source").get(0).getContext('2d');
var img = new Image();
img.src = "./images/sample.jpg";
img.onload = function() {
source.drawImage(img, 0, 0);
$("#source").click(function (e){
var color = detect_color(source, e.pageX - $("#source").position().left, e.pageY - $("#source").position().top);
insert_color_name(color);
$(".jLinks").removeClass("on");
$(this).addClass("on");
$.Juitter.start({
searchType:"searchWord",
searchObject: color,
live:"live-120" });
return false;
});
};
})
</script>
</head>
<body align="center">
<div style="background-color:#000;">
<canvas id="source" width="658" height="440"></canvas>
</div>
<div id="info">
<div id="color_name"></div>
<div id="juitterContainer"></div>
</div>
</body>
</html>