-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html.tmpl
132 lines (118 loc) · 3.5 KB
/
index.html.tmpl
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
## "Crandard" template
##
## based on a template for WeeWX, which is
## Copyright 2009-2018 Tom Keffer
##
#errorCatcher Echo
##
## Specifying an encoding of UTF-8 is usually safe:
#encoding UTF-8
##
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="30">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link href='https://fonts.googleapis.com/css?family=Stylish' rel='stylesheet'>
<link rel="icon" type="image/png" href="favicon.ico" />
<style>
.currentTemp {
font-family: 'Stylish'; font-size: 224px;
# border: 1px outset red;
background-color: lightblue;
text-align: center;
line-height: 80%;
padding-top: 5px;
padding-bottom: 5px;
}
.currentTime {
font-family: 'Stylish'; font-size:224px;
# border: 1px outset red;
background-color: lightgreen;
text-align: center;
line-height: 80%;
padding-top: 5px;
padding-bottom: 5px;
}
.windBlinker {
font-family: 'Stylish'; font-size: 96px;
# border: 1px outset red;
background-color: lightblue;
text-align: center;
line-height: 80%;
padding-top: 5px;
padding-bottom: 5px;
}
// usunsed for the nonce, but leaving in, just in case:
.rainSummary {
font-family: 'Stylish'; font-size: 48px;
# border: 1px outset red;
background-color: lightblue;
text-align: center;
line-height: 100%;
padding-top: 25px;
padding-bottom: 20px;
}
.tempSummary {
font-family: 'Stylish'; font-size: 48px;
# border: 1px outset red;
background-color: lightblue;
text-align: center;
line-height: 10%;
padding-top: 1px;
padding-bottom: 5px;
}
</style>
<script>
function startAnimations() {
animateText();
setInterval(animateText, 4000);
startTime();
}
function animateText() {
var a;
a = document.getElementById("windBlinkerID");
a.innerHTML = "Now: $current.windSpeed";
setTimeout(function () {
a.innerHTML = "Max: $span($time_delta=1800).windSpeed.max";
}, 2000);
}
// add a zero in front of numbers<10
function leadingZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
function startTime() {
var now = new Date();
var h = now.getHours();
var m = now.getMinutes();
// var s = now.getSeconds();
m = leadingZero(m);
// s = leadingZero(s);
var am_pm = "AM";
if (h >= 12) {
am_pm = "PM";
}
if (h >= 13) {
h = h - 12;
}
// s = fixTime(s);
document.getElementById('currentTimeID').innerHTML = h + ":" + m + " " + am_pm;
setTimeout(function() {
startTime()
}, 5000);
}
</script>
</head>
<body onload="startAnimations()">
<div class="currentTemp">$current.outTemp.format(format_string="%.0f")</div>
<div class="currentTime" id="currentTimeID">¿?</div>
<div class="windBlinker" id="windBlinkerID">…</div>
</body>
</html>