forked from ChCh/chch-licht_github
better UX
This commit is contained in:
parent
689eebcd7a
commit
5fdfe5af55
33
index.html
33
index.html
|
@ -17,16 +17,29 @@
|
||||||
font-family: Blankenburg, sans-serif;
|
font-family: Blankenburg, sans-serif;
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
}
|
}
|
||||||
|
#picker2 * {
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
#picker {
|
#picker {
|
||||||
|
display:none;
|
||||||
margin:0;
|
margin:0;
|
||||||
padding:0;
|
padding:0;
|
||||||
border:0;
|
border:0;
|
||||||
width:80px;
|
width:90px;
|
||||||
border-left:20px solid #003d69;
|
|
||||||
padding-left: 2px;
|
padding-left: 2px;
|
||||||
line-height:20px;
|
line-height:20px;
|
||||||
}
|
}
|
||||||
|
#picker2 > div {
|
||||||
|
margin: auto;
|
||||||
|
background-color: #FFF;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
#picker2 .colpick_hex_field,
|
||||||
|
#picker2 .colpick_hex_field > div {
|
||||||
|
background-color: #FFF;
|
||||||
|
}
|
||||||
#form {
|
#form {
|
||||||
margin: 50px auto;
|
margin: 50px auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -49,6 +62,7 @@
|
||||||
<input name="fadestep" type="text" value="3"><br />
|
<input name="fadestep" type="text" value="3"><br />
|
||||||
<label for="color">Farbe: </label>
|
<label for="color">Farbe: </label>
|
||||||
<input name="color" type="text" value="003d69" id="picker"><br />
|
<input name="color" type="text" value="003d69" id="picker"><br />
|
||||||
|
<div id="picker2"></div>
|
||||||
<input id="mode-flashy" name="mode" type="radio" value="y">
|
<input id="mode-flashy" name="mode" type="radio" value="y">
|
||||||
<label for="mode-flashy">Hektisch</label><br />
|
<label for="mode-flashy">Hektisch</label><br />
|
||||||
<input id="mode-instant" name="mode" type="radio" value="s" checked="checked">
|
<input id="mode-instant" name="mode" type="radio" value="s" checked="checked">
|
||||||
|
@ -59,19 +73,20 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('#picker').colpick({
|
$('#picker2').colpick({
|
||||||
layout:'hex',
|
layout:'hex',
|
||||||
submit:0,
|
submit:0,
|
||||||
colorScheme:'light',
|
colorScheme:'light',
|
||||||
|
flat: true,
|
||||||
|
color: '003d69',
|
||||||
onChange:function(hsb,hex,rgb,el,bySetColor) {
|
onChange:function(hsb,hex,rgb,el,bySetColor) {
|
||||||
$(el).css('border-color','#'+hex);
|
|
||||||
// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
|
// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
|
||||||
if(!bySetColor) $(el).val(hex);
|
if(!bySetColor) $('#picker').val(hex);
|
||||||
}
|
}
|
||||||
}).keyup(function(){
|
}).keyup(function(){
|
||||||
$(this).colpickSetColor(this.value);
|
$(this).colpickSetColor(this.value);
|
||||||
})
|
});
|
||||||
$('#changeLight').submit(function(event) {
|
var callback = function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var data = $(this).serializeArray(),
|
var data = $(this).serializeArray(),
|
||||||
values = [];
|
values = [];
|
||||||
|
@ -81,7 +96,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
$.get('color.php' ,{'value': values['color'], 'mode': values['mode'], 'fadestep': values['fadestep']});
|
$.get('color.php' ,{'value': values['color'], 'mode': values['mode'], 'fadestep': values['fadestep']});
|
||||||
});
|
};
|
||||||
|
$('#changeLight').submit(callback);
|
||||||
|
$('#submit').on('click,enter', callback);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue