-
Notifications
You must be signed in to change notification settings - Fork 0
/
seajs.html
86 lines (82 loc) · 2.45 KB
/
seajs.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Color Picker</title>
<script src="http://assets.spmjs.org/seajs/seajs/2.1.0/sea.js"></script>
<script type="text/javascript">
seajs.config({
alias: {
"$": "jquery/jquery/1.7.2/jquery",
"events": "arale/events/1.1.0/events"
}
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-21475122-5']);
_gaq.push(['_setCustomVar', 1, 'Repo', 'lepture/color-picker']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
if (location.port || !/^http/.test(location.protocol)) {
return;
}
ga.src = '//www.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<link rel="stylesheet" href="src/color-picker.css" />
<style type="text/css">
.wrapper {
font: 400 18px/1.62 "Georgia", serif;
color: #333332;
margin: 50px auto 20px;
max-width: 860px;
width: 80%;
}
.footer {
margin-top: 100px;
color: #dcdcdd;
font-size: 14px;
}
.footer a {
color: #dcdcdd;
}
#changelog {
margin-left: 0;
padding-left: 18px;
list-style-type: square;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="color-field">
<label for="input-color">Colors</label>
<input id="input-color" type="color" />
</div>
<ul id="changelog">
</ul>
<div class="footer">
<p>A component by <a href="http://lepture.com">lepture</a>.</p>
</div>
</div>
<a href="https://github.com/lepture/color-picker" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" class="github">
</a>
<script type="text/javascript">
seajs.use('./src/color-picker', function(ColorPicker) {
var picker = new ColorPicker();
var changelog = document.getElementById('changelog');
var input = document.getElementById('input-color');
picker.takeover(input);
picker.on('change', function(color) {
var li = document.createElement('li');
li.innerHTML = color;
changelog.insertBefore(li, changelog.firstChild);
});
});
</script>
</body>
</html>