-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (99 loc) · 3.19 KB
/
index.html
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
<html>
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="https://matti88.github.io/homeDashboard/favicon.ico">
<link rel="manifest" href="manifest.json">
<title>City Dashboard</title>
<style>
body {
background-color: #e8e8e8;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #333;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
}
h1 {
color: #4a90e2;
}
.container {
width: 80%;
max-width: 800px;
margin-top: 20px;
padding: 20px;
background-color: white;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
#clock,
#nextTramTime,
#weatherContainer {
font-size: 20px;
margin-bottom: 20px;
}
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
text-align: center;
border: 1px solid #ddd;
padding: 8px;
}
th {
background-color: #f2f2f2;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
</style>
<!-- Service Worker Registration -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('service-worker.js')
.then(registration => {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
})
.catch(error => {
console.log('ServiceWorker registration failed: ', error);
});
});
}
</script>
</head>
<body>
<div class="container">
<h1>Time and Next Departure</h1>
<div style="display: flex; flex-direction: row; align-items: center;">
<div id="pictureContainer"
style="display: flex; flex-direction: column; align-items: flex-start; border-radius: 8px;">
<img id="tramImage" src="./images/missedTrain.jpg"
style="max-width: 200px; max-height: 200px; width: auto; height: auto; border-radius: 8px;" />
</div>
<div id="textContainer"
style="display: flex; flex-direction: column; align-items: flex-start; border-radius: 8px; margin-left: 20px;">
<div>TIME: <div id="clock">01:38:56</div>
</div>
<div>Next departures:
<div id="nextTramTime">05:03, 05:10, 05:17, 05:24</div>
<div id="nextTimeCalc"></div>
</div>
</div>
</div>
</div>
<script src="clock.js"></script>
<script src="tramSchedule.js"></script>
</div>
<div class="container">
<h1>Vienna Weather Forecast</h1>
<div id="weatherContainer">
<!-- Weather Table Here -->
</div>
<script src="weather.js"></script>
</div>
</body>
</html>