-
Notifications
You must be signed in to change notification settings - Fork 0
/
colour-picker.html
136 lines (121 loc) · 3.68 KB
/
colour-picker.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<title>Leximosi</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<meta name='author' content='Erik Frèrejean'>
<link href='//twitter.github.com/bootstrap/assets/css/bootstrap.css' rel='stylesheet'>
<link href='//twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css' rel='stylesheet'>
<link href='//google-code-prettify.googlecode.com/svn/trunk/src/prettify.css' rel='stylesheet'>
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
</head>
<body>
<div class='navbar navbar-inverse navbar-fixed-top'>
<div class='navbar-inner'>
<div class='container-fluid'>
<a class='brand' href='http://leximosi.github.com/'>Leximosi</a>
<div class='nav-collapse collapse'>
<ul class='nav'>
<li class='active'><a href='#'>Home</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class='container-fluid'>
<div class='row-fluid'>
<div class='span3'>
<div class='well sidebar-nav'>
<ul class='nav nav-list'>
<li class='nav-header'>Navigation</li>
<li><a href='./index.html'>Home</a></li>
<li class='active'><a href='#'>Leximosi Colour Picker</a></li>
</ul>
</div>
</div>
<div class='span9'>
<div class="hero-unit">
<h1>Colour Picker</h1>
<p>The "Leximosi Colour Picker" is a simple colour picker utilising jQuery and the HTML5 canvas object.</p>
</div>
<div class='row-fluid'>
<div>
<h2>The colour picker</h2>
<p class='span9'>The colour picker is a jQuery plugin that works right out of the box.</p>
</div>
</div>
<div class='row-fluid'>
<div>
<p class='span4' id='colour-picker-default'></p>
<pre class="span5 prettyprint linenums">
$(document).ready(function()
{
$("#colourPicker").LeximosiColourPicker({});
});
</pre>
</div>
</div>
<div class='row-fluid'>
<div id='font-colour-action'>
<h2>The colour picker - custom action</h2>
<p class='span9'>Easily add custom actions, on an event basis.</p>
</div>
</div>
<div class='row-fluid'>
<div>
<p class='span4' id='colour-picker-custom-action'></p>
<pre class="span5 prettyprint linenums">
$('#colour-picker-custom-action').LeximosiColourPicker({
events: {
picker: {
'mousedown mousemove touchstart touchmove': function (e, handler)
{
if (handler.handle !== true) { return; }
$('#font-colour-action > p').css('color', handler.colourPicker._currentToHEX())
}
}
}
});
</pre>
</div>
</div>
</div>
</div>
<hr>
<footer>
<p>© Erik Frèrejean 2012</p>
<p>Powered by <a href="http://twitter.github.com/bootstrap">Bootstrap</a></p>
</footer>
</div>
<script src='//code.jquery.com/jquery-latest.js'></script>
<script src='//google-code-prettify.googlecode.com/svn/trunk/src/prettify.js'></script>
<script src='//raw.github.com/Leximosi/ColourPicker/master/lib/ColourPicker.js'></script>
<script src='./lib/bootstrap/docs/assets/js/bootstrap.js'></script>
<script>
$(document).ready(function() {
prettyPrint();
$('#colour-picker-custom-action').LeximosiColourPicker({
events: {
picker: {
'mousedown mousemove touchstart touchmove': function (e, handler)
{
if (handler.handle !== true) { return; }
$('#font-colour-action > p').css('color', handler.colourPicker._currentToHEX())
}
}
}
});
$('#colour-picker-default').LeximosiColourPicker({});
});
</script>
</body>
</html>