10
0
Fork 0
chch-licht/index.html

104 lines
2.9 KiB
HTML
Raw Permalink Normal View History

2014-10-30 22:21:17 +01:00
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<title>chch-licht</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/colpick/js/colpick.js"></script>
<link rel="stylesheet" href="js/colpick/css/colpick.css" />
<style type="text/css">
2014-10-31 00:18:55 +01:00
@font-face{
font-family:"Blankenburg";
src:url('font/Blankenburg.ttf') format("truetype");
2014-10-30 23:58:21 +01:00
}
* {
2014-10-31 00:18:55 +01:00
font-family: Blankenburg, sans-serif;
font-size: 36px;
2014-10-30 23:58:21 +01:00
}
2014-10-31 00:47:07 +01:00
#picker2 * {
font-family: sans-serif;
font-size: 15px !important;
}
2014-10-30 23:58:21 +01:00
2014-10-30 22:21:17 +01:00
#picker {
2014-10-31 00:47:07 +01:00
display:none;
2014-10-30 22:21:17 +01:00
}
2014-10-31 00:47:07 +01:00
#picker2 > div {
margin: auto;
background-color: #FFF;
border: 0;
}
#picker2 .colpick_hex_field,
#picker2 .colpick_hex_field > div {
background-color: #FFF;
}
2014-10-30 22:21:17 +01:00
#form {
2014-10-31 00:49:22 +01:00
margin: 0 auto;
2014-10-30 22:21:17 +01:00
position: relative;
2014-10-31 00:18:55 +01:00
text-align: center;
2014-10-30 22:21:17 +01:00
}
input[name=fadestep] {
2014-10-31 00:18:55 +01:00
width: 40px;
2014-10-30 22:21:17 +01:00
}
2014-10-31 00:18:55 +01:00
h1 {
text-align: center;
font-size: 64px;
2014-10-30 22:21:17 +01:00
}
</style>
</head>
<body>
2014-10-31 00:18:55 +01:00
<h1>Leuchtmittelhauptsteuerung</h1>
2014-10-30 22:21:17 +01:00
<div id="form">
<form id="changeLight">
2014-10-31 00:18:55 +01:00
<label for="fadestep">Umschaltzeit in Sekunden: </label>
2014-10-31 00:54:09 +01:00
<input name="fadestep" type="text" value="10"><br />
2016-03-25 02:43:24 +01:00
<input name="color" type="text" value="003d69" id="picker">
2014-10-31 00:47:07 +01:00
<div id="picker2"></div>
2014-10-30 22:21:17 +01:00
<input id="mode-flashy" name="mode" type="radio" value="y">
2014-10-31 00:49:22 +01:00
<label for="mode-flashy">Hektisch</label>
2014-10-31 00:54:09 +01:00
<input id="mode-instant" name="mode" type="radio" value="s">
2014-10-31 00:49:22 +01:00
<label for="mode-instant">Sofort</label>
2014-10-31 00:54:09 +01:00
<input id="mode-fade" name="mode" type="radio" value="f" checked="checked">
2014-10-31 00:18:55 +01:00
<label for="mode-fade">Geschmeidig</label><br />
2014-10-31 23:17:52 +01:00
<input id="mode-stromstoss" name="stromstoss" type="checkbox" value="1">
<label for="mode-stromstoss">Stromstoß</label><br />
2014-10-31 00:18:55 +01:00
<button type="submit" id="submit">Erhelle mich!</button>
2014-10-30 22:21:17 +01:00
</form>
</div>
<script type="text/javascript">
2016-03-25 02:27:38 +01:00
default_color = 'ab571f';
2014-10-31 00:47:07 +01:00
$('#picker2').colpick({
2014-10-30 22:21:17 +01:00
layout:'hex',
submit:0,
colorScheme:'light',
2014-10-31 00:47:07 +01:00
flat: true,
2016-03-25 02:27:38 +01:00
color: default_color,
2014-10-30 22:21:17 +01:00
onChange:function(hsb,hex,rgb,el,bySetColor) {
// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
2016-03-25 02:27:38 +01:00
if(!bySetColor){
$('#picker').val(hex);
}
2014-10-30 22:21:17 +01:00
}
}).keyup(function(){
$(this).colpickSetColor(this.value);
2014-10-31 00:47:07 +01:00
});
2016-03-25 02:27:38 +01:00
$('#picker').val(default_color);
2014-10-31 00:47:07 +01:00
var callback = function(event) {
2014-10-30 22:21:17 +01:00
event.preventDefault();
var data = $(this).serializeArray(),
values = [];
for (var i = 0; i < data.length; i++) {
values[data[i]['name']] = data[i]['value'];
};
2014-10-31 23:17:52 +01:00
$.get('color.php' ,{'value': values['color'], 'mode': values['mode'], 'fadestep': values['fadestep'], 'stromstoss': values['stromstoss']});
2014-10-31 00:47:07 +01:00
};
$('#changeLight').submit(callback);
$('#submit').on('click,enter', callback);
2014-10-30 22:21:17 +01:00
</script>
</body>
</html>