-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.html
57 lines (40 loc) · 1.08 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
<!DOCTYPE html>
<html>
<head>
<title>Picker</title>
<script src="src/picker.js"></script>
<!--<script src="dist/picker.min.js"></script>-->
<style>
* {
padding: 0;
margin: 0;
}
body {
background: #239feb;
}
#parent {
margin: 100px auto;
background: #46b7fd;
color: #fff;
padding: 10px 16px;
width: 100px;
font-family: sans-serif;
font-weight: 100;
font-size: 20px;
text-align: center;
}
</style>
</head>
<body>
<div id="parent">click me</div>
<script>
var picker = new Picker(document.getElementById('parent'));
picker.on_done = function(colour) {
document.getElementById('parent').style.background = colour.rgba().toString();
}
document.getElementById('parent').onclick = function() {
picker.show();
};
</script>
</body>
</html>