-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tpl
99 lines (99 loc) · 2.11 KB
/
index.tpl
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Meteo cu Busu</title>
<link href='https://fonts.googleapis.com/css?family=Raleway:400,300,500,700,800&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/static/css/weather-icons.css">
<style>
html, body {
margin: 0;
padding: 0;
font-family: sans-serif;
overflow: hidden;
}
.backdrop {
background: url('https://farm7.staticflickr.com/6203/6074810680_d4bb65667e_o_d.jpg');
background-size: cover;
border: 1px solid black;
width: 1440px;
height: 900px;
overflow: auto;
}
.card {
/*float: left;*/
padding: 1.5em;
/*font-family: 'Source Sans Pro', sans-serif;*/
/*font-family: 'Roboto', sans-serif;*/
font-family: 'Raleway', sans-serif;
font-weight: 500;
border: 1px solid black;
text-align: center;
font-size: 36px;
}
.card .icon {
font-size: 3em;
}
.slug {
border: 1px solid black;
font-family: 'Raleway', sans-serif;
font-size: 24px;
margin-top: .4em;
/*float: left;*/
/*display: inline-block;*/
}
.slug .time {
text-align: center;
xfont-weight: 700;
background: rgba(128, 128, 128, 0.5);
width: 3em;
}
.slug .details {
font-weight: 300;
}
.slug .details,
.slug .time {
display: inline-block;
padding: .5em;
}
.slug .temperature {
font-weight: 700;
}
.card,
.slug {
background-color: rgba(255, 255, 255, 0.5);
}
.forecast {
display: inline-block;
padding: 1em 0 0 1em;
}
</style>
</style>
</head>
<body>
<div class="backdrop">
<div class="forecast">
</div>
</div>
<script>
function replaceCurrentForecast(newForecastMarkup) {
var parent = document.querySelector('.forecast');
parent.innerHTML = newForecastMarkup;
}
function asyncRefresh(finalCallback) {
var req = new XMLHttpRequest();
req.addEventListener("load", function() {
replaceCurrentForecast(this.responseText);
if (finalCallback) {
setInterval(finalCallback, 1000 * 60 * 30 /* 30 min */);
}
});
req.open("GET", "/data");
req.send();
}
document.addEventListener('DOMContentLoaded', function() {
asyncRefresh(asyncRefresh);
})
</script>
</body>
</html>