-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
29 lines (24 loc) · 800 Bytes
/
script.js
File metadata and controls
29 lines (24 loc) · 800 Bytes
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
jQuery(function($) {
var append_box_for_color = function(color) {
var box = $("<div>").addClass("color").text(color).css('background-color', color);
$("#result").append(box);
};
var show_colors = function(colors) {
$("#result").empty();
colors.map(function(color) { append_box_for_color(color); });
};
$(document).ready(function() {
$("#button").click(function() {
var origin = $("#input").val();
show_colors(Hextractor.hextract(origin));
});
var pointer = $("#pointer");
$("#result").mousemove(function(event) {
pointer.css({top: event.pageY, left: event.pageX});
});
$("#search_button").click(function() {
var color = $("#color").val();
pointer.css("background-color", color);
});
});
});