2024-09-11 02:09:08 +02:00
|
|
|
(defwidget traveldings []
|
|
|
|
(revealer
|
|
|
|
:class "traveldings"
|
|
|
|
:transition "crossfade"
|
|
|
|
:reveal { traveldings_data != "null" }
|
|
|
|
(traveldingsBarWidget)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defwidget traveldingsBarWidget []
|
|
|
|
(overlay
|
|
|
|
(box
|
|
|
|
:width 640
|
|
|
|
(label
|
|
|
|
:halign "start"
|
|
|
|
:text "${traveldings_data.line} -> ${strlength(traveldings_data.arrival_station) > 24 ? "${substring(traveldings_data.arrival_station, 0, 24)}…" : traveldings_data.arrival_station}${traveldings_data.arrival_platform_data_available ? " (Gl. ${traveldings_data.arrival_platform_real})" : ""}"
|
|
|
|
)
|
|
|
|
(label
|
|
|
|
:halign "end"
|
|
|
|
:text { traveldings_data.time_left >= 3600 ? formattime(traveldings_data.time_left, "noch %-Hh %-Mmin", "Etc/UTC") : formattime(traveldings_data.time_left, "noch %-Mmin", "Etc/UTC") }
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(box
|
|
|
|
(progress
|
2024-09-26 19:15:58 +02:00
|
|
|
:class { traveldings_data.live ? "traveldings_live" : "traveldings_disconnected" }
|
2024-09-11 02:09:08 +02:00
|
|
|
:value {traveldings_data.progress * 100}
|
|
|
|
:orientation "horizontal"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(deflisten traveldings_data
|
|
|
|
:initial "null"
|
|
|
|
"traveldings current"
|
|
|
|
)
|