-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.html
280 lines (268 loc) · 11.2 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!DOCTYPE html>
<html>
<head>
<title>Angular Color Picker Directive</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="css/color-picker.min.css" />
<style>
input[color-picker]{
margin-bottom: 10px;
width: 182px;
}
</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.min.js"></script>
<script src="js/color-picker.min.js"></script>
<script>var app = angular.module('app', ['colorpicker']);</script>
<script>
app.controller('AppCtrl', ['$scope', function ($scope) {
$scope.var3 = '#ff2e00';
$scope.var4 = '#e6ff00';
$scope.var5 = '#db00ff';
$scope.var6 = '#1fd27f';
$scope.var7 = '#008fff';
$scope.var8 = '#ff2e00';
$scope.var9 = '#e6ff00';
}]);
</script>
<div class="container" ng-app="app" ng-controller="AppCtrl">
<h1>Angular Color Picker Directive</h1>
<h4>AngularJS color picker directive with no dependencies.</h4>
<h4><b>by Alberto Pujante</b></h4>
<a class="btn btn-primary btn-lg" href="https://github.com/Alberplz/angular-colorpicker-directive">View on Github</a>
<div class="row">
<hr>
<div class="col-md-5">
<input color-picker
color-picker-model="var"/>
</div>
<div class="col-md-7">
<p>Basic usage:</p>
<pre>
<input color-picker
color-picker-model="var"/>
</pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-5">
<input color-picker
color-picker-model="var2"
ng-style="{background: var2}"/>
</div>
<div class="col-md-7">
<p>Changing background color:</p>
<pre>
<input color-picker
color-picker-model="var"
ng-style="{background:var}"/>
</pre>
</div>
</div>
<div class="row">
<hr>
<div class="col-md-5">
<input color-picker
color-picker-model="var3"
color-picker-output-format="'rgba'"
ng-style="{background: var3}"/><br><br>
<input color-picker
color-picker-model="var4"
color-picker-output-format="'hsla'"
ng-style="{background: var4}"/>
</div>
<div class="col-md-7">
<p>Output format:</p>
<pre>
<input color-picker
color-picker-model="var"
color-picker-output-format="'rgba'"
ng-style="{background: var}"/>
</pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-5">
<input color-picker
color-picker-show-value="false"
color-picker-model="var5"
ng-style="{background: var5}"/>
</div>
<div class="col-md-7">
<p>Hiding output text color. When user introduces a value the output color is showed, use a no editable html element if you want to avoid this behaviour:</p>
<pre>
<input color-picker
color-picker-model="var"
color-picker-show-value="false"
ng-style="{background:var}"/>
</pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-5">
<input color-picker
color-picker-model="var6"
color-picker-position="bottom"
ng-style="{background: var6}"/>
</div>
<div class="col-md-7">
<p>You can change the color picker position, </p>
<pre>
<input color-picker
color-picker-model="var"
color-picker-position="bottom"
ng-style="{background:var}"/>
</pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-5">
<input color-picker
color-picker-model="var7"
color-picker-fixed-position="true"
ng-style="{background: var7}"/>
</div>
<div class="col-md-7">
<p>or put it in a fixed position:</p>
<pre>
<input color-picker
color-picker-model="var"
color-picker-fixed-position="true"
ng-style="{background:var}"/>
</pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-5">
<input color-picker
color-picker-model="var8"
color-picker-show-input-spinner="true"
color-picker-spinner-rgba-steps="5;5;5;0.1"
color-picker-spinner-hsla-steps="5;5;5;0.1"
ng-style="{background: var8}"/>
</div>
<div class="col-md-7">
<p>You can show input spinner and change the step:</p>
<pre>
<input color-picker
color-picker-model="var"
color-picker-show-input-spinner="true"
color-picker-spinner-rgba-steps="5;5;5;0.1"
color-picker-spinner-hsla-steps="5;5;5;0.1"
ng-style="{background:var}"/>
</pre>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-5">
<input color-picker
color-picker-model="var9"
color-picker-show-cancel-button="true"
color-picker-cancel-button-class="btn btn-default btn-xs"
ng-style="{background: var9}"/>
</div>
<div class="col-md-7">
<p>Cancel button:</p>
<pre>
<input color-picker
color-picker-model="var"
color-picker-show-cancel-button="true"
color-picker-cancel-button-class="btn btn-default btn-xs"
ng-style="{background:var}"/>
</pre>
</div>
</div>
<hr>
<br>
<div class="row">
<div class="col-md-12">
<table class="table">
<thead>
<tr>
<th>Options</th>
<th>Values (default values in bold)</th>
</tr>
</thead>
<tbody>
<tr>
<td>color-picker-model</td>
<td>
Variable with the color value.
</td>
</tr>
<tr>
<td>color-picker-show-value</td>
<td>
<b>true</b>, false
</td>
</tr>
<tr>
<td>color-picker-output-format</td>
<td>
'rgba', 'hsla', <b>'hex'</b><br>
Don't forget single quotes. Notice that you can use a variable to control output format,<br>
for example, to let users change output format from interface.
</td>
</tr>
<tr>
<td>color-picker-position</td>
<td>
<b>right</b>, left, top, bottom
</td>
</tr>
<tr>
<td>color-picker-fixed-position</td>
<td>
true, <b>false</b>
</td>
</tr>
<tr>
<td>color-picker-show-input-spinner</td>
<td>
true, <b>false</b><br>
With false value you can still change values with the cursor.
</td>
</tr>
<tr>
<td>color-picker-spinner-rgba-steps</td>
<td>
A semicolon separated list with the steps, <b>default: 1;1;1;0.1</b>
</td>
</tr>
<tr>
<td>color-picker-spinner-hsla-steps</td>
<td>
A semicolon separated list with the steps, <b>default: 1;1;1;0.1</b>
</td>
</tr>
<tr>
<td>color-picker-show-cancel-button</td>
<td>
true, <b>false</b>
</td>
</tr>
<tr>
<td>color-picker-cancel-button-class</td>
<td>
Your custom class for cancel button.
</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr>
<footer class="footer">© Alberto Pujante 2016 | <a href="https://github.com/Alberplz/angular-colorpicker-directive">Angular Color Picker Directive</a></footer>
<br>
</div>
</body>
</html>