-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
180 lines (180 loc) · 10.1 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SNCB Watcher</title>
<link rel="stylesheet" id="bootstrap-css" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css">
<link rel="stylesheet" id="bootstrap-icons-css" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script src="js/app.js" type="module"></script>
<!-- Fix the bootstrap dark theme colors -->
<style>
[data-bs-theme=dark] {
--bs-form-control-bg: #212529;
}
[data-bs-theme=dark] .btn {
--bs-btn-color: #adb5bd;
}
[data-bs-theme=dark] .btn-primary {
--bs-btn-color: #fff;
}
</style>
</head>
<body>
<nav class="navbar sticky-top bg-body-secondary mb-4">
<div class="container-fluid">
<span class="navbar-brand">
SNCB Watcher
</span>
<div>
<button class="btn fs-2" data-bs-toggle="modal" data-bs-target="#watch-train-modal">
<i class="bi bi-plus-square"></i>
</button>
<button class="btn fs-2" id="request-notifications-btn">
<i class="bi bi-app-indicator"></i>
</button>
<span class="dropdown" id="change-language">
<button class="btn fs-2" data-bs-toggle="dropdown">
<i class="bi bi-translate"></i>
</button>
<ul class="dropdown-menu font-monospace" style="--bs-dropdown-min-width: 3.67rem;top: auto;">
<li><a class="btn dropdown-item" href="?lng=en">En</a></li>
<li><a class="btn dropdown-item" href="?lng=fr">Fr</a></li>
<li><a class="btn dropdown-item" href="?lng=nl">Nl</a></li>
</ul>
</span>
<button class="btn fs-2" id="toggle-theme-btn">
<i class="bi bi-moon"></i>
</button>
</div>
</div>
</nav>
<div class="container">
<div id="watched-trains">
<div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4">
<train-card train-number="IC514" station="Bruxelles-Nord">
</div>
</div>
</div>
<div class="modal modal-lg" id="watch-train-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" data-i18n="modal:followNewTrain"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" data-i18n="[aria-label]close;[title]close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-lg-4">
<fieldset>
<legend data-i18n="modal:perTrainNumber"></legend>
<form id="form-by-train-number">
<div class="mb-3">
<div class="d-flex justify-content-between align-items-center">
<label for="modal-train-number" class="form-label" data-i18n="modal:trainNumber"></label>
<div class="spinner-border spinner-border-sm d-none" id="modal-train-number-spinner" role="status">
<span class="visually-hidden" data-i18n="loading"></span>
</div>
</div>
<input type="text" class="form-control" name="train-number" id="modal-train-number" required>
</div>
<div class="mb-3">
<label for="modal-train-number-station" class="form-label" data-i18n="modal:station"></label>
<select class="form-select" name="station" id="modal-train-number-station" required default-empty>
</select>
</div>
<button type="submit" class="btn btn-primary mb-3" data-i18n="modal:watchTrain"></button>
</form>
</fieldset>
</div>
<div class="col-lg-8">
<fieldset>
<legend data-i18n="modal:perConnection"></legend>
<form id="form-by-connection">
<div class="row row-cols-2">
<div class="col mb-3">
<label for="modal-connection-start-station" class="form-label" data-i18n="modal:departureStation"></label>
<input list="all-stations" class="form-control" name="start-station" id="modal-connection-start-station" required>
</div>
<div class="col mb-3">
<label for="modal-connection-end-station" class="form-label" data-i18n="modal:arrivalStation"></label>
<input list="all-stations" class="form-control" name="end-station" id="modal-connection-end-station" required>
</div>
<div class="col mb-3">
<label for="modal-connection-time" class="form-label" data-i18n="modal:time"></label>
<input type="time" class="form-control" name="time" id="modal-connection-time" required>
</div>
<div class="col mb-3 btn-group-vertical" role="group">
<input type="radio" class="btn-check" name="time-type" id="modal-connection-time-start" value="departure" checked>
<label class="btn btn-outline-secondary" for="modal-connection-time-start" data-i18n="modal:departure"></label>
<input type="radio" class="btn-check" name="time-type" id="modal-connection-time-end" value="arrival">
<label class="btn btn-outline-secondary" for="modal-connection-time-end" data-i18n="modal:arrival"></label>
</div>
</div>
<button type="submit" class="btn btn-primary mb-3" data-i18n="modal:searchConnection"></button>
<div class="spinner-border spinner-border ms-3 d-none" id="modal-connection-spinner" role="status">
<span class="visually-hidden" data-i18n="loading"></span>
</div>
<ul id="found-connections" class="list-group" default-empty></ul>
</form>
</fieldset>
</div>
</div>
</div>
</div>
</div>
</div>
<datalist id="all-stations" data-loaded="0"></datalist>
<template id="train-card-template">
<div class="col">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center pe-2">
<div class="text-truncate">
<span class="tc-train-number"></span>
–
<span class="tc-station"></span>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary tc-btn-refresh">
<i class="bi bi-arrow-clockwise"></i>
</button>
<button type="button" class="btn btn-secondary tc-btn-alert">
<i class="bi bi-bell"></i>
</button>
<button type="button" class="btn btn-danger tc-btn-close" data-i18n="[aria-label]close;[title]close">
<i class="bi bi-x-lg"></i>
</button>
</div>
</div>
<div class="card-body">
<div class="d-none tc-error"></div>
<table class="table tc-table">
<col style="width: 2.5rem;">
<col style="width: 1.8rem;">
<col style="width: 2.5rem;">
<col style="width: 1.8rem;">
<col>
<col style="width: 2.2rem;">
<tbody class="tc-rows"></tbody>
</table>
</div>
<div class="card-footer tc-footer">
<small class="text-muted"><span data-i18n="train-card:update"></span> <span class="tc-update"></span></small>
</div>
</div>
</div>
</template>
<template id="train-card-row-template">
<tr>
<td class="tsr-arrival-time px-0 text-end"></td>
<td class="px-0"><sup class="tsr-arrival-delay"></sup></td>
<td class="tsr-departure-time px-0 text-end"></td>
<td class="px-0"><sup class="tsr-departure-delay"></sup></td>
<td><div class="tsr-station text-truncate"></div></td>
<td class="tsr-platform text-end"></td>
</tr>
</template>
</body>
</html>