-
Notifications
You must be signed in to change notification settings - Fork 1
/
testbed.html
56 lines (53 loc) · 1.62 KB
/
testbed.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
<!DOCTYPE html>
<html>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js'></script>
<script src='https://code.jquery.com/jquery-2.1.4.js'></script>
<script src='build/html-palette.js'></script>
<link rel='stylesheet' href='build/palette.css'/>
<script>
angular.module('testbed', ['html-palette'])
.controller('TestbedController', ['$scope', function($scope){
window.scope = $scope;
$scope.fields = {color: {r:0.8705, g:0.6784, b: 0.7451, a: 0.9372}, radial: false};
}]);
</script>
<style>
.small { width: 200px !important; }
.med { width: 230px !important; }
.large { width: 260px !important; }
</style>
</head>
<body>
<div id='angularPicker' ng-app='testbed' ng-controller='TestbedController'>
<p>This picker is implemented with an Angular.js directive:</p>
<html-palette radial='fields.radial' color='fields.color' use-alpha='true' css='large'></html-palette>
</div>
<div>
<p>This picker is in Vanilla.js:</p>
<div id='classicPicker' class='html-palette'></div>
<script>
var palette = new HtmlPalette( document.getElementById('classicPicker'), {
radial: true,
popupEdge: 'e',
initialColor: {h: 0.3, s: 0.8, v: 0.8},
useAlpha: true,
updateTriggerBg: true,
css: 'med'
});
</script>
</div>
<div>
<p>This picker is implemented with jQuery:</p>
<div id='jqPicker' class='html-palette'></div>
<script>
$('#jqPicker').HtmlPalette({
popupEdge: 'ne',
initialColor: {r: 0.7, g: 0.7, b: 1.0},
updateTriggerBg: true,
css: 'small'
});
</script>
</div>
</body>
</html>