diff options
-rwxr-xr-x | bin/nvm | 4 | ||||
-rw-r--r-- | static/v0/css/wip.css | 23 | ||||
-rw-r--r-- | templates/departure_list.html | 7 |
3 files changed, 24 insertions, 10 deletions
@@ -62,6 +62,10 @@ class Departure: else: self.sort_by = 0 + if self.delay: + self.delay = self.delay // 60 + self.delay = f"{self.delay:+.0f}" + def set_relative(self, now): minutes = (self.sort_by - now) // 60 if minutes < 1: diff --git a/static/v0/css/wip.css b/static/v0/css/wip.css index 965f5ec..a5f9424 100644 --- a/static/v0/css/wip.css +++ b/static/v0/css/wip.css @@ -42,13 +42,13 @@ ul.departures > li.cancelled { ul.departures li .line { position: absolute; - bottom: 0; + bottom: 2px; left: 2px; max-width: 6em; max-height: 3ex; - max-width: 4em; + max-width: 5em; overflow: hidden; - font-size: 150%; + font-size: 140%; background-color: #eeeeee; font-weight: bold; padding-left: 0.1em; @@ -76,29 +76,33 @@ ul.departures li .bus { ul.departures li .dest { position: absolute; bottom: 0; - left: 4em; + left: 5em; width: 70%; overflow: hidden; background-color: transparent; - font-size: 160%; + font-size: 150%; color: black; } ul.departures li .destsuffix { position: absolute; top: 1px; - left: 6.5em; + left: 7.6em; width: 70%; height: 1.2em; overflow: hidden; } +ul.departures li .time .delay { + padding-right: 1ex; + color: #ff0000; +} + ul.departures li .time { position: absolute; right: 5px; - top: 4px; + top: 1px; background-color: transparent; - font-size: 100%; padding-left: 0.2em; color: black; } @@ -109,7 +113,8 @@ ul.departures li .platform { right: 5px; overflow: hidden; background-color: transparent; - font-size: 150%; + font-size: 140%; + font-weight: bold; color: black; } diff --git a/templates/departure_list.html b/templates/departure_list.html index 37f259b..e234a2c 100644 --- a/templates/departure_list.html +++ b/templates/departure_list.html @@ -31,7 +31,12 @@ {% if departure.cancelled and departure.plannedWhen %} <span class="time" aria-label="um {{ departure.plannedWhen }}">{{ departure.plannedWhen.strftime("%H:%M") }}</span> {% else %} - <span class="time" aria-label="in {{ departure.relativeWhen }}">{{ departure.relativeWhen }}</span> + <span class="time" aria-label="Abfahrtszeit: {{ departure.relativeWhen }}"> + {% if departure.delay %} + <span class="delay" aria-label="{{ departure.delay }} Minuten Verspätung">({{ departure.delay }})</span> + {% endif %} + {{ departure.relativeWhen }} + </span> {% endif %} {% if departure.platform %} <span class="platform" aria-label="Gleis/Bussteig {{ departure.platform }}">{{ departure.platform }}</span> |