-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathembHTML.h
97 lines (88 loc) · 4.92 KB
/
embHTML.h
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
/**The MIT License (MIT)
Copyright (c) 2017 by Radim Keseg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
const char PAGE_INDEX[] PROGMEM = R"=====(
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>NeoPixel Cuckoo</title>
<script>
var simplePicker = {
colorize: function(color, destID){
if(color.match(/^#[0-9a-f]{3,6}$/)){
document.getElementById(destID).style.backgroundColor = color;
document.getElementById(destID).className = "color-box";
}else{
document.getElementById(destID).style.backgroundColor = "";
document.getElementById(destID).className = "color-box color-box-error";
}
},
init: function(){
this.colorize('{val-hand-hour}','box-hand-hour');
this.colorize('{val-hand-mins}','box-hand-mins');
this.colorize('{val-hand-secs}','box-hand-secs');
this.colorize('{val-segm-hour}','box-segm-hour');
this.colorize('{val-dots-hour}','box-dots-hour');
this.colorize('{val-dots-qrtr}','box-dots-qrtr');
}
};
window.onload = function(){
simplePicker.init();
}
</script>
<style>
.color-box{
width: 32px;
height: 20px;
display: inline-block;
border: 1px solid #000;
margin-bottom: -7px;
}
.color-box-error{
border: 1px solid #f00;
}
</style>
<body>
<h1>NeoPixel Cuckoo</h1>
<p>
Neopixel Cuckoo with an ESP8266 IoT device
<p/>
<form method='post' action='offset'>
<label>UTC TimeOffset<br><input id='_timeoffset' name='_timeoffset' length=5 pattern='^[0-9-\\.]{1,5}$' required value='{timeoffset}'></label><br>
<label>DST<br><input id='_dst' name='_dst' type='checkbox' {dst}></label><br>
<br/>
<label>Brightness by daylight<br><input id='_brightness' name='_brightness' length=3 pattern='^[0-9]{3,0}$' value='{brightness}'></label><br>
<label>Brightness at night<br><input id='_brightness_night' name='_brightness_night' length=3 pattern='^[0-9]{3,0}$' value='{brightness_night}'>22:00-06:00</label><br>
<br/>
<lable>Hand colors:</label><br/>
<label><input id="input-hand-hour" type="text" pattern="#[0-9a-f]{3,6}" name="_input-hand-hour" title="e.g. #f00 or #ff0000" value="{val-hand-hour}" onkeyup="simplePicker.colorize(this.value,'box-hand-hour')" ><div class="color-box" id="box-hand-hour"></div> hours</label><br/>
<label><input id="input-hand-mins" type="text" pattern="#[0-9a-f]{3,6}" name="_input-hand-mins" title="e.g. #0a0 or #00aa00" value="{val-hand-mins}" onkeyup="simplePicker.colorize(this.value,'box-hand-mins')"><div class="color-box" id="box-hand-mins"></div> minutes</label><br/>
<label><input id="input-hand-secs" type="text" pattern="#[0-9a-f]{3,6}" name="_input-hand-secs" title="e.g. #202 or #220022" value="{val-hand-secs}" onkeyup="simplePicker.colorize(this.value,'box-hand-secs')"><div class="color-box" id="box-hand-secs"></div> seconds</label><br/>
<label>Face</label><br>
<label><input id="input-segm-hour" type="text" pattern="#[0-9a-f]{3,6}" name="_input-segm-hour" title="e.g. #220 or #222200" value="{val-segm-hour}" onkeyup="simplePicker.colorize(this.value,'box-segm-hour')"><div class="color-box" id="box-segm-hour"></div> hour segment</label><br/>
<label><input id="input-dots-hour" type="text" pattern="#[0-9a-f]{3,6}" name="_input-dots-hour" title="e.g. #002 or #000022" value="{val-dots-hour}" onkeyup="simplePicker.colorize(this.value,'box-dots-hour')"><div class="color-box" id="box-dots-hour"></div> hour dots</label><br/>
<label><input id="input-dots-qrtr" type="text" pattern="#[0-9a-f]{3,6}" name="_input-dots-qrtr" title="e.g. #005 or #000055" value="{val-dots-qrtr}" onkeyup="simplePicker.colorize(this.value,'box-dots-qrtr')"><div class="color-box" id="box-dots-qrtr"></div> quarter dots</label><br/>
<br/>
<label>ALARM<br><input id='_alarm' name='_alarm' type='checkbox' {alarm}></label><br>
<label>Time<br><input id='_alarmHour' name='_alarmHour' length=2 pattern='^[0-9]{2,0}$' value='{alarmHour}'>:<input id='_alarmMins' name='_alarmMins' length=2 pattern='^[0-9]{2,0}$' value='{alarmMins}'></label>
<br/>
<input type='submit' value='Store'></form>
</body>
</html>
)=====";