chch-licht_github/index.html

88 lines
2.4 KiB
HTML

<!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">
@font-face{
font-family:"Blankenburg";
src:url('font/Blankenburg.ttf') format("truetype");
}
* {
font-family: Blankenburg, sans-serif;
font-size: 36px;
}
#picker {
margin:0;
padding:0;
border:0;
width:80px;
border-left:20px solid #003d69;
padding-left: 2px;
line-height:20px;
}
#form {
margin: 50px auto;
position: relative;
text-align: center;
}
input[name=fadestep] {
width: 40px;
}
h1 {
text-align: center;
font-size: 64px;
}
</style>
</head>
<body>
<h1>Leuchtmittelhauptsteuerung</h1>
<div id="form">
<form id="changeLight">
<label for="fadestep">Umschaltzeit in Sekunden: </label>
<input name="fadestep" type="text" value="3"><br />
<label for="color">Farbe: </label>
<input name="color" type="text" value="003d69" id="picker"><br />
<input id="mode-flashy" name="mode" type="radio" value="y">
<label for="mode-flashy">Hektisch</label><br />
<input id="mode-instant" name="mode" type="radio" value="s" checked="checked">
<label for="mode-instant">Sofort</label><br />
<input id="mode-fade" name="mode" type="radio" value="f">
<label for="mode-fade">Geschmeidig</label><br />
<button type="submit" id="submit">Erhelle mich!</button>
</form>
</div>
<script type="text/javascript">
$('#picker').colpick({
layout:'hex',
submit:0,
colorScheme:'light',
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.
if(!bySetColor) $(el).val(hex);
}
}).keyup(function(){
$(this).colpickSetColor(this.value);
})
$('#changeLight').submit(function(event) {
event.preventDefault();
var data = $(this).serializeArray(),
values = [];
for (var i = 0; i < data.length; i++) {
values[data[i]['name']] = data[i]['value'];
};
$.get('color.php' ,{'value': values['color'], 'mode': values['mode'], 'fadestep': values['fadestep']});
});
</script>
</body>
</html>