-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcolourtest.html
73 lines (73 loc) · 2.02 KB
/
colourtest.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
<!DOCTYPE html>
<html>
<head>
<title>Colour Picker Test - UGWA</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<style>
body{max-width:1000px;margin:20px auto;padding:0 20px;font-family:sans-serif;}input,button,select,textarea{font:inherit;}a {text-decoration:none;}
.colourpicker-window {
border: 1px solid black;
padding: 5px;
font-size: 0;
}
.colourpicker-input {
display: block;
border: none;
padding: 0;
width: 380px;
font-size: 20px;
height: 20px;
}
.colourpicker-svslider {
width: 360px;
height: 360px;
display: inline-block;
}
.colourpicker-svindicator {
border: 1px solid white;
border-radius: 50%;
height: 5px;
width: 5px;
margin-left: -3px;
margin-top: -3px;
box-shadow: 0 0 3px rgba(0,0,0,0.3), inset 0 0 3px rgba(0,0,0,0.3);
}
.colourpicker-hueslider {
width: 20px;
height: 360px;
display: inline-block;
}
.colourpicker-hueindicator {
border: 1px solid white;
border-width: 1px 0;
margin-top: -1px;
width: 100%;
box-shadow: 0 0 3px rgba(0,0,0,0.3);
}
#bleh {
color: black;
}
#what {
color: white;
}
</style>
</head>
<body>
<h1>Colour Picker Test</h1>
<p>type in console: <code>picker</code></p>
<p id="bleh">0</p>
<p id="what">0</p>
<button type="button" onclick="picker.trigger(this)">show colour picker</button>
<script src="js/colour.min.js" charset="utf-8"></script>
<script type="text/javascript">
var picker=new ColourPicker(e=>{
p.innerHTML=q.innerHTML=picker.darkness();
p.style.backgroundColor=q.style.backgroundColor=e;
});
var p=document.querySelector('#bleh'),
q=document.querySelector('#what');
picker.colour="#FF594C";
</script>
</body>
</html>