-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo.html
159 lines (130 loc) · 6.73 KB
/
demo.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
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>LC color picker - by LCweb</title>
<!-- PAGE BASE CSS -->
<style type="text/css"> a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
*{box-sizing:border-box;line-height:normal}body{background:#fcfcfc;font-family:sans-serif;color:#303030}.container:after{content:"";display:block;clear:both}.header{text-align:center;padding:40px 20px 20px;background:#343434;border-bottom:4px solid #7dc242;position:relative;z-index:2;overflow:hidden;color:#fefefe;}#logo{border:0;background:#343434;padding:0;position:relative;bottom:-5px;width:29px;margin-right:5px}.header svg{filter:blur(1px);opacity:.015;position:absolute;top:0;left:0;right:0;bottom:0;transform:rotate(3deg) scale(1.35);z-index:-1}.left-shade{fill:#afafaf}.right-shade{fill:#bfbfbf}.header h2{font-size:34px;margin-top:-12px;}.header h4{font-size:18px;font-weight:400;line-height:135%;margin:15px 0;color:#f0f0f0;}.header h4 a{color:#cfcfcf;}.content{max-width:1200px; margin:auto;}
</style>
<style>
.content form {
border: 12px solid #f8f8f8;
background: #f4f4f4;
padding: 45px;
margin: 70px auto 40px;
border-radius: 5px;
max-width: 900px;
box-shadow: 0 1px 7px rgba(0,0,0,0.2);
}
.content input,
.content textarea {
width: 100%;
background: #fff;
border: 2px solid #ccc;
border-radius: 2px;
padding: 8px 10px;
border-radius: 2px;
font-size: 100%;
transition: all .2s ease;
}
.content input:hover,
.content textarea:hover,
.content input:active,
.content textarea:active,
.content input:focus,
.content textarea:focus {
border: 2px solid rgba(125, 194, 66, 0.8);
}
.content label {
display: block;
font-weight: bold;
letter-spacing: 0.02em;
color: #666;
text-shadow: 0 0 0 #666;
padding: 5px 0 8px;
}
.content label:not(:first-of-type) {
margin-top: 30px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h2>
<img id="logo" src=" data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAlCAMAAAD7q3BLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAxQTFRFS1NFfsJCx8jKNDQ0SyWmjgAAAAR0Uk5T////AEAqqfQAAACySURBVHja7JTLFsQgCEOD/P8/jw9EgjiLWU88XQi3sSoUSgJaQwrRRNqQ4EWgbQEVcfKTuQgwEGxQGZANXnlnUCzAS0Hf+WXTB3lA1vDAPBxHEMWbWnM+bnFXse1g2ZnOBjshlhuPbPVZIIzRk7+JGYnAr4R8J/RPXGcaxXd77i71JxHi7+pVY0KMEVTudKXji69aj5WVidUvSgwRiH1bEMi9n4jc+26zCdT/ICdi9CPAAHRlCGHRLtsqAAAAAElFTkSuQmCC" />
LC Color Picker
</h2>
<h4>The colorpicker for modern web, by <a href="https://lcweb.it" target="_blank">LCweb</a></h4>
<svg width="100%" height="100%">
<pattern id="pattern-cubes" x="0" patternUnits="userSpaceOnUse" viewBox="0 0 10 16" height="100" width="116" y="68">
<g id="cube">
<path class="left-shade" d="M0 0l5 3v5l-5 -3z" />
<path class="right-shade" d="M10 0l-5 3v5l5 -3" />
</g>
<use x="5" y="8" xlink:href="#cube" />
<use x="-5" y="8" xlink:href="#cube" />
</pattern>
<rect x="0" y="0" width="100%" height="100%" fill="url(#pattern-cubes)" />
</svg>
</div>
<div class="content">
<!-- //////////////////////////////////////////////// -->
<!-- REQUIRED HTML -->
<form>
<label>Basic solid colorpicker and preventing direct user input</label>
<input type="text" name="solid" value="#1a6ff4" style="width: 75px;" />
<label>Simple input field with solid color, supporting opacity</label>
<input type="text" name="simple" value="rgba(115, 26, 244, 0.66)" />
<label>Full featured!</label>
<input type="text" name="full" value="linear-gradient(90deg, rgba(255, 255, 255, .4), #000)" />
</form>
<!-- //////////////////////////////////////////////// -->
</div>
</div>
<!-- //////////////////////////////////////////////// -->
<!-- REQUIRED JAVASCRIPT -->
<script src="lc_color_picker.js"></script>
<script>
new lc_color_picker('input[name=solid]', {
modes : ['solid'],
transparency : false,
no_input_mode : true,
preview_style : {
input_padding : 45,
side : 'right',
width : 40,
},
});
new lc_color_picker('input[name="simple"]', {
modes : ['solid'],
transparency : true,
open_on_focus : true,
wrap_width : '100%',
preview_style : {
input_padding : 45,
side : 'left',
width : 40,
},
fallback_colors : ['rgb(115, 26, 244)'],
});
new lc_color_picker('input[name="full"]', {
transparency : true,
open_on_focus : true,
wrap_width : '100%',
preview_style : {
input_padding : 45,
side : 'left',
width : 40,
},
fallback_colors : ['#ff0', 'linear-gradient(90deg, rgba(255, 255, 255, .4), #000)'],
on_change: function(new_value, target_field) {
console.log({new_value, target_field});
},
});
</script>
<!-- //////////////////////////////////////////////// -->
</body>
</html>